From 2c7b39aa4467eaeaa28d5650d286ff7e49e3f9f8 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Thu, 5 Jul 2018 11:04:04 +0300 Subject: [PATCH 001/322] Change message for import *-ing an export=. Update baselines --- src/compiler/checker.ts | 3 +- src/compiler/diagnosticMessages.json | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- .../es6ExportEqualsInterop.errors.txt | 36 +++++++++---------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 207d7317078..669938b597d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2269,7 +2269,8 @@ namespace ts { const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) { - error(referencingLocation, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol!)); + error(referencingLocation, Diagnostics.ECMAScript_imports_can_only_reference_an_export_declaration_with_the_esModuleInterop_flag_enabled_and_by_using_default_imports); + return symbol; } if (compilerOptions.esModuleInterop) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 40a4c4d09d4..75e2d35c471 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1744,7 +1744,7 @@ "category": "Error", "code": 2496 }, - "Module '{0}' resolves to a non-module entity and cannot be imported using this construct.": { + "ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports.": { "category": "Error", "code": 2497 }, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 99452b93d47..a251e4d9361 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5266,7 +5266,7 @@ declare namespace ts { Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: DiagnosticMessage; Type_0_is_not_an_array_type_or_a_string_type: DiagnosticMessage; The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: DiagnosticMessage; - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: DiagnosticMessage; + ECMAScript_imports_can_only_reference_an_export_declaration_with_the_esModuleInterop_flag_enabled_and_by_using_default_imports: DiagnosticMessage; Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: DiagnosticMessage; An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: DiagnosticMessage; A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: DiagnosticMessage; diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index 4675136d081..2d29884065c 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -11,24 +11,24 @@ tests/cases/compiler/main.ts(33,8): error TS1192: Module '"function"' has no def tests/cases/compiler/main.ts(34,8): error TS1192: Module '"function-module"' has no default export. tests/cases/compiler/main.ts(35,8): error TS1192: Module '"class"' has no default export. tests/cases/compiler/main.ts(36,8): error TS1192: Module '"class-module"' has no default export. -tests/cases/compiler/main.ts(39,21): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(45,21): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. -tests/cases/compiler/main.ts(47,21): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(39,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(45,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(47,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(50,1): error TS2693: 'y1' only refers to a type, but is being used as a value here. tests/cases/compiler/main.ts(56,4): error TS2339: Property 'a' does not exist on type '() => any'. tests/cases/compiler/main.ts(58,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. tests/cases/compiler/main.ts(62,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(62,25): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(62,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(68,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(68,25): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(68,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(70,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(70,25): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(70,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(85,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(85,25): error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(85,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(91,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(91,25): error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(91,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(93,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(93,25): error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +tests/cases/compiler/main.ts(93,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. tests/cases/compiler/main.ts(97,15): error TS2498: Module '"interface"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(98,15): error TS2498: Module '"variable"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(99,15): error TS2498: Module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. @@ -108,7 +108,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses // namespace import import * as y1 from "interface"; ~~~~~~~~~~~ -!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import * as y2 from "variable"; import * as y3 from "interface-variable"; import * as y4 from "module"; @@ -116,11 +116,11 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses import * as y6 from "variable-module"; import * as y7 from "function"; ~~~~~~~~~~ -!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import * as y8 from "function-module"; import * as y9 from "class"; ~~~~~~~ -!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import * as y0 from "class-module"; y1.a; @@ -145,7 +145,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import { a as a2 } from "variable"; import { a as a3 } from "interface-variable"; import { a as a4 } from "module"; @@ -155,13 +155,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import { a as a8 } from "function-module"; import { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. import { a as a0 } from "class-module"; a1; @@ -180,7 +180,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: Module '"interface"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. export { a as a2 } from "variable"; export { a as a3 } from "interface-variable"; export { a as a4 } from "module"; @@ -190,13 +190,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: Module '"function"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. export { a as a8 } from "function-module"; export { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: Module '"class"' resolves to a non-module entity and cannot be imported using this construct. +!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. export { a as a0 } from "class-module"; // export-star From 312a5f9951bc1402daa09a81bb00c13a9bae42dd Mon Sep 17 00:00:00 2001 From: Alexander T Date: Wed, 11 Jul 2018 14:55:11 +0300 Subject: [PATCH 002/322] Change message for import *-ing an export= based on module type. Update tests/baselines --- src/compiler/checker.ts | 8 ++++- src/compiler/diagnosticMessages.json | 2 +- .../es6ExportEqualsInterop.errors.txt | 36 +++++++++---------- ...EqualsExportModuleCommonJsError.errors.txt | 15 ++++++++ ...s6ImportEqualsExportModuleCommonJsError.js | 26 ++++++++++++++ ...ortEqualsExportModuleCommonJsError.symbols | 16 +++++++++ ...mportEqualsExportModuleCommonJsError.types | 16 +++++++++ ...rtEqualsExportModuleEs2015Error.errors.txt | 18 ++++++++++ .../es6ImportEqualsExportModuleEs2015Error.js | 22 ++++++++++++ ...mportEqualsExportModuleEs2015Error.symbols | 16 +++++++++ ...6ImportEqualsExportModuleEs2015Error.types | 16 +++++++++ ...s6ImportEqualsExportModuleCommonJsError.ts | 11 ++++++ .../es6ImportEqualsExportModuleEs2015Error.ts | 11 ++++++ 13 files changed, 193 insertions(+), 20 deletions(-) create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.js create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.symbols create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.types create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.js create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.symbols create mode 100644 tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.types create mode 100644 tests/cases/compiler/es6ImportEqualsExportModuleCommonJsError.ts create mode 100644 tests/cases/compiler/es6ImportEqualsExportModuleEs2015Error.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7561255c25b..02efec7ba13 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2281,9 +2281,15 @@ namespace ts { // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol: Symbol | undefined, referencingLocation: Node, dontResolveAlias: boolean): Symbol | undefined { const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol) { if (!(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable)) && !getDeclarationOfKind(symbol, SyntaxKind.SourceFile)) { - error(referencingLocation, Diagnostics.ECMAScript_imports_can_only_reference_an_export_declaration_with_the_esModuleInterop_flag_enabled_and_by_using_default_imports); + const compilerOptionName = moduleKind >= ModuleKind.ES2015 + ? "allowSyntheticDefaultImports" + : "esModuleInterop"; + + error(referencingLocation, Diagnostics.When_writing_ECMAScript_imports_callable_export_style_modules_can_only_be_imported_by_turning_on_the_0_flag_and_using_a_default_import, compilerOptionName); + return symbol; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index da818948870..365014ab318 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1744,7 +1744,7 @@ "category": "Error", "code": 2496 }, - "ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports.": { + "When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the '{0}' flag and using a default import.": { "category": "Error", "code": 2497 }, diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index 2d29884065c..bebe3f45940 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -11,24 +11,24 @@ tests/cases/compiler/main.ts(33,8): error TS1192: Module '"function"' has no def tests/cases/compiler/main.ts(34,8): error TS1192: Module '"function-module"' has no default export. tests/cases/compiler/main.ts(35,8): error TS1192: Module '"class"' has no default export. tests/cases/compiler/main.ts(36,8): error TS1192: Module '"class-module"' has no default export. -tests/cases/compiler/main.ts(39,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. -tests/cases/compiler/main.ts(45,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. -tests/cases/compiler/main.ts(47,21): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(39,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(45,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(47,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(50,1): error TS2693: 'y1' only refers to a type, but is being used as a value here. tests/cases/compiler/main.ts(56,4): error TS2339: Property 'a' does not exist on type '() => any'. tests/cases/compiler/main.ts(58,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. tests/cases/compiler/main.ts(62,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(62,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(62,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(68,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(68,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(68,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(70,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(70,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(70,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(85,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(85,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(85,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(91,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(91,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(91,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(93,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(93,25): error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +tests/cases/compiler/main.ts(93,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(97,15): error TS2498: Module '"interface"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(98,15): error TS2498: Module '"variable"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(99,15): error TS2498: Module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. @@ -108,7 +108,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses // namespace import import * as y1 from "interface"; ~~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import * as y2 from "variable"; import * as y3 from "interface-variable"; import * as y4 from "module"; @@ -116,11 +116,11 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses import * as y6 from "variable-module"; import * as y7 from "function"; ~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import * as y8 from "function-module"; import * as y9 from "class"; ~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import * as y0 from "class-module"; y1.a; @@ -145,7 +145,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import { a as a2 } from "variable"; import { a as a3 } from "interface-variable"; import { a as a4 } from "module"; @@ -155,13 +155,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import { a as a8 } from "function-module"; import { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. import { a as a0 } from "class-module"; a1; @@ -180,7 +180,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. export { a as a2 } from "variable"; export { a as a3 } from "interface-variable"; export { a as a4 } from "module"; @@ -190,13 +190,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. export { a as a8 } from "function-module"; export { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: ECMAScript imports can only reference an 'export =' declaration with the 'esModuleInterop' flag enabled and by using default imports. +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. export { a as a0 } from "class-module"; // export-star diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt new file mode 100644 index 00000000000..96d2f55ed27 --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt @@ -0,0 +1,15 @@ +tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. + + +==== tests/cases/compiler/a.ts (0 errors) ==== + class a { } + export = a; + +==== tests/cases/compiler/main.ts (1 errors) ==== + import * as a from "./a"; + ~~~~~ +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. + a; + + + \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.js b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.js new file mode 100644 index 00000000000..37f127721ce --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/es6ImportEqualsExportModuleCommonJsError.ts] //// + +//// [a.ts] +class a { } +export = a; + +//// [main.ts] +import * as a from "./a"; +a; + + + + +//// [a.js] +"use strict"; +var a = /** @class */ (function () { + function a() { + } + return a; +}()); +module.exports = a; +//// [main.js] +"use strict"; +exports.__esModule = true; +var a = require("./a"); +a; diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.symbols b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.symbols new file mode 100644 index 00000000000..071f2fb5725 --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class a { } +>a : Symbol(a, Decl(a.ts, 0, 0)) + +export = a; +>a : Symbol(a, Decl(a.ts, 0, 0)) + +=== tests/cases/compiler/main.ts === +import * as a from "./a"; +>a : Symbol(a, Decl(main.ts, 0, 6)) + +a; +>a : Symbol(a, Decl(main.ts, 0, 6)) + + + diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.types b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.types new file mode 100644 index 00000000000..652d7d6241b --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class a { } +>a : a + +export = a; +>a : a + +=== tests/cases/compiler/main.ts === +import * as a from "./a"; +>a : typeof a + +a; +>a : typeof a + + + diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt new file mode 100644 index 00000000000..ee3e9cfff17 --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt @@ -0,0 +1,18 @@ +tests/cases/compiler/a.ts(2,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'allowSyntheticDefaultImports' flag and using a default import. + + +==== tests/cases/compiler/a.ts (1 errors) ==== + class a { } + export = a; + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + +==== tests/cases/compiler/main.ts (1 errors) ==== + import * as a from "./a"; + ~~~~~ +!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'allowSyntheticDefaultImports' flag and using a default import. + a; + + + \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.js b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.js new file mode 100644 index 00000000000..603f158946e --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/es6ImportEqualsExportModuleEs2015Error.ts] //// + +//// [a.ts] +class a { } +export = a; + +//// [main.ts] +import * as a from "./a"; +a; + + + + +//// [a.js] +var a = /** @class */ (function () { + function a() { + } + return a; +}()); +//// [main.js] +import * as a from "./a"; +a; diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.symbols b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.symbols new file mode 100644 index 00000000000..071f2fb5725 --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class a { } +>a : Symbol(a, Decl(a.ts, 0, 0)) + +export = a; +>a : Symbol(a, Decl(a.ts, 0, 0)) + +=== tests/cases/compiler/main.ts === +import * as a from "./a"; +>a : Symbol(a, Decl(main.ts, 0, 6)) + +a; +>a : Symbol(a, Decl(main.ts, 0, 6)) + + + diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.types b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.types new file mode 100644 index 00000000000..652d7d6241b --- /dev/null +++ b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +class a { } +>a : a + +export = a; +>a : a + +=== tests/cases/compiler/main.ts === +import * as a from "./a"; +>a : typeof a + +a; +>a : typeof a + + + diff --git a/tests/cases/compiler/es6ImportEqualsExportModuleCommonJsError.ts b/tests/cases/compiler/es6ImportEqualsExportModuleCommonJsError.ts new file mode 100644 index 00000000000..577e606c249 --- /dev/null +++ b/tests/cases/compiler/es6ImportEqualsExportModuleCommonJsError.ts @@ -0,0 +1,11 @@ +// @module: commonjs + +// @filename: a.ts +class a { } +export = a; + +// @filename: main.ts +import * as a from "./a"; +a; + + diff --git a/tests/cases/compiler/es6ImportEqualsExportModuleEs2015Error.ts b/tests/cases/compiler/es6ImportEqualsExportModuleEs2015Error.ts new file mode 100644 index 00000000000..a5505b0e90e --- /dev/null +++ b/tests/cases/compiler/es6ImportEqualsExportModuleEs2015Error.ts @@ -0,0 +1,11 @@ +// @module: es2015 + +// @filename: a.ts +class a { } +export = a; + +// @filename: main.ts +import * as a from "./a"; +a; + + From d4f6b9b0a66e27de05debaf4ef4e2d733fe1ccfb Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Fri, 27 Jul 2018 21:08:22 +0200 Subject: [PATCH 003/322] allow BindingPattern in FunctionRestParameter also add downlevel emit for the destructured rest param Part of #6275 --- src/compiler/checker.ts | 4 --- src/compiler/transformers/es2015.ts | 26 ++++++++++++++++--- .../iterableArrayPattern14.errors.txt | 23 ---------------- .../iterableArrayPattern15.errors.txt | 23 ---------------- .../iterableArrayPattern16.errors.txt | 5 +--- .../iterableArrayPattern17.errors.txt | 5 +--- .../iterableArrayPattern20.errors.txt | 23 ---------------- .../iterableArrayPattern25.errors.txt | 5 +--- .../iterableArrayPattern26.errors.txt | 5 +--- .../iterableArrayPattern27.errors.txt | 8 ------ .../iterableArrayPattern28.errors.txt | 5 +--- .../iterableArrayPattern29.errors.txt | 5 +--- ...estParameterWithBindingPattern1.errors.txt | 7 ----- .../restParameterWithBindingPattern1.js | 8 +++++- ...estParameterWithBindingPattern2.errors.txt | 7 ----- .../restParameterWithBindingPattern2.js | 8 +++++- 16 files changed, 42 insertions(+), 125 deletions(-) delete mode 100644 tests/baselines/reference/iterableArrayPattern14.errors.txt delete mode 100644 tests/baselines/reference/iterableArrayPattern15.errors.txt delete mode 100644 tests/baselines/reference/iterableArrayPattern20.errors.txt delete mode 100644 tests/baselines/reference/iterableArrayPattern27.errors.txt delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern1.errors.txt delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern2.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2b255da7ae3..441de3a4253 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -28570,10 +28570,6 @@ namespace ts { checkGrammarForDisallowedTrailingComma(parameters, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); } - if (isBindingPattern(parameter.name)) { - return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } - if (parameter.questionToken) { return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); } diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index bffdc5809b0..89c87fa82b3 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -1340,8 +1340,8 @@ namespace ts { * part of a constructor declaration with a * synthesized call to `super` */ - function shouldAddRestParameter(node: ParameterDeclaration | undefined, inConstructorWithSynthesizedSuper: boolean) { - return node && node.dotDotDotToken && node.name.kind === SyntaxKind.Identifier && !inConstructorWithSynthesizedSuper; + function shouldAddRestParameter(node: ParameterDeclaration | undefined, inConstructorWithSynthesizedSuper: boolean): node is ParameterDeclaration { + return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); } /** @@ -1360,11 +1360,11 @@ namespace ts { } // `declarationName` is the name of the local declaration for the parameter. - const declarationName = getMutableClone(parameter!.name); + const declarationName = parameter.name.kind === SyntaxKind.Identifier ? getMutableClone(parameter.name) : createTempVariable(/*recordTempVariable*/ undefined); setEmitFlags(declarationName, EmitFlags.NoSourceMap); // `expressionName` is the name of the parameter used in expressions. - const expressionName = getSynthesizedClone(parameter!.name); + const expressionName = parameter.name.kind === SyntaxKind.Identifier ? getSynthesizedClone(parameter.name) : declarationName; const restIndex = node.parameters.length - 1; const temp = createLoopVariable(); @@ -1429,6 +1429,24 @@ namespace ts { setEmitFlags(forStatement, EmitFlags.CustomPrologue); startOnNewLine(forStatement); statements.push(forStatement); + + if (parameter.name.kind !== SyntaxKind.Identifier) { + // do the actual destructuring of the rest parameter if necessary + statements.push( + setEmitFlags( + setTextRange( + createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList( + flattenDestructuringBinding(parameter, visitor, context, FlattenLevel.All, expressionName), + ) + ), + parameter + ), + EmitFlags.CustomPrologue + ) + ); + } } /** diff --git a/tests/baselines/reference/iterableArrayPattern14.errors.txt b/tests/baselines/reference/iterableArrayPattern14.errors.txt deleted file mode 100644 index 664f73e13a0..00000000000 --- a/tests/baselines/reference/iterableArrayPattern14.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(16,17): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts (1 errors) ==== - class Bar { x } - class Foo extends Bar { y } - class FooIterator { - next() { - return { - value: new Foo, - done: false - }; - } - - [Symbol.iterator]() { - return this; - } - } - - function fun(...[a, ...b]) { } - ~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. - fun(new FooIterator); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern15.errors.txt b/tests/baselines/reference/iterableArrayPattern15.errors.txt deleted file mode 100644 index ce7559de94f..00000000000 --- a/tests/baselines/reference/iterableArrayPattern15.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(16,17): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts (1 errors) ==== - class Bar { x } - class Foo extends Bar { y } - class FooIterator { - next() { - return { - value: new Foo, - done: false - }; - } - - [Symbol.iterator]() { - return this; - } - } - - function fun(...[a, b]: Bar[]) { } - ~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. - fun(...new FooIterator); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt index b07d8c976a5..2de26b3a721 100644 --- a/tests/baselines/reference/iterableArrayPattern16.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -1,13 +1,10 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(1,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. Property '0' is missing in type 'FooIterator'. tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,12): error TS2449: Class 'FooIteratorIterator' used before its declaration. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (3 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (2 errors) ==== function fun(...[a, b]: [Bar, Bar][]) { } - ~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. fun(...new FooIteratorIterator); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'. diff --git a/tests/baselines/reference/iterableArrayPattern17.errors.txt b/tests/baselines/reference/iterableArrayPattern17.errors.txt index d22d8580c71..09f8b8695a7 100644 --- a/tests/baselines/reference/iterableArrayPattern17.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern17.errors.txt @@ -1,9 +1,8 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(16,17): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. Property 'x' is missing in type 'FooIterator'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (2 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (1 errors) ==== class Bar { x } class Foo extends Bar { y } class FooIterator { @@ -20,8 +19,6 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(17,5): error } function fun(...[a, b]: Bar[]) { } - ~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. fun(new FooIterator); ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'. diff --git a/tests/baselines/reference/iterableArrayPattern20.errors.txt b/tests/baselines/reference/iterableArrayPattern20.errors.txt deleted file mode 100644 index 23f133238ce..00000000000 --- a/tests/baselines/reference/iterableArrayPattern20.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(16,17): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts (1 errors) ==== - class Bar { x } - class Foo extends Bar { y } - class FooArrayIterator { - next() { - return { - value: [new Foo], - done: false - }; - } - - [Symbol.iterator]() { - return this; - } - } - - function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. - fun(...new FooArrayIterator); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern25.errors.txt b/tests/baselines/reference/iterableArrayPattern25.errors.txt index 19f2dca07f3..0161be07d4b 100644 --- a/tests/baselines/reference/iterableArrayPattern25.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern25.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts(2,1): error TS2554: Expected 2 arguments, but got 1. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (2 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern25.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 2 arguments, but got 1. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern26.errors.txt b/tests/baselines/reference/iterableArrayPattern26.errors.txt index a5eff0afb0d..9fb3e688039 100644 --- a/tests/baselines/reference/iterableArrayPattern26.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern26.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts(2,21): error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. Property '0' is missing in type 'Map'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (2 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'Map' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/iterableArrayPattern27.errors.txt b/tests/baselines/reference/iterableArrayPattern27.errors.txt deleted file mode 100644 index 99914ddc508..00000000000 --- a/tests/baselines/reference/iterableArrayPattern27.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts (1 errors) ==== - function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. - takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 7ca750cd81f..264cb8e7885 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,32): error TS2345: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'ReadonlyArray<[string, number]>'. Types of property 'concat' are incompatible. Type '{ (...items: ConcatArray<[string, number] | [string, boolean]>[]): ([string, number] | [string, boolean])[]; (...items: ([string, number] | [string, boolean] | ConcatArray<[string, number] | [string, boolean]>)[]): ([string, number] | [string, boolean])[]; }' is not assignable to type '{ (...items: ConcatArray<[string, number]>[]): [string, number][]; (...items: ([string, number] | ConcatArray<[string, number]>)[]): [string, number][]; }'. @@ -8,10 +7,8 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,32): error Type 'boolean' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (2 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'ReadonlyArray<[string, number]>'. diff --git a/tests/baselines/reference/iterableArrayPattern29.errors.txt b/tests/baselines/reference/iterableArrayPattern29.errors.txt index 29e5d0d2a3f..a978e357cdf 100644 --- a/tests/baselines/reference/iterableArrayPattern29.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern29.errors.txt @@ -1,12 +1,9 @@ -tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts(2,21): error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. Type 'boolean' is not assignable to type 'number'. -==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (2 errors) ==== +==== tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[string, boolean]' is not assignable to parameter of type '[string, number]'. diff --git a/tests/baselines/reference/restParameterWithBindingPattern1.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern1.errors.txt deleted file mode 100644 index 7194159a220..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/restParameterWithBindingPattern1.ts(1,15): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/compiler/restParameterWithBindingPattern1.ts (1 errors) ==== - function a(...{a, b}) { } - ~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern1.js b/tests/baselines/reference/restParameterWithBindingPattern1.js index 9fb45768afe..eca1a760471 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern1.js +++ b/tests/baselines/reference/restParameterWithBindingPattern1.js @@ -2,4 +2,10 @@ function a(...{a, b}) { } //// [restParameterWithBindingPattern1.js] -function a() { } +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a.a, b = _a.b; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern2.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern2.errors.txt deleted file mode 100644 index e69e1c2ba78..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern2.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/restParameterWithBindingPattern2.ts(1,15): error TS2501: A rest element cannot contain a binding pattern. - - -==== tests/cases/compiler/restParameterWithBindingPattern2.ts (1 errors) ==== - function a(...[a, b]) { } - ~~~~~~ -!!! error TS2501: A rest element cannot contain a binding pattern. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern2.js b/tests/baselines/reference/restParameterWithBindingPattern2.js index 5c97769acbb..348023d7aa4 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern2.js +++ b/tests/baselines/reference/restParameterWithBindingPattern2.js @@ -2,4 +2,10 @@ function a(...[a, b]) { } //// [restParameterWithBindingPattern2.js] -function a() { } +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a[0], b = _a[1]; +} From 421a5f2698fd3efa7ac2cbd898934d8c2e6d95ac Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sat, 28 Jul 2018 08:50:08 +0200 Subject: [PATCH 004/322] add additional test for grammar and type checking --- .../restParameterWithBindingPattern3.errors.txt | 10 ++++++++++ .../reference/restParameterWithBindingPattern3.js | 11 +++++++++++ .../restParameterWithBindingPattern3.symbols | 6 ++++++ .../reference/restParameterWithBindingPattern3.types | 8 ++++++++ .../restParameterWithBindingPattern4.errors.txt | 7 +++++++ .../reference/restParameterWithBindingPattern4.js | 11 +++++++++++ .../restParameterWithBindingPattern4.symbols | 5 +++++ .../reference/restParameterWithBindingPattern4.types | 6 ++++++ .../reference/restParameterWithBindingPattern5.js | 11 +++++++++++ .../restParameterWithBindingPattern5.symbols | 7 +++++++ .../reference/restParameterWithBindingPattern5.types | 7 +++++++ .../restParameterWithBindingPattern6.errors.txt | 7 +++++++ .../reference/restParameterWithBindingPattern6.js | 11 +++++++++++ .../restParameterWithBindingPattern6.symbols | 6 ++++++ .../reference/restParameterWithBindingPattern6.types | 8 ++++++++ .../compiler/restParameterWithBindingPattern3.ts | 1 + .../compiler/restParameterWithBindingPattern4.ts | 1 + .../compiler/restParameterWithBindingPattern5.ts | 1 + .../compiler/restParameterWithBindingPattern6.ts | 1 + 19 files changed, 125 insertions(+) create mode 100644 tests/baselines/reference/restParameterWithBindingPattern3.errors.txt create mode 100644 tests/baselines/reference/restParameterWithBindingPattern3.js create mode 100644 tests/baselines/reference/restParameterWithBindingPattern3.symbols create mode 100644 tests/baselines/reference/restParameterWithBindingPattern3.types create mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.errors.txt create mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.js create mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.symbols create mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.types create mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.js create mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.symbols create mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.types create mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.errors.txt create mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.js create mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.symbols create mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.types create mode 100644 tests/cases/compiler/restParameterWithBindingPattern3.ts create mode 100644 tests/cases/compiler/restParameterWithBindingPattern4.ts create mode 100644 tests/cases/compiler/restParameterWithBindingPattern5.ts create mode 100644 tests/cases/compiler/restParameterWithBindingPattern6.ts diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt new file mode 100644 index 00000000000..8b278ed3783 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt @@ -0,0 +1,10 @@ +tests/cases/compiler/restParameterWithBindingPattern3.ts(1,16): error TS2322: Type '1' is not assignable to type 'string'. +tests/cases/compiler/restParameterWithBindingPattern3.ts(1,23): error TS2322: Type 'true' is not assignable to type 'string'. + + +==== tests/cases/compiler/restParameterWithBindingPattern3.ts (2 errors) ==== + function a(...[a = 1, b = true]: string[]) { } + ~ +!!! error TS2322: Type '1' is not assignable to type 'string'. + ~ +!!! error TS2322: Type 'true' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.js b/tests/baselines/reference/restParameterWithBindingPattern3.js new file mode 100644 index 00000000000..86bda118119 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern3.js @@ -0,0 +1,11 @@ +//// [restParameterWithBindingPattern3.ts] +function a(...[a = 1, b = true]: string[]) { } + +//// [restParameterWithBindingPattern3.js] +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? true : _c; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.symbols b/tests/baselines/reference/restParameterWithBindingPattern3.symbols new file mode 100644 index 00000000000..09ffc4d8adc --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/restParameterWithBindingPattern3.ts === +function a(...[a = 1, b = true]: string[]) { } +>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 0, 0)) +>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 0, 15)) +>b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 0, 21)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.types b/tests/baselines/reference/restParameterWithBindingPattern3.types new file mode 100644 index 00000000000..09b2f9143fe --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern3.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/restParameterWithBindingPattern3.ts === +function a(...[a = 1, b = true]: string[]) { } +>a : (...[a, b]: string[]) => void +>a : string +>1 : 1 +>b : string +>true : true + diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt new file mode 100644 index 00000000000..355ab26c6c5 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/restParameterWithBindingPattern4.ts(1,23): error TS1186: A rest element cannot have an initializer. + + +==== tests/cases/compiler/restParameterWithBindingPattern4.ts (1 errors) ==== + function a(...[...foo = []]: string[]) { } + ~ +!!! error TS1186: A rest element cannot have an initializer. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.js b/tests/baselines/reference/restParameterWithBindingPattern4.js new file mode 100644 index 00000000000..348fa5a02bb --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern4.js @@ -0,0 +1,11 @@ +//// [restParameterWithBindingPattern4.ts] +function a(...[...foo = []]: string[]) { } + +//// [restParameterWithBindingPattern4.js] +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var _b = _a.slice(0), foo = _b === void 0 ? [] : _b; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.symbols b/tests/baselines/reference/restParameterWithBindingPattern4.symbols new file mode 100644 index 00000000000..f281620423e --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern4.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/restParameterWithBindingPattern4.ts === +function a(...[...foo = []]: string[]) { } +>a : Symbol(a, Decl(restParameterWithBindingPattern4.ts, 0, 0)) +>foo : Symbol(foo, Decl(restParameterWithBindingPattern4.ts, 0, 15)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.types b/tests/baselines/reference/restParameterWithBindingPattern4.types new file mode 100644 index 00000000000..f4af66e9be7 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern4.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/restParameterWithBindingPattern4.ts === +function a(...[...foo = []]: string[]) { } +>a : (...[...foo]: string[]) => void +>foo : string[] +>[] : undefined[] + diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.js b/tests/baselines/reference/restParameterWithBindingPattern5.js new file mode 100644 index 00000000000..4bff99068e0 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern5.js @@ -0,0 +1,11 @@ +//// [restParameterWithBindingPattern5.ts] +function a(...{0: a, length, 3: d}: [boolean, string, number]) { } + +//// [restParameterWithBindingPattern5.js] +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a[0], length = _a.length, d = _a[3]; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.symbols b/tests/baselines/reference/restParameterWithBindingPattern5.symbols new file mode 100644 index 00000000000..a59b24f64f4 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern5.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/restParameterWithBindingPattern5.ts === +function a(...{0: a, length, 3: d}: [boolean, string, number]) { } +>a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 0)) +>a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 15)) +>length : Symbol(length, Decl(restParameterWithBindingPattern5.ts, 0, 20)) +>d : Symbol(d, Decl(restParameterWithBindingPattern5.ts, 0, 28)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.types b/tests/baselines/reference/restParameterWithBindingPattern5.types new file mode 100644 index 00000000000..6986660adcd --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern5.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/restParameterWithBindingPattern5.ts === +function a(...{0: a, length, 3: d}: [boolean, string, number]) { } +>a : (__0_0: boolean, __0_1: string, __0_2: number) => void +>a : boolean +>length : 3 +>d : string | number | boolean + diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt new file mode 100644 index 00000000000..6f590b2bb67 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/compiler/restParameterWithBindingPattern6.ts(1,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. + + +==== tests/cases/compiler/restParameterWithBindingPattern6.ts (1 errors) ==== + function a(...[a, , , d]: [boolean, string, number]) { } + ~ +!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.js b/tests/baselines/reference/restParameterWithBindingPattern6.js new file mode 100644 index 00000000000..02101d0fcdb --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern6.js @@ -0,0 +1,11 @@ +//// [restParameterWithBindingPattern6.ts] +function a(...[a, , , d]: [boolean, string, number]) { } + +//// [restParameterWithBindingPattern6.js] +function a() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a[0], d = _a[3]; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.symbols b/tests/baselines/reference/restParameterWithBindingPattern6.symbols new file mode 100644 index 00000000000..2c16d11e33f --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern6.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/restParameterWithBindingPattern6.ts === +function a(...[a, , , d]: [boolean, string, number]) { } +>a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 0)) +>a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 15)) +>d : Symbol(d, Decl(restParameterWithBindingPattern6.ts, 0, 21)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.types b/tests/baselines/reference/restParameterWithBindingPattern6.types new file mode 100644 index 00000000000..f0062077458 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern6.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/restParameterWithBindingPattern6.ts === +function a(...[a, , , d]: [boolean, string, number]) { } +>a : (__0_0: boolean, __0_1: string, __0_2: number) => void +>a : boolean +> : undefined +> : undefined +>d : any + diff --git a/tests/cases/compiler/restParameterWithBindingPattern3.ts b/tests/cases/compiler/restParameterWithBindingPattern3.ts new file mode 100644 index 00000000000..920e00ac2e8 --- /dev/null +++ b/tests/cases/compiler/restParameterWithBindingPattern3.ts @@ -0,0 +1 @@ +function a(...[a = 1, b = true]: string[]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern4.ts b/tests/cases/compiler/restParameterWithBindingPattern4.ts new file mode 100644 index 00000000000..fee0067bd50 --- /dev/null +++ b/tests/cases/compiler/restParameterWithBindingPattern4.ts @@ -0,0 +1 @@ +function a(...[...foo = []]: string[]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern5.ts b/tests/cases/compiler/restParameterWithBindingPattern5.ts new file mode 100644 index 00000000000..7707a99b11e --- /dev/null +++ b/tests/cases/compiler/restParameterWithBindingPattern5.ts @@ -0,0 +1 @@ +function a(...{0: a, length, 3: d}: [boolean, string, number]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern6.ts b/tests/cases/compiler/restParameterWithBindingPattern6.ts new file mode 100644 index 00000000000..ae95ad8c4d9 --- /dev/null +++ b/tests/cases/compiler/restParameterWithBindingPattern6.ts @@ -0,0 +1 @@ +function a(...[a, , , d]: [boolean, string, number]) { } \ No newline at end of file From 3894d0524c918883763a658bd0c11c3b9cc2af36 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Mon, 30 Jul 2018 16:13:22 +0200 Subject: [PATCH 005/322] merge tests --- ...estParameterWithBindingPattern3.errors.txt | 16 ++++++++-- .../restParameterWithBindingPattern3.js | 29 ++++++++++++++++++- .../restParameterWithBindingPattern3.symbols | 15 ++++++++++ .../restParameterWithBindingPattern3.types | 18 ++++++++++++ ...estParameterWithBindingPattern4.errors.txt | 7 ----- .../restParameterWithBindingPattern4.js | 11 ------- .../restParameterWithBindingPattern4.symbols | 5 ---- .../restParameterWithBindingPattern4.types | 6 ---- .../restParameterWithBindingPattern5.js | 11 ------- .../restParameterWithBindingPattern5.symbols | 7 ----- .../restParameterWithBindingPattern5.types | 7 ----- ...estParameterWithBindingPattern6.errors.txt | 7 ----- .../restParameterWithBindingPattern6.js | 11 ------- .../restParameterWithBindingPattern6.symbols | 6 ---- .../restParameterWithBindingPattern6.types | 8 ----- .../restParameterWithBindingPattern3.ts | 8 ++++- .../restParameterWithBindingPattern4.ts | 1 - .../restParameterWithBindingPattern5.ts | 1 - .../restParameterWithBindingPattern6.ts | 1 - 19 files changed, 82 insertions(+), 93 deletions(-) delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.errors.txt delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.js delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.symbols delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern4.types delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.js delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.symbols delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern5.types delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.errors.txt delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.js delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.symbols delete mode 100644 tests/baselines/reference/restParameterWithBindingPattern6.types delete mode 100644 tests/cases/compiler/restParameterWithBindingPattern4.ts delete mode 100644 tests/cases/compiler/restParameterWithBindingPattern5.ts delete mode 100644 tests/cases/compiler/restParameterWithBindingPattern6.ts diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt index 8b278ed3783..ea6bda983d8 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt +++ b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt @@ -1,10 +1,22 @@ tests/cases/compiler/restParameterWithBindingPattern3.ts(1,16): error TS2322: Type '1' is not assignable to type 'string'. tests/cases/compiler/restParameterWithBindingPattern3.ts(1,23): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/compiler/restParameterWithBindingPattern3.ts(3,23): error TS1186: A rest element cannot have an initializer. +tests/cases/compiler/restParameterWithBindingPattern3.ts(7,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. -==== tests/cases/compiler/restParameterWithBindingPattern3.ts (2 errors) ==== +==== tests/cases/compiler/restParameterWithBindingPattern3.ts (4 errors) ==== function a(...[a = 1, b = true]: string[]) { } ~ !!! error TS2322: Type '1' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'true' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type 'true' is not assignable to type 'string'. + + function b(...[...foo = []]: string[]) { } + ~ +!!! error TS1186: A rest element cannot have an initializer. + + function c(...{0: a, length, 3: d}: [boolean, string, number]) { } + + function d(...[a, , , d]: [boolean, string, number]) { } + ~ +!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.js b/tests/baselines/reference/restParameterWithBindingPattern3.js index 86bda118119..da3531633b6 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.js +++ b/tests/baselines/reference/restParameterWithBindingPattern3.js @@ -1,5 +1,11 @@ //// [restParameterWithBindingPattern3.ts] -function a(...[a = 1, b = true]: string[]) { } +function a(...[a = 1, b = true]: string[]) { } + +function b(...[...foo = []]: string[]) { } + +function c(...{0: a, length, 3: d}: [boolean, string, number]) { } + +function d(...[a, , , d]: [boolean, string, number]) { } //// [restParameterWithBindingPattern3.js] function a() { @@ -9,3 +15,24 @@ function a() { } var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? true : _c; } +function b() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var _b = _a.slice(0), foo = _b === void 0 ? [] : _b; +} +function c() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a[0], length = _a.length, d = _a[3]; +} +function d() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var a = _a[0], d = _a[3]; +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.symbols b/tests/baselines/reference/restParameterWithBindingPattern3.symbols index 09ffc4d8adc..2694c7327da 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.symbols +++ b/tests/baselines/reference/restParameterWithBindingPattern3.symbols @@ -4,3 +4,18 @@ function a(...[a = 1, b = true]: string[]) { } >a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 0, 15)) >b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 0, 21)) +function b(...[...foo = []]: string[]) { } +>b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 0, 46)) +>foo : Symbol(foo, Decl(restParameterWithBindingPattern3.ts, 2, 15)) + +function c(...{0: a, length, 3: d}: [boolean, string, number]) { } +>c : Symbol(c, Decl(restParameterWithBindingPattern3.ts, 2, 42)) +>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 4, 15)) +>length : Symbol(length, Decl(restParameterWithBindingPattern3.ts, 4, 20)) +>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 4, 28)) + +function d(...[a, , , d]: [boolean, string, number]) { } +>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 4, 66)) +>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 6, 15)) +>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 6, 21)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.types b/tests/baselines/reference/restParameterWithBindingPattern3.types index 09b2f9143fe..7ab8bdf621a 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.types +++ b/tests/baselines/reference/restParameterWithBindingPattern3.types @@ -6,3 +6,21 @@ function a(...[a = 1, b = true]: string[]) { } >b : string >true : true +function b(...[...foo = []]: string[]) { } +>b : (...[...foo]: string[]) => void +>foo : string[] +>[] : undefined[] + +function c(...{0: a, length, 3: d}: [boolean, string, number]) { } +>c : (__0_0: boolean, __0_1: string, __0_2: number) => void +>a : boolean +>length : 3 +>d : string | number | boolean + +function d(...[a, , , d]: [boolean, string, number]) { } +>d : (__0_0: boolean, __0_1: string, __0_2: number) => void +>a : boolean +> : undefined +> : undefined +>d : any + diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt deleted file mode 100644 index 355ab26c6c5..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern4.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/restParameterWithBindingPattern4.ts(1,23): error TS1186: A rest element cannot have an initializer. - - -==== tests/cases/compiler/restParameterWithBindingPattern4.ts (1 errors) ==== - function a(...[...foo = []]: string[]) { } - ~ -!!! error TS1186: A rest element cannot have an initializer. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.js b/tests/baselines/reference/restParameterWithBindingPattern4.js deleted file mode 100644 index 348fa5a02bb..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern4.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [restParameterWithBindingPattern4.ts] -function a(...[...foo = []]: string[]) { } - -//// [restParameterWithBindingPattern4.js] -function a() { - var _a = []; - for (var _i = 0; _i < arguments.length; _i++) { - _a[_i] = arguments[_i]; - } - var _b = _a.slice(0), foo = _b === void 0 ? [] : _b; -} diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.symbols b/tests/baselines/reference/restParameterWithBindingPattern4.symbols deleted file mode 100644 index f281620423e..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern4.symbols +++ /dev/null @@ -1,5 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern4.ts === -function a(...[...foo = []]: string[]) { } ->a : Symbol(a, Decl(restParameterWithBindingPattern4.ts, 0, 0)) ->foo : Symbol(foo, Decl(restParameterWithBindingPattern4.ts, 0, 15)) - diff --git a/tests/baselines/reference/restParameterWithBindingPattern4.types b/tests/baselines/reference/restParameterWithBindingPattern4.types deleted file mode 100644 index f4af66e9be7..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern4.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern4.ts === -function a(...[...foo = []]: string[]) { } ->a : (...[...foo]: string[]) => void ->foo : string[] ->[] : undefined[] - diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.js b/tests/baselines/reference/restParameterWithBindingPattern5.js deleted file mode 100644 index 4bff99068e0..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern5.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [restParameterWithBindingPattern5.ts] -function a(...{0: a, length, 3: d}: [boolean, string, number]) { } - -//// [restParameterWithBindingPattern5.js] -function a() { - var _a = []; - for (var _i = 0; _i < arguments.length; _i++) { - _a[_i] = arguments[_i]; - } - var a = _a[0], length = _a.length, d = _a[3]; -} diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.symbols b/tests/baselines/reference/restParameterWithBindingPattern5.symbols deleted file mode 100644 index a59b24f64f4..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern5.symbols +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern5.ts === -function a(...{0: a, length, 3: d}: [boolean, string, number]) { } ->a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 0)) ->a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 15)) ->length : Symbol(length, Decl(restParameterWithBindingPattern5.ts, 0, 20)) ->d : Symbol(d, Decl(restParameterWithBindingPattern5.ts, 0, 28)) - diff --git a/tests/baselines/reference/restParameterWithBindingPattern5.types b/tests/baselines/reference/restParameterWithBindingPattern5.types deleted file mode 100644 index 6986660adcd..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern5.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern5.ts === -function a(...{0: a, length, 3: d}: [boolean, string, number]) { } ->a : (__0_0: boolean, __0_1: string, __0_2: number) => void ->a : boolean ->length : 3 ->d : string | number | boolean - diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt deleted file mode 100644 index 6f590b2bb67..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern6.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/restParameterWithBindingPattern6.ts(1,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. - - -==== tests/cases/compiler/restParameterWithBindingPattern6.ts (1 errors) ==== - function a(...[a, , , d]: [boolean, string, number]) { } - ~ -!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.js b/tests/baselines/reference/restParameterWithBindingPattern6.js deleted file mode 100644 index 02101d0fcdb..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern6.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [restParameterWithBindingPattern6.ts] -function a(...[a, , , d]: [boolean, string, number]) { } - -//// [restParameterWithBindingPattern6.js] -function a() { - var _a = []; - for (var _i = 0; _i < arguments.length; _i++) { - _a[_i] = arguments[_i]; - } - var a = _a[0], d = _a[3]; -} diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.symbols b/tests/baselines/reference/restParameterWithBindingPattern6.symbols deleted file mode 100644 index 2c16d11e33f..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern6.symbols +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern6.ts === -function a(...[a, , , d]: [boolean, string, number]) { } ->a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 0)) ->a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 15)) ->d : Symbol(d, Decl(restParameterWithBindingPattern6.ts, 0, 21)) - diff --git a/tests/baselines/reference/restParameterWithBindingPattern6.types b/tests/baselines/reference/restParameterWithBindingPattern6.types deleted file mode 100644 index f0062077458..00000000000 --- a/tests/baselines/reference/restParameterWithBindingPattern6.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/compiler/restParameterWithBindingPattern6.ts === -function a(...[a, , , d]: [boolean, string, number]) { } ->a : (__0_0: boolean, __0_1: string, __0_2: number) => void ->a : boolean -> : undefined -> : undefined ->d : any - diff --git a/tests/cases/compiler/restParameterWithBindingPattern3.ts b/tests/cases/compiler/restParameterWithBindingPattern3.ts index 920e00ac2e8..93d0daae538 100644 --- a/tests/cases/compiler/restParameterWithBindingPattern3.ts +++ b/tests/cases/compiler/restParameterWithBindingPattern3.ts @@ -1 +1,7 @@ -function a(...[a = 1, b = true]: string[]) { } \ No newline at end of file +function a(...[a = 1, b = true]: string[]) { } + +function b(...[...foo = []]: string[]) { } + +function c(...{0: a, length, 3: d}: [boolean, string, number]) { } + +function d(...[a, , , d]: [boolean, string, number]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern4.ts b/tests/cases/compiler/restParameterWithBindingPattern4.ts deleted file mode 100644 index fee0067bd50..00000000000 --- a/tests/cases/compiler/restParameterWithBindingPattern4.ts +++ /dev/null @@ -1 +0,0 @@ -function a(...[...foo = []]: string[]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern5.ts b/tests/cases/compiler/restParameterWithBindingPattern5.ts deleted file mode 100644 index 7707a99b11e..00000000000 --- a/tests/cases/compiler/restParameterWithBindingPattern5.ts +++ /dev/null @@ -1 +0,0 @@ -function a(...{0: a, length, 3: d}: [boolean, string, number]) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern6.ts b/tests/cases/compiler/restParameterWithBindingPattern6.ts deleted file mode 100644 index ae95ad8c4d9..00000000000 --- a/tests/cases/compiler/restParameterWithBindingPattern6.ts +++ /dev/null @@ -1 +0,0 @@ -function a(...[a, , , d]: [boolean, string, number]) { } \ No newline at end of file From 5b122dbad6d72e6df49e2e0dc5f07a4f601ba699 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Mon, 30 Jul 2018 16:22:25 +0200 Subject: [PATCH 006/322] test sourceMap --- .../restParameterWithBindingPattern2.js | 1 + .../restParameterWithBindingPattern2.js.map | 2 + ...ParameterWithBindingPattern2.sourcemap.txt | 90 +++++++++++++++++++ .../restParameterWithBindingPattern2.ts | 2 + 4 files changed, 95 insertions(+) create mode 100644 tests/baselines/reference/restParameterWithBindingPattern2.js.map create mode 100644 tests/baselines/reference/restParameterWithBindingPattern2.sourcemap.txt diff --git a/tests/baselines/reference/restParameterWithBindingPattern2.js b/tests/baselines/reference/restParameterWithBindingPattern2.js index 348023d7aa4..acef0954194 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern2.js +++ b/tests/baselines/reference/restParameterWithBindingPattern2.js @@ -9,3 +9,4 @@ function a() { } var a = _a[0], b = _a[1]; } +//# sourceMappingURL=restParameterWithBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern2.js.map b/tests/baselines/reference/restParameterWithBindingPattern2.js.map new file mode 100644 index 00000000000..1e25b0f14be --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern2.js.map @@ -0,0 +1,2 @@ +//// [restParameterWithBindingPattern2.js.map] +{"version":3,"file":"restParameterWithBindingPattern2.js","sourceRoot":"","sources":["restParameterWithBindingPattern2.ts"],"names":[],"mappings":"AAAA,SAAS,CAAC;IAAC,YAAS;SAAT,UAAS,EAAT,qBAAS,EAAT,IAAS;QAAT,uBAAS;;IAAT,IAAI,SAAC,EAAE,SAAC,CAAC;AAAI,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern2.sourcemap.txt b/tests/baselines/reference/restParameterWithBindingPattern2.sourcemap.txt new file mode 100644 index 00000000000..7cd85ba9deb --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern2.sourcemap.txt @@ -0,0 +1,90 @@ +=================================================================== +JsFile: restParameterWithBindingPattern2.js +mapUrl: restParameterWithBindingPattern2.js.map +sourceRoot: +sources: restParameterWithBindingPattern2.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/restParameterWithBindingPattern2.js +sourceFile:restParameterWithBindingPattern2.ts +------------------------------------------------------------------- +>>>function a() { +1 > +2 >^^^^^^^^^ +3 > ^ +4 > ^^^^^^^-> +1 > +2 >function +3 > a +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +--- +>>> var _a = []; +1->^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->( +2 > ...[a, b] +1->Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 17) Source(1, 21) + SourceIndex(0) +--- +>>> for (var _i = 0; _i < arguments.length; _i++) { +1->^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^ +1-> +2 > ...[a, b] +3 > +4 > ...[a, b] +5 > +6 > ...[a, b] +1->Emitted(3, 10) Source(1, 12) + SourceIndex(0) +2 >Emitted(3, 20) Source(1, 21) + SourceIndex(0) +3 >Emitted(3, 22) Source(1, 12) + SourceIndex(0) +4 >Emitted(3, 43) Source(1, 21) + SourceIndex(0) +5 >Emitted(3, 45) Source(1, 12) + SourceIndex(0) +6 >Emitted(3, 49) Source(1, 21) + SourceIndex(0) +--- +>>> _a[_i] = arguments[_i]; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...[a, b] +1 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) +2 >Emitted(4, 32) Source(1, 21) + SourceIndex(0) +--- +>>> } +>>> var a = _a[0], b = _a[1]; +1 >^^^^ +2 > ^^^^ +3 > ^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^ +6 > ^ +1 > +2 > ...[ +3 > a +4 > , +5 > b +6 > ] +1 >Emitted(6, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(6, 9) Source(1, 16) + SourceIndex(0) +3 >Emitted(6, 18) Source(1, 17) + SourceIndex(0) +4 >Emitted(6, 20) Source(1, 19) + SourceIndex(0) +5 >Emitted(6, 29) Source(1, 20) + SourceIndex(0) +6 >Emitted(6, 30) Source(1, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { +2 >} +1 >Emitted(7, 1) Source(1, 25) + SourceIndex(0) +2 >Emitted(7, 2) Source(1, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=restParameterWithBindingPattern2.js.map \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern2.ts b/tests/cases/compiler/restParameterWithBindingPattern2.ts index 85076703b79..d7057885040 100644 --- a/tests/cases/compiler/restParameterWithBindingPattern2.ts +++ b/tests/cases/compiler/restParameterWithBindingPattern2.ts @@ -1 +1,3 @@ +// @sourcemap: true + function a(...[a, b]) { } \ No newline at end of file From 63c80ddaf5e046befdff3e6c6e19564ff193ea99 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Wed, 1 Aug 2018 11:12:47 +0200 Subject: [PATCH 007/322] additional test --- .../restParameterWithBindingPattern1.js | 1 + .../restParameterWithBindingPattern1.js.map | 2 + ...ParameterWithBindingPattern1.sourcemap.txt | 90 +++++++++++++++++++ ...estParameterWithBindingPattern3.errors.txt | 15 +++- .../restParameterWithBindingPattern3.js | 20 ++++- .../restParameterWithBindingPattern3.symbols | 6 ++ .../restParameterWithBindingPattern3.types | 9 ++ .../restParameterWithBindingPattern1.ts | 2 + .../restParameterWithBindingPattern3.ts | 4 +- 9 files changed, 145 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/restParameterWithBindingPattern1.js.map create mode 100644 tests/baselines/reference/restParameterWithBindingPattern1.sourcemap.txt diff --git a/tests/baselines/reference/restParameterWithBindingPattern1.js b/tests/baselines/reference/restParameterWithBindingPattern1.js index eca1a760471..d872d232450 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern1.js +++ b/tests/baselines/reference/restParameterWithBindingPattern1.js @@ -9,3 +9,4 @@ function a() { } var a = _a.a, b = _a.b; } +//# sourceMappingURL=restParameterWithBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern1.js.map b/tests/baselines/reference/restParameterWithBindingPattern1.js.map new file mode 100644 index 00000000000..94c277257b9 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern1.js.map @@ -0,0 +1,2 @@ +//// [restParameterWithBindingPattern1.js.map] +{"version":3,"file":"restParameterWithBindingPattern1.js","sourceRoot":"","sources":["restParameterWithBindingPattern1.ts"],"names":[],"mappings":"AAAA,SAAS,CAAC;IAAC,YAAS;SAAT,UAAS,EAAT,qBAAS,EAAT,IAAS;QAAT,uBAAS;;IAAT,IAAI,QAAC,EAAE,QAAC,CAAC;AAAI,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern1.sourcemap.txt b/tests/baselines/reference/restParameterWithBindingPattern1.sourcemap.txt new file mode 100644 index 00000000000..a5aa2351bc0 --- /dev/null +++ b/tests/baselines/reference/restParameterWithBindingPattern1.sourcemap.txt @@ -0,0 +1,90 @@ +=================================================================== +JsFile: restParameterWithBindingPattern1.js +mapUrl: restParameterWithBindingPattern1.js.map +sourceRoot: +sources: restParameterWithBindingPattern1.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/restParameterWithBindingPattern1.js +sourceFile:restParameterWithBindingPattern1.ts +------------------------------------------------------------------- +>>>function a() { +1 > +2 >^^^^^^^^^ +3 > ^ +4 > ^^^^^^^-> +1 > +2 >function +3 > a +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +--- +>>> var _a = []; +1->^^^^ +2 > ^^^^^^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->( +2 > ...{a, b} +1->Emitted(2, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(2, 17) Source(1, 21) + SourceIndex(0) +--- +>>> for (var _i = 0; _i < arguments.length; _i++) { +1->^^^^^^^^^ +2 > ^^^^^^^^^^ +3 > ^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^ +1-> +2 > ...{a, b} +3 > +4 > ...{a, b} +5 > +6 > ...{a, b} +1->Emitted(3, 10) Source(1, 12) + SourceIndex(0) +2 >Emitted(3, 20) Source(1, 21) + SourceIndex(0) +3 >Emitted(3, 22) Source(1, 12) + SourceIndex(0) +4 >Emitted(3, 43) Source(1, 21) + SourceIndex(0) +5 >Emitted(3, 45) Source(1, 12) + SourceIndex(0) +6 >Emitted(3, 49) Source(1, 21) + SourceIndex(0) +--- +>>> _a[_i] = arguments[_i]; +1 >^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^ +1 > +2 > ...{a, b} +1 >Emitted(4, 9) Source(1, 12) + SourceIndex(0) +2 >Emitted(4, 32) Source(1, 21) + SourceIndex(0) +--- +>>> } +>>> var a = _a.a, b = _a.b; +1 >^^^^ +2 > ^^^^ +3 > ^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^ +6 > ^ +1 > +2 > ...{ +3 > a +4 > , +5 > b +6 > } +1 >Emitted(6, 5) Source(1, 12) + SourceIndex(0) +2 >Emitted(6, 9) Source(1, 16) + SourceIndex(0) +3 >Emitted(6, 17) Source(1, 17) + SourceIndex(0) +4 >Emitted(6, 19) Source(1, 19) + SourceIndex(0) +5 >Emitted(6, 27) Source(1, 20) + SourceIndex(0) +6 >Emitted(6, 28) Source(1, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >) { +2 >} +1 >Emitted(7, 1) Source(1, 25) + SourceIndex(0) +2 >Emitted(7, 2) Source(1, 26) + SourceIndex(0) +--- +>>>//# sourceMappingURL=restParameterWithBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt index ea6bda983d8..2ad62269f50 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt +++ b/tests/baselines/reference/restParameterWithBindingPattern3.errors.txt @@ -2,9 +2,12 @@ tests/cases/compiler/restParameterWithBindingPattern3.ts(1,16): error TS2322: Ty tests/cases/compiler/restParameterWithBindingPattern3.ts(1,23): error TS2322: Type 'true' is not assignable to type 'string'. tests/cases/compiler/restParameterWithBindingPattern3.ts(3,23): error TS1186: A rest element cannot have an initializer. tests/cases/compiler/restParameterWithBindingPattern3.ts(7,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. +tests/cases/compiler/restParameterWithBindingPattern3.ts(9,19): error TS2322: Type '1' is not assignable to type 'boolean'. +tests/cases/compiler/restParameterWithBindingPattern3.ts(9,29): error TS2322: Type 'true' is not assignable to type 'string'. +tests/cases/compiler/restParameterWithBindingPattern3.ts(9,48): error TS2566: A rest element cannot have a property name. -==== tests/cases/compiler/restParameterWithBindingPattern3.ts (4 errors) ==== +==== tests/cases/compiler/restParameterWithBindingPattern3.ts (7 errors) ==== function a(...[a = 1, b = true]: string[]) { } ~ !!! error TS2322: Type '1' is not assignable to type 'string'. @@ -19,4 +22,12 @@ tests/cases/compiler/restParameterWithBindingPattern3.ts(7,23): error TS2493: Tu function d(...[a, , , d]: [boolean, string, number]) { } ~ -!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. \ No newline at end of file +!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'. + + function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { } + ~ +!!! error TS2322: Type '1' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type 'true' is not assignable to type 'string'. + ~~~~ +!!! error TS2566: A rest element cannot have a property name. \ No newline at end of file diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.js b/tests/baselines/reference/restParameterWithBindingPattern3.js index da3531633b6..00342e7f741 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.js +++ b/tests/baselines/reference/restParameterWithBindingPattern3.js @@ -5,9 +5,20 @@ function b(...[...foo = []]: string[]) { } function c(...{0: a, length, 3: d}: [boolean, string, number]) { } -function d(...[a, , , d]: [boolean, string, number]) { } +function d(...[a, , , d]: [boolean, string, number]) { } + +function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { } //// [restParameterWithBindingPattern3.js] +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; function a() { var _a = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -36,3 +47,10 @@ function d() { } var a = _a[0], d = _a[3]; } +function e() { + var _a = []; + for (var _i = 0; _i < arguments.length; _i++) { + _a[_i] = arguments[_i]; + } + var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? true : _c, rest = __rest(_a, [0, 1]); +} diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.symbols b/tests/baselines/reference/restParameterWithBindingPattern3.symbols index 2694c7327da..eecaba6d339 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.symbols +++ b/tests/baselines/reference/restParameterWithBindingPattern3.symbols @@ -19,3 +19,9 @@ function d(...[a, , , d]: [boolean, string, number]) { } >a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 6, 15)) >d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 6, 21)) +function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { } +>e : Symbol(e, Decl(restParameterWithBindingPattern3.ts, 6, 56)) +>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 8, 15)) +>b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 8, 24)) +>rest : Symbol(rest, Decl(restParameterWithBindingPattern3.ts, 8, 37)) + diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.types b/tests/baselines/reference/restParameterWithBindingPattern3.types index 7ab8bdf621a..95a058dfe5c 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.types +++ b/tests/baselines/reference/restParameterWithBindingPattern3.types @@ -24,3 +24,12 @@ function d(...[a, , , d]: [boolean, string, number]) { } > : undefined >d : any +function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { } +>e : (__0_0: boolean, __0_1: string, __0_2: number) => void +>a : boolean +>1 : 1 +>b : string +>true : true +>rest : any +>rest : { [n: number]: string | number | boolean; 2: number; length: 3; toString(): string; toLocaleString(): string; pop(): string | number | boolean; push(...items: (string | number | boolean)[]): number; concat(...items: ConcatArray[]): (string | number | boolean)[]; concat(...items: (string | number | boolean | ConcatArray)[]): (string | number | boolean)[]; join(separator?: string): string; reverse(): (string | number | boolean)[]; shift(): string | number | boolean; slice(start?: number, end?: number): (string | number | boolean)[]; sort(compareFn?: (a: string | number | boolean, b: string | number | boolean) => number): [boolean, string, number]; splice(start: number, deleteCount?: number): (string | number | boolean)[]; splice(start: number, deleteCount: number, ...items: (string | number | boolean)[]): (string | number | boolean)[]; unshift(...items: (string | number | boolean)[]): number; indexOf(searchElement: string | number | boolean, fromIndex?: number): number; lastIndexOf(searchElement: string | number | boolean, fromIndex?: number): number; every(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => void, thisArg?: any): void; map(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => any, thisArg?: any): (string | number | boolean)[]; reduce(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean): string | number | boolean; reduce(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue: string | number | boolean): string | number | boolean; reduce(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean): string | number | boolean; reduceRight(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue: string | number | boolean): string | number | boolean; reduceRight(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; } + diff --git a/tests/cases/compiler/restParameterWithBindingPattern1.ts b/tests/cases/compiler/restParameterWithBindingPattern1.ts index 1004b047844..bd6a3b9bbda 100644 --- a/tests/cases/compiler/restParameterWithBindingPattern1.ts +++ b/tests/cases/compiler/restParameterWithBindingPattern1.ts @@ -1 +1,3 @@ +// @sourcemap: true + function a(...{a, b}) { } \ No newline at end of file diff --git a/tests/cases/compiler/restParameterWithBindingPattern3.ts b/tests/cases/compiler/restParameterWithBindingPattern3.ts index 93d0daae538..f0792354c40 100644 --- a/tests/cases/compiler/restParameterWithBindingPattern3.ts +++ b/tests/cases/compiler/restParameterWithBindingPattern3.ts @@ -4,4 +4,6 @@ function b(...[...foo = []]: string[]) { } function c(...{0: a, length, 3: d}: [boolean, string, number]) { } -function d(...[a, , , d]: [boolean, string, number]) { } \ No newline at end of file +function d(...[a, , , d]: [boolean, string, number]) { } + +function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) { } \ No newline at end of file From 77494d629468533cbb237ece5f18a6d7ad306b2f Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 7 Aug 2018 15:35:43 -0700 Subject: [PATCH 008/322] getScriptInfoOrConfig: Canonicalize tsconfig path before lookup --- src/server/editorServices.ts | 2 +- .../unittests/tsserverProjectSystem.ts | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 56026bb70d4..895ba0cbc39 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1804,7 +1804,7 @@ namespace ts.server { const path = toNormalizedPath(uncheckedFileName); const info = this.getScriptInfoForNormalizedPath(path); if (info) return info; - const configProject = this.configuredProjects.get(uncheckedFileName); + const configProject = this.configuredProjects.get(this.toCanonicalFileName(uncheckedFileName)); return configProject && configProject.getCompilerOptions().configFile; } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index c89d29ffc5b..7e41cf44201 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -9717,6 +9717,43 @@ export function Test2() { }); }); + describe("tsserverProjectSystem refactors", () => { + it("handles canonicalization of tsconfig path", () => { + const aTs: File = { path: "/Foo/a.ts", content: "const x = 0;" }; + const tsconfig: File = { path: "/Foo/tsconfig.json", content: '{ "files": ["./a.ts"] }' }; + const session = createSession(createServerHost([aTs, tsconfig])); + openFilesForSession([aTs], session); + + const result = executeSessionRequest(session, protocol.CommandTypes.GetEditsForRefactor, { + file: aTs.path, + startLine: 1, + startOffset: 1, + endLine: 2, + endOffset: aTs.content.length, + refactor: "Move to a new file", + action: "Move to a new file", + }); + assert.deepEqual(result, { + edits: [ + { + fileName: aTs.path, + textChanges: [{ start: { line: 1, offset: 1 }, end: { line: 1, offset: aTs.content.length + 1 }, newText: "" }], + }, + { + fileName: tsconfig.path, + textChanges: [{ start: { line: 1, offset: 21 }, end: { line: 1, offset: 21 }, newText: ', "./x.ts"' }], + }, + { + fileName: "/Foo/x.ts", + textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: "const x = 0;" }], + }, + ], + renameFilename: undefined, + renameLocation: undefined, + }); + }); + }); + function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { return { ...protocolFileSpanFromSubstring(file, text, options), From ac460e30e74f40ffc84d1868d975be2297cc4832 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 10 Aug 2018 11:50:39 -0700 Subject: [PATCH 009/322] code review --- src/server/editorServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 895ba0cbc39..9a74ff3e53f 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1804,7 +1804,7 @@ namespace ts.server { const path = toNormalizedPath(uncheckedFileName); const info = this.getScriptInfoForNormalizedPath(path); if (info) return info; - const configProject = this.configuredProjects.get(this.toCanonicalFileName(uncheckedFileName)); + const configProject = this.configuredProjects.get(this.toCanonicalFileName(path)); return configProject && configProject.getCompilerOptions().configFile; } From 5ab8bd85aeb280d47c1641c06c30511744b8069b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 13 Sep 2018 17:49:09 -0700 Subject: [PATCH 010/322] Try to find object/intersection types with the most overlap when failing assignability against unions. --- src/compiler/checker.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6f541461b09..9e74fb8521c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11472,7 +11472,8 @@ namespace ts { findMatchingDiscriminantType(source, target) || findMatchingTypeReferenceOrTypeAliasReference(source, target) || findBestTypeForObjectLiteral(source, target) || - findBestTypeForInvokable(source, target); + findBestTypeForInvokable(source, target) || + findMostOverlappyType(source, target); isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], /*reportErrors*/ true); } @@ -11512,6 +11513,32 @@ namespace ts { } } + function findMostOverlappyType(source: Type, unionTarget: UnionOrIntersectionType) { + if (!(source.flags & (TypeFlags.Object | TypeFlags.Intersection))) { + return undefined; + } + const sourceProperties = getPropertiesOfType(source); + let bestType; + let count = -1; + for (const target of unionTarget.types) { + if (!(target.flags & (TypeFlags.Object | TypeFlags.Intersection))) { + continue; + } + + let currentCount = 0; + for (const prop of sourceProperties) { + if (getPropertyOfType(target, prop.escapedName)) { + currentCount++; + } + } + if (currentCount >= count) { + count = currentCount; + bestType = target; + } + } + return bestType; + } + // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly function findMatchingDiscriminantType(source: Type, target: UnionOrIntersectionType) { let match: Type | undefined; From 76e721f3898bb03560b0466b765e087ea91f449e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 13 Sep 2018 17:53:53 -0700 Subject: [PATCH 011/322] Added tests. --- .../errorsOnUnionsOfOverlappingObjects01.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts diff --git a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts new file mode 100644 index 00000000000..aec1821c162 --- /dev/null +++ b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts @@ -0,0 +1,29 @@ +interface Foo { + a: string; + b: number; +}; + +interface Bar { + b: string; +} + +interface Other { + totallyUnrelatedProperty: number; +} + +export let x = { a: '', b: '' }; + +declare function f(x: Foo | Other): any; + +f(x); +f({ a: '', b: '' }) + +declare function g(x: Bar | Other): any; + +g(x); +g({ a: '', b: '' }) + +declare function h(x: Foo | Bar | Other): any; + +h(x); +h({ a: '', b: '' }) From 91af958e109583db9529cfcde2aa95cd1a7c64a7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 13 Sep 2018 17:54:06 -0700 Subject: [PATCH 012/322] Accepted baselines. --- ...lTypeWithUnionTypeObjectLiteral.errors.txt | 24 +++--- ...sOnUnionsOfOverlappingObjects01.errors.txt | 56 +++++++++++++ .../errorsOnUnionsOfOverlappingObjects01.js | 43 ++++++++++ ...rorsOnUnionsOfOverlappingObjects01.symbols | 77 +++++++++++++++++ ...errorsOnUnionsOfOverlappingObjects01.types | 82 +++++++++++++++++++ .../excessPropertyCheckWithUnions.errors.txt | 8 +- .../intersectionAndUnionTypes.errors.txt | 24 +++--- ...eWithRecursiveSubtypeReduction2.errors.txt | 14 +++- 8 files changed, 298 insertions(+), 30 deletions(-) create mode 100644 tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt create mode 100644 tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js create mode 100644 tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols create mode 100644 tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt index fb44cb57da7..733e18307fd 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.errors.txt @@ -9,13 +9,15 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(21,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. - Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; }'. Types of property 'prop' are incompatible. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(25,5): error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. - Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. - Property 'anotherP1' is missing in type '{ prop: string | number; anotherP: string; }'. + Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; }'. + Types of property 'prop' are incompatible. + Type 'string | number' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts(29,5): error TS2322: Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. Type '{ prop: string | number; anotherP: string; anotherP1: number; }' is not assignable to type '{ prop: number; anotherP1: number; }'. Types of property 'prop' are incompatible. @@ -63,18 +65,20 @@ tests/cases/conformance/types/union/contextualTypeWithUnionTypeObjectLiteral.ts( var objStrOrNum6: { prop: string; anotherP: string; } | { prop: number } = { ~~~~~~~~~~~~ !!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; }'. -!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; }'. !!! error TS2322: Types of property 'prop' are incompatible. -!!! error TS2322: Type 'string | number' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. prop: strOrNumber, anotherP: str }; var objStrOrNum7: { prop: string; anotherP: string; } | { prop: number; anotherP1: number } = { ~~~~~~~~~~~~ !!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; } | { prop: number; anotherP1: number; }'. -!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: number; anotherP1: number; }'. -!!! error TS2322: Property 'anotherP1' is missing in type '{ prop: string | number; anotherP: string; }'. +!!! error TS2322: Type '{ prop: string | number; anotherP: string; }' is not assignable to type '{ prop: string; anotherP: string; }'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type 'number' is not assignable to type 'string'. prop: strOrNumber, anotherP: str }; diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt new file mode 100644 index 00000000000..3944c430f33 --- /dev/null +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt @@ -0,0 +1,56 @@ +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(18,3): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'. + Type '{ a: string; b: string; }' is not assignable to type 'Foo'. + Types of property 'b' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(19,3): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'. + Type '{ a: string; b: string; }' is not assignable to type 'Foo'. + Types of property 'b' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. + Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. + + +==== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts (3 errors) ==== + interface Foo { + a: string; + b: number; + }; + + interface Bar { + b: string; + } + + interface Other { + totallyUnrelatedProperty: number; + } + + export let x = { a: '', b: '' }; + + declare function f(x: Foo | Other): any; + + f(x); + ~ +!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'. +!!! error TS2345: Type '{ a: string; b: string; }' is not assignable to type 'Foo'. +!!! error TS2345: Types of property 'b' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + f({ a: '', b: '' }) + ~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'. +!!! error TS2345: Type '{ a: string; b: string; }' is not assignable to type 'Foo'. +!!! error TS2345: Types of property 'b' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. + + declare function g(x: Bar | Other): any; + + g(x); + g({ a: '', b: '' }) + ~~~~~ +!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. +!!! error TS2345: Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. + + declare function h(x: Foo | Bar | Other): any; + + h(x); + h({ a: '', b: '' }) + \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js new file mode 100644 index 00000000000..36824508b12 --- /dev/null +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js @@ -0,0 +1,43 @@ +//// [errorsOnUnionsOfOverlappingObjects01.ts] +interface Foo { + a: string; + b: number; +}; + +interface Bar { + b: string; +} + +interface Other { + totallyUnrelatedProperty: number; +} + +export let x = { a: '', b: '' }; + +declare function f(x: Foo | Other): any; + +f(x); +f({ a: '', b: '' }) + +declare function g(x: Bar | Other): any; + +g(x); +g({ a: '', b: '' }) + +declare function h(x: Foo | Bar | Other): any; + +h(x); +h({ a: '', b: '' }) + + +//// [errorsOnUnionsOfOverlappingObjects01.js] +"use strict"; +exports.__esModule = true; +; +exports.x = { a: '', b: '' }; +f(exports.x); +f({ a: '', b: '' }); +g(exports.x); +g({ a: '', b: '' }); +h(exports.x); +h({ a: '', b: '' }); diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols new file mode 100644 index 00000000000..0ce5d6fd2d4 --- /dev/null +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols @@ -0,0 +1,77 @@ +=== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts === +interface Foo { +>Foo : Symbol(Foo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 0, 0)) + + a: string; +>a : Symbol(Foo.a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 0, 15)) + + b: number; +>b : Symbol(Foo.b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 1, 14)) + +}; + +interface Bar { +>Bar : Symbol(Bar, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 3, 2)) + + b: string; +>b : Symbol(Bar.b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 5, 15)) +} + +interface Other { +>Other : Symbol(Other, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 7, 1)) + + totallyUnrelatedProperty: number; +>totallyUnrelatedProperty : Symbol(Other.totallyUnrelatedProperty, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 9, 17)) +} + +export let x = { a: '', b: '' }; +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 10)) +>a : Symbol(a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 16)) +>b : Symbol(b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 23)) + +declare function f(x: Foo | Other): any; +>f : Symbol(f, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 32)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 15, 19)) +>Foo : Symbol(Foo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 0, 0)) +>Other : Symbol(Other, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 7, 1)) + +f(x); +>f : Symbol(f, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 32)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 10)) + +f({ a: '', b: '' }) +>f : Symbol(f, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 32)) +>a : Symbol(a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 18, 3)) +>b : Symbol(b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 18, 10)) + +declare function g(x: Bar | Other): any; +>g : Symbol(g, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 18, 19)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 20, 19)) +>Bar : Symbol(Bar, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 3, 2)) +>Other : Symbol(Other, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 7, 1)) + +g(x); +>g : Symbol(g, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 18, 19)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 10)) + +g({ a: '', b: '' }) +>g : Symbol(g, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 18, 19)) +>a : Symbol(a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 23, 3)) +>b : Symbol(b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 23, 10)) + +declare function h(x: Foo | Bar | Other): any; +>h : Symbol(h, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 23, 19)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 25, 19)) +>Foo : Symbol(Foo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 0, 0)) +>Bar : Symbol(Bar, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 3, 2)) +>Other : Symbol(Other, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 7, 1)) + +h(x); +>h : Symbol(h, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 23, 19)) +>x : Symbol(x, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 13, 10)) + +h({ a: '', b: '' }) +>h : Symbol(h, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 23, 19)) +>a : Symbol(a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 3)) +>b : Symbol(b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 10)) + diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types new file mode 100644 index 00000000000..a860897d1fa --- /dev/null +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types @@ -0,0 +1,82 @@ +=== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts === +interface Foo { + a: string; +>a : string + + b: number; +>b : number + +}; + +interface Bar { + b: string; +>b : string +} + +interface Other { + totallyUnrelatedProperty: number; +>totallyUnrelatedProperty : number +} + +export let x = { a: '', b: '' }; +>x : { a: string; b: string; } +>{ a: '', b: '' } : { a: string; b: string; } +>a : string +>'' : "" +>b : string +>'' : "" + +declare function f(x: Foo | Other): any; +>f : (x: Foo | Other) => any +>x : Foo | Other + +f(x); +>f(x) : any +>f : (x: Foo | Other) => any +>x : { a: string; b: string; } + +f({ a: '', b: '' }) +>f({ a: '', b: '' }) : any +>f : (x: Foo | Other) => any +>{ a: '', b: '' } : { a: string; b: string; } +>a : string +>'' : "" +>b : string +>'' : "" + +declare function g(x: Bar | Other): any; +>g : (x: Bar | Other) => any +>x : Bar | Other + +g(x); +>g(x) : any +>g : (x: Bar | Other) => any +>x : { a: string; b: string; } + +g({ a: '', b: '' }) +>g({ a: '', b: '' }) : any +>g : (x: Bar | Other) => any +>{ a: '', b: '' } : { a: string; b: string; } +>a : string +>'' : "" +>b : string +>'' : "" + +declare function h(x: Foo | Bar | Other): any; +>h : (x: Foo | Bar | Other) => any +>x : Foo | Bar | Other + +h(x); +>h(x) : any +>h : (x: Foo | Bar | Other) => any +>x : { a: string; b: string; } + +h({ a: '', b: '' }) +>h({ a: '', b: '' }) : any +>h : (x: Foo | Bar | Other) => any +>{ a: '', b: '' } : { a: string; b: string; } +>a : string +>'' : "" +>b : string +>'' : "" + diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt index 958bf059324..a4c5e2bc2f5 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -14,9 +14,9 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(39,1): error TS2322: Type Types of property 'tag' are incompatible. Type '"A"' is not assignable to type '"C"'. tests/cases/compiler/excessPropertyCheckWithUnions.ts(40,1): error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type 'Ambiguous'. - Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. + Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "B"; z: boolean; }'. Types of property 'tag' are incompatible. - Type '"A"' is not assignable to type '"C"'. + Type '"A"' is not assignable to type '"B"'. tests/cases/compiler/excessPropertyCheckWithUnions.ts(49,35): error TS2322: Type '{ a: 1; b: 1; first: string; second: string; }' is not assignable to type 'Overlapping'. Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. tests/cases/compiler/excessPropertyCheckWithUnions.ts(50,35): error TS2322: Type '{ a: 1; b: 1; first: string; third: string; }' is not assignable to type 'Overlapping'. @@ -92,9 +92,9 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(66,9): error TS2322: Type amb = { tag: "A", z: true } ~~~ !!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type 'Ambiguous'. -!!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. +!!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "B"; z: boolean; }'. !!! error TS2322: Types of property 'tag' are incompatible. -!!! error TS2322: Type '"A"' is not assignable to type '"C"'. +!!! error TS2322: Type '"A"' is not assignable to type '"B"'. type Overlapping = | { a: 1, b: 1, first: string } diff --git a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt index 62ddfd497a3..32772fa8533 100644 --- a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt +++ b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt @@ -6,9 +6,8 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(20,1): e Property 'a' is missing in type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(23,1): error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. Type 'A' is not assignable to type '(A & B) | (C & D)'. - Type 'A' is not assignable to type 'C & D'. - Type 'A' is not assignable to type 'C'. - Property 'c' is missing in type 'A'. + Type 'A' is not assignable to type 'A & B'. + Type 'A' is not assignable to type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type 'C & D'. @@ -35,14 +34,15 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(31,1): e Type 'A & B' is not assignable to type 'D'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(32,1): error TS2322: Type 'A | B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. Type 'A' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. - Type 'A' is not assignable to type 'B & D'. - Type 'A' is not assignable to type 'B'. + Type 'A' is not assignable to type 'A & D'. + Type 'A' is not assignable to type 'D'. + Property 'd' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(33,1): error TS2322: Type 'C & D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. Type 'C & D' is not assignable to type 'B & D'. Type 'C & D' is not assignable to type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(34,1): error TS2322: Type 'C | D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. Type 'C' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. - Type 'C' is not assignable to type 'B & D'. + Type 'C' is not assignable to type 'B & C'. Type 'C' is not assignable to type 'B'. Property 'b' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(35,1): error TS2322: Type '(A & C) | (A & D) | (B & C) | (B & D)' is not assignable to type 'A & B'. @@ -90,9 +90,8 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e ~ !!! error TS2322: Type 'A | B' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'. -!!! error TS2322: Type 'A' is not assignable to type 'C & D'. -!!! error TS2322: Type 'A' is not assignable to type 'C'. -!!! error TS2322: Property 'c' is missing in type 'A'. +!!! error TS2322: Type 'A' is not assignable to type 'A & B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. x = cnd; // Ok x = cod; ~ @@ -135,8 +134,9 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e ~ !!! error TS2322: Type 'A | B' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. !!! error TS2322: Type 'A' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. -!!! error TS2322: Type 'A' is not assignable to type 'B & D'. -!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type 'A' is not assignable to type 'A & D'. +!!! error TS2322: Type 'A' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'A'. y = cnd; ~ !!! error TS2322: Type 'C & D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. @@ -146,7 +146,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e ~ !!! error TS2322: Type 'C | D' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. !!! error TS2322: Type 'C' is not assignable to type '(A & C) | (A & D) | (B & C) | (B & D)'. -!!! error TS2322: Type 'C' is not assignable to type 'B & D'. +!!! error TS2322: Type 'C' is not assignable to type 'B & C'. !!! error TS2322: Type 'C' is not assignable to type 'B'. !!! error TS2322: Property 'b' is missing in type 'C'. anb = y; diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt index d481b88810c..2153bae6e86 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt @@ -6,8 +6,11 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(19,1): error TS2 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is not assignable to type 'Property'. Types of property 'parent' are incompatible. Type 'Namespace' is not assignable to type 'Module | Class'. - Type 'Namespace' is not assignable to type 'Class'. - Property 'parent' is missing in type 'Namespace'. + Type 'Namespace' is not assignable to type 'Module'. + Types of property 'members' are incompatible. + Type '(Class | Property)[]' is not assignable to type 'Class[]'. + Type 'Class | Property' is not assignable to type 'Class'. + Type 'Property' is not assignable to type 'Class'. ==== tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts (2 errors) ==== @@ -41,6 +44,9 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2 !!! error TS2322: Type 'Class' is not assignable to type 'Property'. !!! error TS2322: Types of property 'parent' are incompatible. !!! error TS2322: Type 'Namespace' is not assignable to type 'Module | Class'. -!!! error TS2322: Type 'Namespace' is not assignable to type 'Class'. -!!! error TS2322: Property 'parent' is missing in type 'Namespace'. +!!! error TS2322: Type 'Namespace' is not assignable to type 'Module'. +!!! error TS2322: Types of property 'members' are incompatible. +!!! error TS2322: Type '(Class | Property)[]' is not assignable to type 'Class[]'. +!!! error TS2322: Type 'Class | Property' is not assignable to type 'Class'. +!!! error TS2322: Type 'Property' is not assignable to type 'Class'. \ No newline at end of file From 0f5d62630b7faa5b0820a8859bd5159d9472366e Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 17 Sep 2018 11:26:35 -0700 Subject: [PATCH 013/322] Use this.toPath --- src/server/editorServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 21eb931d491..606e3bbe405 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1884,7 +1884,7 @@ namespace ts.server { const path = toNormalizedPath(uncheckedFileName); const info = this.getScriptInfoForNormalizedPath(path); if (info) return info; - const configProject = this.configuredProjects.get(this.toCanonicalFileName(path)); + const configProject = this.configuredProjects.get(this.toPath(uncheckedFileName)); return configProject && configProject.getCompilerOptions().configFile; } From 96f9e076f88ec27a4ddfa95a39e815b1f2c8ba41 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 26 Sep 2018 13:50:37 -0700 Subject: [PATCH 014/322] Don't implicit-any diagnostic for json module --- src/compiler/checker.ts | 2 +- ...xCannotFindModule_suggestion_falsePositive.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a66a7edcf18..495b85fc05f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2241,7 +2241,7 @@ namespace ts { const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations diff --git a/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts new file mode 100644 index 00000000000..123d59d82a3 --- /dev/null +++ b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts @@ -0,0 +1,16 @@ +/// + +// @moduleResolution: node +// @resolveJsonModule: true +// @strict: true + +// @Filename: /node_modules/foo/bar.json +////export const x = 0; + +// @Filename: /a.ts +////import abs = require([|"foo/bar.json"|]); +////abs; + +verify.noErrors(); +goTo.file("/a.ts"); +verify.getSuggestionDiagnostics([]); From 7b1388b071cc87d0618e4aeebf46c8ff09134f39 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 26 Sep 2018 16:05:12 -0700 Subject: [PATCH 015/322] Ensure verify.noErrors tests json files --- src/harness/fourslash.ts | 3 ++- .../codeFixCannotFindModule_suggestion_falsePositive.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c06e95339f1..1c32d5dda4c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -593,7 +593,8 @@ namespace FourSlash { public verifyNoErrors() { ts.forEachKey(this.inputFiles, fileName => { if (!ts.isAnySupportedFileExtension(fileName) - || !this.getProgram().getCompilerOptions().allowJs && !ts.extensionIsTS(ts.extensionFromPath(fileName))) return; + || Harness.getConfigNameFromFileName(fileName) + || !this.getProgram().getCompilerOptions().allowJs && !ts.resolutionExtensionIsTSOrJson(ts.extensionFromPath(fileName))) return; const errors = this.getDiagnostics(fileName).filter(e => e.category !== ts.DiagnosticCategory.Suggestion); if (errors.length) { this.printErrorLog(/*expectErrors*/ false, errors); diff --git a/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts index 123d59d82a3..54afae7c4d1 100644 --- a/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts +++ b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_falsePositive.ts @@ -5,7 +5,7 @@ // @strict: true // @Filename: /node_modules/foo/bar.json -////export const x = 0; +////{ "a": 0 } // @Filename: /a.ts ////import abs = require([|"foo/bar.json"|]); From 643678bb54b5a4260aaab6c2872e6c3439f5a789 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 14 Nov 2018 14:53:26 -0800 Subject: [PATCH 016/322] generateGetAccessorAndSetAccessor: Don't use FindAllReferences --- .../generateGetAccessorAndSetAccessor.ts | 36 +++++++++---------- ...efactorConvertToGetAccessAndSetAccess33.ts | 4 +-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/services/refactors/generateGetAccessorAndSetAccessor.ts b/src/services/refactors/generateGetAccessorAndSetAccessor.ts index 70f16e3b7b2..dbc73781871 100644 --- a/src/services/refactors/generateGetAccessorAndSetAccessor.ts +++ b/src/services/refactors/generateGetAccessorAndSetAccessor.ts @@ -16,7 +16,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { readonly declaration: AcceptedDeclaration; readonly fieldName: AcceptedNameType; readonly accessorName: AcceptedNameType; - readonly originalName: AcceptedNameType; + readonly originalName: string; readonly renameAccessor: boolean; } @@ -69,7 +69,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { // readonly modifier only existed in classLikeDeclaration const constructor = getFirstConstructorWithBody(container); if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName); + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); } } else { @@ -135,7 +135,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { isReadonly: hasReadonlyModifier(declaration), type: getTypeAnnotationNode(declaration), container: declaration.kind === SyntaxKind.Parameter ? declaration.parent.parent : declaration.parent, - originalName: declaration.name, + originalName: (declaration.name).text, declaration, fieldName, accessorName, @@ -221,22 +221,22 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { : changeTracker.insertNodeAfter(file, declaration, accessor); } - function updateReadonlyPropertyInitializerStatementConstructor(changeTracker: textChanges.ChangeTracker, context: RefactorContext, constructor: ConstructorDeclaration, fieldName: AcceptedNameType, originalName: AcceptedNameType) { + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker: textChanges.ChangeTracker, file: SourceFile, constructor: ConstructorDeclaration, fieldName: string, originalName: string) { if (!constructor.body) return; - const { file, program, cancellationToken } = context; - - const referenceEntries = mapDefined(FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken!), entry => // TODO: GH#18217 - (entry.kind !== FindAllReferences.EntryKind.Span && rangeContainsRange(constructor, entry.node) && isIdentifier(entry.node) && isWriteAccess(entry.node)) ? entry.node : undefined); - - forEach(referenceEntries, entry => { - const parent = entry.parent; - const accessorName = createIdentifier(fieldName.text); - const node = isBinaryExpression(parent) - ? updateBinary(parent, accessorName, parent.right, parent.operatorToken) - : isPropertyAccessExpression(parent) - ? updatePropertyAccess(parent, parent.expression, accessorName) - : Debug.fail("Unexpected write access token"); - changeTracker.replaceNode(file, parent, node); + constructor.body.forEachChild(function recur(node) { + if (isElementAccessExpression(node) && + node.expression.kind === SyntaxKind.ThisKeyword && + isStringLiteral(node.argumentExpression) && + node.argumentExpression.text === originalName && + isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, createStringLiteral(fieldName)); + } + if (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword && node.name.text === originalName && isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, createIdentifier(fieldName)); + } + if (!isFunctionLike(node) && !isClassLike(node)) { + node.forEachChild(recur); + } }); } } diff --git a/tests/cases/fourslash/refactorConvertToGetAccessAndSetAccess33.ts b/tests/cases/fourslash/refactorConvertToGetAccessAndSetAccess33.ts index d74f246fdfe..aa224b8b31b 100644 --- a/tests/cases/fourslash/refactorConvertToGetAccessAndSetAccess33.ts +++ b/tests/cases/fourslash/refactorConvertToGetAccessAndSetAccess33.ts @@ -5,7 +5,7 @@ //// public b: number; //// constructor () { //// this.a = 1; // convert -//// this.a++; // convert +//// this["a"]++; // convert //// ++this.a; // convert //// if (Math.random()) { //// this.a = 2; // convert @@ -29,7 +29,7 @@ edit.applyRefactor({ public b: number; constructor () { this._a = 1; // convert - this._a++; // convert + this["_a"]++; // convert ++this._a; // convert if (Math.random()) { this._a = 2; // convert From 02d5cb045c07b727877d651f2f42785d13475286 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 2 Nov 2018 11:27:52 -0700 Subject: [PATCH 017/322] Expose file size from TextStorage Since it's for telemetry, it prefers to return a stale value rather than triggering file IO (though it will load the file if not even a stale value is available). --- src/server/scriptInfo.ts | 54 ++++++++++++-- src/testRunner/unittests/textStorage.ts | 95 ++++++++++++++++++++++--- 2 files changed, 133 insertions(+), 16 deletions(-) diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 4e3a67748dd..9af99ea76ef 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -25,6 +25,14 @@ namespace ts.server { */ private lineMap: number[] | undefined; + /** + * When a large file is loaded, text will artificially be set to "". + * In order to be able to report correct telemetry, we store the actual + * file size in this case. (In other cases where text === "", e.g. + * for mixed content or dynamic files, fileSize will be undefined.) + */ + private fileSize: number | undefined; + /** * True if the text is for the file thats open in the editor */ @@ -56,10 +64,11 @@ namespace ts.server { this.switchToScriptVersionCache(); } - public useText(newText?: string) { + public useText_TestOnly(newText?: string) { this.svc = undefined; this.text = newText; this.lineMap = undefined; + this.fileSize = undefined; this.version.text++; } @@ -68,29 +77,41 @@ namespace ts.server { this.ownFileText = false; this.text = undefined; this.lineMap = undefined; + this.fileSize = undefined; } /** * Set the contents as newText * returns true if text changed */ - public reload(newText: string) { + public reload(newText: string): boolean { Debug.assert(newText !== undefined); // Reload always has fresh content this.pendingReloadFromDisk = false; + // We only need both this.text and this.fileSize if this.text + // is artificially empty because it was too large. + // We assume that an empty string passed to reload is not + // for a file that was too large to store. + this.fileSize = undefined; + // If text changed set the text // This also ensures that if we had switched to version cache, // we are switching back to text. // The change to version cache will happen when needed // Thus avoiding the computation if there are no changes if (this.text !== newText) { - this.useText(newText); + this.text = newText; + this.version.text++; + this.svc = undefined; + this.lineMap = undefined; // We cant guarantee new text is own file text this.ownFileText = false; return true; } + + return false; } /** @@ -98,7 +119,9 @@ namespace ts.server { * returns true if text changed */ public reloadWithFileText(tempFileName?: string) { - const reloaded = this.reload(this.getFileText(tempFileName)); + const { text: newText, fileSize } = this.getFileTextAndSize(tempFileName); + const reloaded = this.reload(newText); + this.fileSize = fileSize; // NB: after reload since reload clears it this.ownFileText = !tempFileName || tempFileName === this.fileName; return reloaded; } @@ -118,6 +141,23 @@ namespace ts.server { this.pendingReloadFromDisk = true; } + /** + * For telemetry purposes, we would like to be able to report the size of the file. + * However, we do not want telemetry to require extra file I/O so we report a size + * that may be stale (e.g. may not reflect change made on disk since the last reload). + * NB: Will read from disk if the file contents have never been loaded because + * telemetry falsely indicating size 0 would be counter-productive. + */ + public getTelemetryFileSize(): number { + return !!this.fileSize + ? this.fileSize + : !!this.text // Check text before svc because its length is cheaper + ? this.text.length // Could be wrong if this.pendingReloadFromDisk + : !!this.svc + ? this.svc.getSnapshot().getLength() // Could be wrong if this.pendingReloadFromDisk + : this.getSnapshot().getLength(); // Should be strictly correct + } + public getSnapshot(): IScriptSnapshot { return this.useScriptVersionCacheIfValidOrOpen() ? this.svc!.getSnapshot() @@ -161,7 +201,7 @@ namespace ts.server { return this.svc!.positionToLineOffset(position); } - private getFileText(tempFileName?: string) { + private getFileTextAndSize(tempFileName?: string): { text: string, fileSize?: number } { let text: string; const fileName = tempFileName || this.fileName; const getText = () => text === undefined ? (text = this.host.readFile(fileName) || "") : text; @@ -173,10 +213,10 @@ namespace ts.server { const service = this.info.containingProjects[0].projectService; service.logger.info(`Skipped loading contents of large file ${fileName} for info ${this.info.fileName}: fileSize: ${fileSize}`); this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize); - return ""; + return { text: "", fileSize }; } } - return getText(); + return { text: getText() }; } private switchToScriptVersionCache(): ScriptVersionCache { diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/textStorage.ts index 5486cf57745..b57d1109c7b 100644 --- a/src/testRunner/unittests/textStorage.ts +++ b/src/testRunner/unittests/textStorage.ts @@ -18,7 +18,7 @@ namespace ts.textStorage { const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); ts1.useScriptVersionCache_TestOnly(); - ts2.useText(); + ts2.useText_TestOnly(); const lineMap = computeLineStarts(f.content); @@ -29,20 +29,20 @@ namespace ts.textStorage { for (let offset = 0; offset < end - start; offset++) { const pos1 = ts1.lineOffsetToPosition(line + 1, offset + 1); const pos2 = ts2.lineOffsetToPosition(line + 1, offset + 1); - assert.isTrue(pos1 === pos2, `lineOffsetToPosition ${line + 1}-${offset + 1}: expected ${pos1} to equal ${pos2}`); + assert.strictEqual(pos1, pos2, `lineOffsetToPosition ${line + 1}-${offset + 1}: expected ${pos1} to equal ${pos2}`); } const {start: start1, length: length1 } = ts1.lineToTextSpan(line); const {start: start2, length: length2 } = ts2.lineToTextSpan(line); - assert.isTrue(start1 === start2, `lineToTextSpan ${line}::start:: expected ${start1} to equal ${start2}`); - assert.isTrue(length1 === length2, `lineToTextSpan ${line}::length:: expected ${length1} to equal ${length2}`); + assert.strictEqual(start1, start2, `lineToTextSpan ${line}::start:: expected ${start1} to equal ${start2}`); + assert.strictEqual(length1, length2, `lineToTextSpan ${line}::length:: expected ${length1} to equal ${length2}`); } for (let pos = 0; pos < f.content.length; pos++) { const { line: line1, offset: offset1 } = ts1.positionToLineOffset(pos); const { line: line2, offset: offset2 } = ts2.positionToLineOffset(pos); - assert.isTrue(line1 === line2, `positionToLineOffset ${pos}::line:: expected ${line1} to equal ${line2}`); - assert.isTrue(offset1 === offset2, `positionToLineOffset ${pos}::offset:: expected ${offset1} to equal ${offset2}`); + assert.strictEqual(line1, line2, `positionToLineOffset ${pos}::line:: expected ${line1} to equal ${line2}`); + assert.strictEqual(offset1, offset2, `positionToLineOffset ${pos}::offset:: expected ${offset1} to equal ${offset2}`); } }); @@ -52,16 +52,93 @@ namespace ts.textStorage { const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); ts1.getSnapshot(); - assert.isTrue(!ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 1"); + assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 1"); ts1.edit(0, 5, " "); assert.isTrue(ts1.hasScriptVersionCache_TestOnly(), "have script version cache - 1"); - ts1.useText(); - assert.isTrue(!ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 2"); + ts1.useText_TestOnly(); + assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 2"); ts1.getLineInfo(0); assert.isTrue(ts1.hasScriptVersionCache_TestOnly(), "have script version cache - 2"); }); + + it("should be able to return the file size immediately after construction", () => { + const host = projectSystem.createServerHost([f]); + // Since script info is not used in these tests, just cheat by passing undefined + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + + assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); + }); + + it("should be able to return the file size when backed by text", () => { + const host = projectSystem.createServerHost([f]); + // Since script info is not used in these tests, just cheat by passing undefined + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + + ts1.useText_TestOnly(f.content); + assert.isFalse(ts1.hasScriptVersionCache_TestOnly()); + + assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); + }); + + it("should be able to return the file size when backed by a script version cache", () => { + const host = projectSystem.createServerHost([f]); + // Since script info is not used in these tests, just cheat by passing undefined + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + + ts1.useScriptVersionCache_TestOnly(); + assert.isTrue(ts1.hasScriptVersionCache_TestOnly()); + + assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); + }); + + it("should be able to return the file size when a JS file is too large to load into text", () => { + const largeFile = { + path: "/a/large.js", + content: " ".repeat(server.maxFileSize + 1) + }; + + const host = projectSystem.createServerHost([largeFile]); + + // The large-file handling requires a ScriptInfo with a containing project + const projectService = projectSystem.createProjectService(host); + projectService.openClientFile(largeFile.path); + const scriptInfo = projectService.getScriptInfo(largeFile.path); + + const ts1 = new server.TextStorage(host, server.asNormalizedPath(largeFile.path), /*initialVersion*/ undefined, scriptInfo!); + + assert.isTrue(ts1.reloadFromDisk()); + assert.isFalse(ts1.hasScriptVersionCache_TestOnly()); + + assert.strictEqual(largeFile.content.length, ts1.getTelemetryFileSize()); + }); + + it("should return the file size without reloading the file", () => { + const oldText = "hello"; + const newText = "goodbye"; + + const changingFile = { + path: "/a/changing.ts", + content: oldText + }; + + const host = projectSystem.createServerHost([changingFile]); + // Since script info is not used in these tests, just cheat by passing undefined + const ts1 = new server.TextStorage(host, server.asNormalizedPath(changingFile.path), /*initialVersion*/ undefined, /*info*/undefined!); + + assert.isTrue(ts1.reloadFromDisk()); + + // Refresh the file and notify TextStorage + host.writeFile(changingFile.path, newText); + ts1.delayReloadFromFileIntoText(); + + assert.strictEqual(oldText.length, ts1.getTelemetryFileSize()); + + assert.isTrue(ts1.reloadWithFileText()); + + assert.strictEqual(newText.length, ts1.getTelemetryFileSize()); + }); }); } From 2c7d67fdedf05ba93fdd3eee67e4cd1ef904e193 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 15 Nov 2018 10:54:48 -0800 Subject: [PATCH 018/322] Expose aggregate file sizes in FileStats We're not sure that file counts are a good proxy for project size and this will give us more direct insight. --- src/server/editorServices.ts | 13 ++++++++++++- src/server/project.ts | 27 ++++++++++++++++++++++----- src/server/scriptInfo.ts | 5 +++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index ac80f43c84c..23baa9119bf 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -123,11 +123,22 @@ namespace ts.server { export interface FileStats { readonly js: number; + readonly jsSize?: number; + readonly jsx: number; + readonly jsxSize?: number; + readonly ts: number; + readonly tsSize?: number; + readonly tsx: number; + readonly tsxSize?: number; + readonly dts: number; + readonly dtsSize?: number; + readonly deferred: number; + readonly deferredSize?: number; } export interface OpenFileInfo { @@ -1600,7 +1611,7 @@ namespace ts.server { setProjectOptionsUsed(project); const data: ProjectInfoTelemetryEventData = { projectId: this.host.createSHA256Hash(project.projectName), - fileStats: countEachFileTypes(project.getScriptInfos()), + fileStats: countEachFileTypes(project.getScriptInfos(), /*includeSizes*/ true), compilerOptions: convertCompilerOptionsForTelemetry(project.getCompilationSettings()), typeAcquisition: convertTypeAcquisition(project.getTypeAcquisition()), extends: projectOptions && projectOptions.configHasExtendsProperty, diff --git a/src/server/project.ts b/src/server/project.ts index 7b11f48fbd6..dbfa9100ca4 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -10,26 +10,43 @@ namespace ts.server { export type Mutable = { -readonly [K in keyof T]: T[K]; }; /* @internal */ - export function countEachFileTypes(infos: ScriptInfo[]): FileStats { - const result: Mutable = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0, deferred: 0 }; + export function countEachFileTypes(infos: ScriptInfo[], includeSizes = false): FileStats { + const result: Mutable = { + js: 0, jsSize: 0, + jsx: 0, jsxSize: 0, + ts: 0, tsSize: 0, + tsx: 0, tsxSize: 0, + dts: 0, dtsSize: 0, + deferred: 0, deferredSize: 0, + }; for (const info of infos) { + const fileSize = includeSizes ? info.getTelemetryFileSize() : 0; switch (info.scriptKind) { case ScriptKind.JS: result.js += 1; + result.jsSize! += fileSize; break; case ScriptKind.JSX: result.jsx += 1; + result.jsxSize! += fileSize; break; case ScriptKind.TS: - fileExtensionIs(info.fileName, Extension.Dts) - ? result.dts += 1 - : result.ts += 1; + if (fileExtensionIs(info.fileName, Extension.Dts)) { + result.dts += 1; + result.dtsSize! += fileSize; + } + else { + result.ts += 1; + result.tsSize! += fileSize; + } break; case ScriptKind.TSX: result.tsx += 1; + result.tsxSize! += fileSize; break; case ScriptKind.Deferred: result.deferred += 1; + result.deferredSize! += fileSize; break; } } diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 9af99ea76ef..defc28f7495 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -316,6 +316,11 @@ namespace ts.server { return this.textStorage.version; } + /*@internal*/ + getTelemetryFileSize() { + return this.textStorage.getTelemetryFileSize(); + } + /*@internal*/ public isDynamicOrHasMixedContent() { return this.hasMixedContent || this.isDynamic; From b059135c51ee93f8fb44dd70a2ca67674ff7a877 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Nov 2018 15:11:27 -0800 Subject: [PATCH 019/322] When adding relative completions with rootDirs, still add completions for regular relative imports (#28561) --- src/services/stringCompletions.ts | 19 ++++------ ...mpletionForStringLiteralRelativeImport4.ts | 35 +++++++++++++------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index 7e60edc03d7..9548397a22d 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -281,33 +281,26 @@ namespace ts.Completions.StringCompletions { * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option */ - function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, scriptPath: string, ignoreCase: boolean): string[] { + function getBaseDirectoriesFromRootDirs(rootDirs: string[], basePath: string, scriptDirectory: string, ignoreCase: boolean): ReadonlyArray { // Make all paths absolute/normalized if they are not already rootDirs = rootDirs.map(rootDirectory => normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory))); // Determine the path to the directory containing the script relative to the root directory it is contained within const relativeDirectory = firstDefined(rootDirs, rootDirectory => - containsPath(rootDirectory, scriptPath, basePath, ignoreCase) ? scriptPath.substr(rootDirectory.length) : undefined)!; // TODO: GH#18217 + containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined)!; // TODO: GH#18217 // Now find a path for each potential directory that is to be merged with the one containing the script return deduplicate( - rootDirs.map(rootDirectory => combinePaths(rootDirectory, relativeDirectory)), + [...rootDirs.map(rootDirectory => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory], equateStringsCaseSensitive, compareStringsCaseSensitive); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptPath: string, extensionOptions: ExtensionOptions, compilerOptions: CompilerOptions, host: LanguageServiceHost, exclude?: string): NameAndKind[] { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs: string[], fragment: string, scriptDirectory: string, extensionOptions: ExtensionOptions, compilerOptions: CompilerOptions, host: LanguageServiceHost, exclude: string): ReadonlyArray { const basePath = compilerOptions.project || host.getCurrentDirectory(); const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - - const result: NameAndKind[] = []; - - for (const baseDirectory of baseDirectories) { - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude, result); - } - - return result; + const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return flatMap(baseDirectories, baseDirectory => getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude)); } /** diff --git a/tests/cases/fourslash/completionForStringLiteralRelativeImport4.ts b/tests/cases/fourslash/completionForStringLiteralRelativeImport4.ts index cacb3c19174..c2fff29333b 100644 --- a/tests/cases/fourslash/completionForStringLiteralRelativeImport4.ts +++ b/tests/cases/fourslash/completionForStringLiteralRelativeImport4.ts @@ -2,23 +2,29 @@ // Should give completions for directories that are merged via the rootDirs compiler option -// @rootDirs: tests/cases/fourslash/sub/src1,tests/cases/fourslash/src2 +// @rootDirs: /sub/src1,/src2 -// @Filename: src2/test0.ts +// @Filename: /src2/test0.ts //// import * as foo1 from "./mo/*import_as0*/ //// import foo2 = require("./mo/*import_equals0*/ //// var foo3 = require("./mo/*require0*/ -// @Filename: src2/module0.ts +// @Filename: /src2/inner/inner0.ts +////import * as s from ".//*inner*/"; + +// @Filename: /src2/inner/inner1.ts +////export const x = 0; + +// @Filename: /src2/module0.ts //// export var w = 0; -// @Filename: sub/src1/module1.ts +// @Filename: /sub/src1/module1.ts //// export var x = 0; -// @Filename: sub/src1/module2.ts +// @Filename: /sub/src1/module2.ts //// export var y = 0; -// @Filename: sub/src1/more/module3.ts +// @Filename: /sub/src1/more/module3.ts //// export var z = 0; @@ -37,8 +43,15 @@ // @Filename: e2.js //// -verify.completions({ - marker: test.markers(), - exact: ["module1", "module2", "more", "module0"], - isNewIdentifierLocation: true, -}); +verify.completions( + { + marker: ["import_as0", "import_equals0", "require0"], + exact: ["module1", "module2", "more", "module0", "inner"], + isNewIdentifierLocation: true, + }, + { + marker: "inner", + exact: "inner1", + isNewIdentifierLocation: true, + } +); From d5b95b5904615c75fe32a03910e69f5d1872161f Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 15 Nov 2018 15:54:21 -0800 Subject: [PATCH 020/322] Update API baseline --- tests/baselines/reference/api/tsserverlibrary.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 120f3bcb5a1..a6ac75b4dca 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8437,11 +8437,17 @@ declare namespace ts.server { } interface FileStats { readonly js: number; + readonly jsSize?: number; readonly jsx: number; + readonly jsxSize?: number; readonly ts: number; + readonly tsSize?: number; readonly tsx: number; + readonly tsxSize?: number; readonly dts: number; + readonly dtsSize?: number; readonly deferred: number; + readonly deferredSize?: number; } interface OpenFileInfo { readonly checkJs: boolean; From 8bfdb4145da1c1a00285e9d87063f9485af32e6c Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 15 Nov 2018 16:00:35 -0800 Subject: [PATCH 021/322] Fix tests and lint --- src/server/project.ts | 2 +- src/testRunner/unittests/telemetry.ts | 5 +++-- src/testRunner/unittests/tsserverProjectSystem.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/project.ts b/src/server/project.ts index dbfa9100ca4..45d932abc3e 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -11,7 +11,7 @@ namespace ts.server { /* @internal */ export function countEachFileTypes(infos: ScriptInfo[], includeSizes = false): FileStats { - const result: Mutable = { + const result: Mutable = { js: 0, jsSize: 0, jsx: 0, jsxSize: 0, ts: 0, tsSize: 0, diff --git a/src/testRunner/unittests/telemetry.ts b/src/testRunner/unittests/telemetry.ts index 1c11a40c2ee..2eee552b38f 100644 --- a/src/testRunner/unittests/telemetry.ts +++ b/src/testRunner/unittests/telemetry.ts @@ -215,11 +215,12 @@ namespace ts.projectSystem { const file = makeFile("/a.js"); const tsconfig = makeFile("/jsconfig.json", {}); const et = new TestServerEventManager([tsconfig, file]); - et.host.getFileSize = () => server.maxProgramSizeForNonTsFiles + 1; + const fileSize = server.maxProgramSizeForNonTsFiles + 1; + et.host.getFileSize = () => fileSize; et.service.openClientFile(file.path); et.getEvent(server.ProjectLanguageServiceStateEvent); et.assertProjectInfoTelemetryEvent({ - fileStats: fileStats({ js: 1 }), + fileStats: fileStats({ js: 1, jsSize: fileSize }), compilerOptions: autoJsCompilerOptions, configFileName: "jsconfig.json", typeAcquisition: { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index b292ec5486c..709f48b1d56 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -183,7 +183,7 @@ namespace ts.projectSystem { } export function fileStats(nonZeroStats: Partial): server.FileStats { - return { ts: 0, tsx: 0, dts: 0, js: 0, jsx: 0, deferred: 0, ...nonZeroStats }; + return { ts: 0, tsSize: 0, tsx: 0, tsxSize: 0, dts: 0, dtsSize: 0, js: 0, jsSize: 0, jsx: 0, jsxSize: 0, deferred: 0, deferredSize: 0, ...nonZeroStats }; } export interface ConfigFileDiagnostic { From 10fa76c06a72e68d5d1e3186ec2195878b219173 Mon Sep 17 00:00:00 2001 From: Caleb Sander Date: Thu, 15 Nov 2018 23:31:13 -0800 Subject: [PATCH 022/322] Remove unused baselines --- .../DocComments.parsesCorrectly.noType.json | 27 - .../convertToAsyncFunction_MultipleReturns.ts | 23 - .../convertToAsyncFunction_Scope.ts | 31 - .../convertToAsyncFunction_noArgs.js | 30 - .../reference/importWithTrailingSlash.json | 28 - ...edParameterBeforeNonoptionalNotOptional.js | 11 - .../reference/interfaceSpread.errors.txt | 21 - tests/baselines/reference/interfaceSpread.js | 15 - tests/baselines/reference/jsDocTypes.js | 136 ---- tests/baselines/reference/jsDocTypes.symbols | 132 ---- tests/baselines/reference/jsDocTypes.types | 135 ---- ...PropertyAssignedAfterMethodDeclaration.txt | 16 - .../reference/namespacesDeclaration.js | 22 - .../reference/namespacesDeclaration.symbols | 16 - .../reference/namespacesDeclaration.types | 16 - .../noImplicitThisObjectLiterals.errors.txt | 22 - .../reference/noImplicitThisObjectLiterals.js | 22 - .../reference/objectSpreadInference.js | 43 -- .../reference/objectSpreadInference.symbols | 100 --- .../reference/objectSpreadInference.types | 118 ---- .../reference/objectSpreadIntersection.js | 77 --- .../objectSpreadIntersection.symbols | 188 ------ .../reference/objectSpreadIntersection.types | 207 ------ .../reference/objectSpreadScenarios.js | 45 -- .../reference/objectSpreadScenarios.symbols | 85 --- .../reference/objectSpreadScenarios.types | 107 --- .../baselines/reference/objectSpreadUnion.js | 52 -- .../reference/objectSpreadUnion.symbols | 122 ---- .../reference/objectSpreadUnion.types | 131 ---- .../oldStyleOctalLiteralTypes.errors.txt | 12 - .../reference/oldStyleOctalLiteralTypes.js | 8 - tests/baselines/reference/parser537152.js | 8 - .../baselines/reference/parser537152.symbols | 8 - tests/baselines/reference/parser537152.types | 10 - ...rootImport_noAliasWithRoot_failedLookup.js | 26 - ...mport_noAliasWithRoot_failedLookup.symbols | 15 - ...rt_noAliasWithRoot_failedLookup.trace.json | 34 - ...tImport_noAliasWithRoot_failedLookup.types | 15 - ...tePathMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...tePathMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...lutePathModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...lutePathModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...olutePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...olutePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...otAbsolutePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...otAbsolutePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...solutePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...solutePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...bsolutePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...bsolutePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...vePathMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...vePathMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...tivePathModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...tivePathModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ativePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...ativePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...otRelativePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...otRelativePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...lativePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...lativePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...elativePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...elativePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...prootUrlModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...prootUrlModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...aprootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...aprootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- .../maprootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- .../maprootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...maprootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...maprootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- .../maprootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- .../maprootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...erootUrlModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...erootUrlModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...cerootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...cerootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...lsourcerootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- ...lsourcerootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...rcerootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...rcerootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...urcerootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- ...urcerootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- .../amd/rootDirectory.sourcemap.txt | 124 ---- .../node/rootDirectory.sourcemap.txt | 124 ---- .../amd/FolderA/FolderB/fileB.d.ts | 4 - .../amd/FolderA/FolderB/fileB.js | 6 - .../amd/outdir/simple/fileC.d.ts | 2 - .../amd/outdir/simple/fileC.js | 5 - .../node/FolderA/FolderB/fileB.d.ts | 4 - .../node/FolderA/FolderB/fileB.js | 6 - .../node/outdir/simple/fileC.d.ts | 2 - .../node/outdir/simple/fileC.js | 5 - .../rootDirectoryWithSourceRoot.sourcemap.txt | 124 ---- .../rootDirectoryWithSourceRoot.sourcemap.txt | 124 ---- ...tePathMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...tePathMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...lutePathModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...lutePathModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...olutePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...olutePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...otAbsolutePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...otAbsolutePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...solutePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...solutePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...bsolutePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...bsolutePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...vePathMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...vePathMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...athModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...tivePathModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...tivePathModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...ePathModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...ativePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...ativePathMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...otRelativePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...otRelativePathSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...ePathSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...lativePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...lativePathSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...hSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...elativePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...elativePathSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...thSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...rcemapMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...rcemapMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...mapModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...mapModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...ourcemapModuleSimpleNoOutdir.sourcemap.txt | 374 ----------- ...ourcemapModuleSimpleNoOutdir.sourcemap.txt | 395 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 368 ----------- ...cemapModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...cemapModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 374 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 395 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 368 ----------- ...sourcemapMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...sourcemapMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- .../amd/sourcemapSimpleNoOutdir.sourcemap.txt | 296 --------- .../sourcemapSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...cemapSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...cemapSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- .../sourcemapSingleFileNoOutdir.sourcemap.txt | 144 ---- .../sourcemapSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...pSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...pSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- .../sourcemapSubfolderNoOutdir.sourcemap.txt | 296 --------- .../sourcemapSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...apSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...apSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 479 -------------- ...ootUrlMixedSubfolderNoOutdir.sourcemap.txt | 478 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 479 -------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 478 -------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 467 ------------- ...edSubfolderSpecifyOutputFile.sourcemap.txt | 300 --------- ...OutputFileAndOutputDirectory.sourcemap.txt | 467 ------------- ...OutputFileAndOutputDirectory.sourcemap.txt | 300 --------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 573 ---------------- ...UrlModuleMultifolderNoOutdir.sourcemap.txt | 617 ------------------ ...folderSpecifyOutputDirectory.sourcemap.txt | 573 ---------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 617 ------------------ ...MultifolderSpecifyOutputFile.sourcemap.txt | 561 ---------------- ...erootUrlModuleSimpleNoOutdir.sourcemap.txt | 365 ----------- ...erootUrlModuleSimpleNoOutdir.sourcemap.txt | 371 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 365 ----------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 371 ----------- ...oduleSimpleSpecifyOutputFile.sourcemap.txt | 359 ---------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 374 ----------- ...otUrlModuleSubfolderNoOutdir.sourcemap.txt | 395 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 365 ----------- ...folderSpecifyOutputDirectory.sourcemap.txt | 371 ----------- ...leSubfolderSpecifyOutputFile.sourcemap.txt | 359 ---------- ...cerootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...cerootUrlMultifolderNoOutdir.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...folderSpecifyOutputDirectory.sourcemap.txt | 449 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- ...MultifolderSpecifyOutputFile.sourcemap.txt | 437 ------------- .../sourcerootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- .../sourcerootUrlSimpleNoOutdir.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...SimpleSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...otUrlSimpleSpecifyOutputFile.sourcemap.txt | 290 -------- ...rcerootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...rcerootUrlSingleFileNoOutdir.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...leFileSpecifyOutputDirectory.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...lSingleFileSpecifyOutputFile.sourcemap.txt | 144 ---- ...urcerootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- ...urcerootUrlSubfolderNoOutdir.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...folderSpecifyOutputDirectory.sourcemap.txt | 296 --------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- ...rlSubfolderSpecifyOutputFile.sourcemap.txt | 290 -------- tests/baselines/reference/third-output.js.map | 1 - ...orrectly.transformAddCommentToClassProp.js | 7 - ...r-options input is empty object.errors.txt | 6 - ...r-options input is empty string.errors.txt | 6 - .../Supports setting strictTuples.js | 2 - ...ports setting strictTuples.oldTranspile.js | 2 - ...ypedModuleImport_noLocalImports.errors.txt | 13 - .../untypedModuleImport_noLocalImports.js | 14 - 434 files changed, 140682 deletions(-) delete mode 100644 tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noType.json delete mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_MultipleReturns.ts delete mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Scope.ts delete mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js delete mode 100644 tests/baselines/reference/importWithTrailingSlash.json delete mode 100644 tests/baselines/reference/initializedParameterBeforeNonoptionalNotOptional.js delete mode 100644 tests/baselines/reference/interfaceSpread.errors.txt delete mode 100644 tests/baselines/reference/interfaceSpread.js delete mode 100644 tests/baselines/reference/jsDocTypes.js delete mode 100644 tests/baselines/reference/jsDocTypes.symbols delete mode 100644 tests/baselines/reference/jsDocTypes.types delete mode 100644 tests/baselines/reference/jsPropertyAssignedAfterMethodDeclaration.txt delete mode 100644 tests/baselines/reference/namespacesDeclaration.js delete mode 100644 tests/baselines/reference/namespacesDeclaration.symbols delete mode 100644 tests/baselines/reference/namespacesDeclaration.types delete mode 100644 tests/baselines/reference/noImplicitThisObjectLiterals.errors.txt delete mode 100644 tests/baselines/reference/noImplicitThisObjectLiterals.js delete mode 100644 tests/baselines/reference/objectSpreadInference.js delete mode 100644 tests/baselines/reference/objectSpreadInference.symbols delete mode 100644 tests/baselines/reference/objectSpreadInference.types delete mode 100644 tests/baselines/reference/objectSpreadIntersection.js delete mode 100644 tests/baselines/reference/objectSpreadIntersection.symbols delete mode 100644 tests/baselines/reference/objectSpreadIntersection.types delete mode 100644 tests/baselines/reference/objectSpreadScenarios.js delete mode 100644 tests/baselines/reference/objectSpreadScenarios.symbols delete mode 100644 tests/baselines/reference/objectSpreadScenarios.types delete mode 100644 tests/baselines/reference/objectSpreadUnion.js delete mode 100644 tests/baselines/reference/objectSpreadUnion.symbols delete mode 100644 tests/baselines/reference/objectSpreadUnion.types delete mode 100644 tests/baselines/reference/oldStyleOctalLiteralTypes.errors.txt delete mode 100644 tests/baselines/reference/oldStyleOctalLiteralTypes.js delete mode 100644 tests/baselines/reference/parser537152.js delete mode 100644 tests/baselines/reference/parser537152.symbols delete mode 100644 tests/baselines/reference/parser537152.types delete mode 100644 tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.js delete mode 100644 tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.symbols delete mode 100644 tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.trace.json delete mode 100644 tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.types delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.d.ts delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.js delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.d.ts delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.js delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.d.ts delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.js delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.d.ts delete mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.js delete mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt delete mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt delete mode 100644 tests/baselines/reference/third-output.js.map delete mode 100644 tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToClassProp.js delete mode 100644 tests/baselines/reference/transpile/Report an error when compiler-options input is empty object.errors.txt delete mode 100644 tests/baselines/reference/transpile/Report an error when compiler-options input is empty string.errors.txt delete mode 100644 tests/baselines/reference/transpile/Supports setting strictTuples.js delete mode 100644 tests/baselines/reference/transpile/Supports setting strictTuples.oldTranspile.js delete mode 100644 tests/baselines/reference/untypedModuleImport_noLocalImports.errors.txt delete mode 100644 tests/baselines/reference/untypedModuleImport_noLocalImports.js diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noType.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noType.json deleted file mode 100644 index 06e50488025..00000000000 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.noType.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "kind": "JSDocComment", - "pos": 0, - "end": 18, - "tags": { - "0": { - "kind": "JSDocTypeTag", - "pos": 8, - "end": 14, - "atToken": { - "kind": "AtToken", - "pos": 8, - "end": 9 - }, - "tagName": { - "kind": "Identifier", - "pos": 9, - "end": 13, - "escapedText": "type" - }, - "comment": "" - }, - "length": 1, - "pos": 8, - "end": 14 - } -} \ No newline at end of file diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_MultipleReturns.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_MultipleReturns.ts deleted file mode 100644 index 1250ea44359..00000000000 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_MultipleReturns.ts +++ /dev/null @@ -1,23 +0,0 @@ -// ==ORIGINAL== - -function /*[#|*/f/*|]*/(): Promise { - let x = fetch("https://microsoft.com").then(res => console.log("Microsoft:", res)); - if (x.ok) { - return fetch("https://typescriptlang.org").then(res => console.log(res)); - } - return x.then(resp => { - var blob = resp.blob().then(blob => blob.byteOffset).catch(err => 'Error'); - }); -} - -// ==ASYNC FUNCTION::Convert to async function== - -async function f(): Promise { - let x = fetch("https://microsoft.com").then(res => console.log("Microsoft:", res)); - if (x.ok) { - let res_2 = await fetch("https://typescriptlang.org"); - return console.log(res_2); - } - let resp = await x; - var blob = resp.blob().then(blob_1 => blob_1.byteOffset).catch(err => 'Error'); -} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Scope.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Scope.ts deleted file mode 100644 index 1c6a9694fd7..00000000000 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_Scope.ts +++ /dev/null @@ -1,31 +0,0 @@ -// ==ORIGINAL== - -function /*[#|*/f/*|]*/() { - var var1:Promise, var2; - return fetch('https://typescriptlang.org').then( _ => - Promise.resolve().then( res => { - var2 = "test"; - return fetch("https://microsoft.com"); - }).then(res => - var1 === res - ) - ).then(res); - } - function res(response){ - console.log(response); - } - -// ==ASYNC FUNCTION::Convert to async function== - -async function f() { - var var1:Promise, var2; - await fetch('https://typescriptlang.org'); - let res = await Promise.resolve(); - var2 = "test"; - let res_1 = fetch("https://microsoft.com"); - let response = var1 === res_1; - return res(response); - } - function res(response){ - console.log(response); - } diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js deleted file mode 100644 index 8cda2c9dc94..00000000000 --- a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js +++ /dev/null @@ -1,30 +0,0 @@ -// ==ORIGINAL== - -function delay(millis) { - throw "no" -} - -function /*[#|*/main2/*|]*/() { - console.log("Please wait. Loading."); - return delay(500) - .then(() => { console.log("."); return delay(500); }) - .then(() => { console.log("."); return delay(500); }) - .then(() => { console.log("."); return delay(500); }) -} - -// ==ASYNC FUNCTION::Convert to async function== - -function delay(millis) { - throw "no" -} - -async function main2() { - console.log("Please wait. Loading."); - await delay(500); - console.log("."); - await delay(500); - console.log("."); - await delay(500); - console.log("."); - return delay(500); -} diff --git a/tests/baselines/reference/importWithTrailingSlash.json b/tests/baselines/reference/importWithTrailingSlash.json deleted file mode 100644 index 3c99d4eb6a0..00000000000 --- a/tests/baselines/reference/importWithTrailingSlash.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - "======== Resolving module '.' from '/a/test.ts'. ========", - "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a'.", - "File '/a.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a.ts', result '/a.ts'", - "======== Module name '.' was successfully resolved to '/a.ts'. ========", - "======== Resolving module './' from '/a/test.ts'. ========", - "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/'.", - "File '/a/package.json' does not exist.", - "File '/a/index.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a/index.ts', result '/a/index.ts'", - "======== Module name './' was successfully resolved to '/a/index.ts'. ========", - "======== Resolving module '..' from '/a/b/test.ts'. ========", - "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a'.", - "File '/a.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a.ts', result '/a.ts'", - "======== Module name '..' was successfully resolved to '/a.ts'. ========", - "======== Resolving module '../' from '/a/b/test.ts'. ========", - "Explicitly specified module resolution kind: 'NodeJs'.", - "Loading module as file / folder, candidate module location '/a/'.", - "File '/a/package.json' does not exist.", - "File '/a/index.ts' exist - use it as a name resolution result.", - "Resolving real path for '/a/index.ts', result '/a/index.ts'", - "======== Module name '../' was successfully resolved to '/a/index.ts'. ========" -] \ No newline at end of file diff --git a/tests/baselines/reference/initializedParameterBeforeNonoptionalNotOptional.js b/tests/baselines/reference/initializedParameterBeforeNonoptionalNotOptional.js deleted file mode 100644 index 8a6a602d6d7..00000000000 --- a/tests/baselines/reference/initializedParameterBeforeNonoptionalNotOptional.js +++ /dev/null @@ -1,11 +0,0 @@ -//// [initializedParameterBeforeNonoptionalNotOptional.ts] -export declare function foo({a}?: { - a?: string; -}): void; -export declare function foo2({a}: { - a?: string | undefined; -} | undefined, b: string): void; - -//// [initializedParameterBeforeNonoptionalNotOptional.js] -"use strict"; -exports.__esModule = true; diff --git a/tests/baselines/reference/interfaceSpread.errors.txt b/tests/baselines/reference/interfaceSpread.errors.txt deleted file mode 100644 index c6acc633912..00000000000 --- a/tests/baselines/reference/interfaceSpread.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/types/spread/interfaceSpread.ts(2,5): error TS2698: Interface declaration cannot contain a spread property. -tests/cases/conformance/types/spread/interfaceSpread.ts(7,10): error TS2339: Property 'jam' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'. -tests/cases/conformance/types/spread/interfaceSpread.ts(8,10): error TS2339: Property 'peanutButter' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'. - - -==== tests/cases/conformance/types/spread/interfaceSpread.ts (3 errors) ==== - interface Congealed { - ...T - ~~~~ -!!! error TS2698: Interface declaration cannot contain a spread property. - ...U - } - - let sandwich: Congealed<{jam: number }, { peanutButter: number }>; - sandwich.jam; - ~~~ -!!! error TS2339: Property 'jam' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'. - sandwich.peanutButter; - ~~~~~~~~~~~~ -!!! error TS2339: Property 'peanutButter' does not exist on type 'Congealed<{ jam: number; }, { peanutButter: number; }>'. - \ No newline at end of file diff --git a/tests/baselines/reference/interfaceSpread.js b/tests/baselines/reference/interfaceSpread.js deleted file mode 100644 index 89f25314366..00000000000 --- a/tests/baselines/reference/interfaceSpread.js +++ /dev/null @@ -1,15 +0,0 @@ -//// [interfaceSpread.ts] -interface Congealed { - ...T - ...U -} - -let sandwich: Congealed<{jam: number }, { peanutButter: number }>; -sandwich.jam; -sandwich.peanutButter; - - -//// [interfaceSpread.js] -var sandwich; -sandwich.jam; -sandwich.peanutButter; diff --git a/tests/baselines/reference/jsDocTypes.js b/tests/baselines/reference/jsDocTypes.js deleted file mode 100644 index aab32275f72..00000000000 --- a/tests/baselines/reference/jsDocTypes.js +++ /dev/null @@ -1,136 +0,0 @@ -//// [tests/cases/conformance/salsa/jsDocTypes.ts] //// - -//// [a.js] -/** @type {String} */ -var S; - -/** @type {string} */ -var s; - -/** @type {Number} */ -var N; - -/** @type {number} */ -var n; - -/** @type {Boolean} */ -var B; - -/** @type {boolean} */ -var b; - -/** @type {Void} */ -var V; - -/** @type {void} */ -var v; - -/** @type {Undefined} */ -var U; - -/** @type {undefined} */ -var u; - -/** @type {Null} */ -var Nl; - -/** @type {null} */ -var nl; - -/** @type {Array} */ -var A; - -/** @type {array} */ -var a; - -/** @type {Promise} */ -var P; - -/** @type {promise} */ -var p; - -/** @type {?number} */ -var nullable; - -/** @type {Object} */ -var Obj; - - - -//// [b.ts] -var S: string; -var s: string; -var N: number; -var n: number -var B: boolean; -var b: boolean; -var V :void; -var v: void; -var U: undefined; -var u: undefined; -var Nl: null; -var nl: null; -var A: any[]; -var a: any[]; -var P: Promise; -var p: Promise; -var nullable: number | null; -var Obj: any; - - -//// [a.js] -/** @type {String} */ -var S; -/** @type {string} */ -var s; -/** @type {Number} */ -var N; -/** @type {number} */ -var n; -/** @type {Boolean} */ -var B; -/** @type {boolean} */ -var b; -/** @type {Void} */ -var V; -/** @type {void} */ -var v; -/** @type {Undefined} */ -var U; -/** @type {undefined} */ -var u; -/** @type {Null} */ -var Nl; -/** @type {null} */ -var nl; -/** @type {Array} */ -var A; -/** @type {array} */ -var a; -/** @type {Promise} */ -var P; -/** @type {promise} */ -var p; -/** @type {?number} */ -var nullable; -/** @type {Object} */ -var Obj; -//// [b.js] -var S; -var s; -var N; -var n; -var B; -var b; -var V; -var v; -var U; -var u; -var Nl; -var nl; -var A; -var a; -var P; -var p; -var nullable; -var Obj; diff --git a/tests/baselines/reference/jsDocTypes.symbols b/tests/baselines/reference/jsDocTypes.symbols deleted file mode 100644 index eb795295ea0..00000000000 --- a/tests/baselines/reference/jsDocTypes.symbols +++ /dev/null @@ -1,132 +0,0 @@ -=== tests/cases/conformance/salsa/a.js === -/** @type {String} */ -var S; ->S : Symbol(S, Decl(a.js, 1, 3), Decl(b.ts, 0, 3)) - -/** @type {string} */ -var s; ->s : Symbol(s, Decl(a.js, 4, 3), Decl(b.ts, 1, 3)) - -/** @type {Number} */ -var N; ->N : Symbol(N, Decl(a.js, 7, 3), Decl(b.ts, 2, 3)) - -/** @type {number} */ -var n; ->n : Symbol(n, Decl(a.js, 10, 3), Decl(b.ts, 3, 3)) - -/** @type {Boolean} */ -var B; ->B : Symbol(B, Decl(a.js, 13, 3), Decl(b.ts, 4, 3)) - -/** @type {boolean} */ -var b; ->b : Symbol(b, Decl(a.js, 16, 3), Decl(b.ts, 5, 3)) - -/** @type {Void} */ -var V; ->V : Symbol(V, Decl(a.js, 19, 3), Decl(b.ts, 6, 3)) - -/** @type {void} */ -var v; ->v : Symbol(v, Decl(a.js, 22, 3), Decl(b.ts, 7, 3)) - -/** @type {Undefined} */ -var U; ->U : Symbol(U, Decl(a.js, 25, 3), Decl(b.ts, 8, 3)) - -/** @type {undefined} */ -var u; ->u : Symbol(u, Decl(a.js, 28, 3), Decl(b.ts, 9, 3)) - -/** @type {Null} */ -var Nl; ->Nl : Symbol(Nl, Decl(a.js, 31, 3), Decl(b.ts, 10, 3)) - -/** @type {null} */ -var nl; ->nl : Symbol(nl, Decl(a.js, 34, 3), Decl(b.ts, 11, 3)) - -/** @type {Array} */ -var A; ->A : Symbol(A, Decl(a.js, 37, 3), Decl(b.ts, 12, 3)) - -/** @type {array} */ -var a; ->a : Symbol(a, Decl(a.js, 40, 3), Decl(b.ts, 13, 3)) - -/** @type {Promise} */ -var P; ->P : Symbol(P, Decl(a.js, 43, 3), Decl(b.ts, 14, 3)) - -/** @type {promise} */ -var p; ->p : Symbol(p, Decl(a.js, 46, 3), Decl(b.ts, 15, 3)) - -/** @type {?number} */ -var nullable; ->nullable : Symbol(nullable, Decl(a.js, 49, 3), Decl(b.ts, 16, 3)) - -/** @type {Object} */ -var Obj; ->Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3)) - - - -=== tests/cases/conformance/salsa/b.ts === -var S: string; ->S : Symbol(S, Decl(a.js, 1, 3), Decl(b.ts, 0, 3)) - -var s: string; ->s : Symbol(s, Decl(a.js, 4, 3), Decl(b.ts, 1, 3)) - -var N: number; ->N : Symbol(N, Decl(a.js, 7, 3), Decl(b.ts, 2, 3)) - -var n: number ->n : Symbol(n, Decl(a.js, 10, 3), Decl(b.ts, 3, 3)) - -var B: boolean; ->B : Symbol(B, Decl(a.js, 13, 3), Decl(b.ts, 4, 3)) - -var b: boolean; ->b : Symbol(b, Decl(a.js, 16, 3), Decl(b.ts, 5, 3)) - -var V :void; ->V : Symbol(V, Decl(a.js, 19, 3), Decl(b.ts, 6, 3)) - -var v: void; ->v : Symbol(v, Decl(a.js, 22, 3), Decl(b.ts, 7, 3)) - -var U: undefined; ->U : Symbol(U, Decl(a.js, 25, 3), Decl(b.ts, 8, 3)) - -var u: undefined; ->u : Symbol(u, Decl(a.js, 28, 3), Decl(b.ts, 9, 3)) - -var Nl: null; ->Nl : Symbol(Nl, Decl(a.js, 31, 3), Decl(b.ts, 10, 3)) - -var nl: null; ->nl : Symbol(nl, Decl(a.js, 34, 3), Decl(b.ts, 11, 3)) - -var A: any[]; ->A : Symbol(A, Decl(a.js, 37, 3), Decl(b.ts, 12, 3)) - -var a: any[]; ->a : Symbol(a, Decl(a.js, 40, 3), Decl(b.ts, 13, 3)) - -var P: Promise; ->P : Symbol(P, Decl(a.js, 43, 3), Decl(b.ts, 14, 3)) ->Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) - -var p: Promise; ->p : Symbol(p, Decl(a.js, 46, 3), Decl(b.ts, 15, 3)) ->Promise : Symbol(Promise, Decl(lib.d.ts, --, --)) - -var nullable: number | null; ->nullable : Symbol(nullable, Decl(a.js, 49, 3), Decl(b.ts, 16, 3)) - -var Obj: any; ->Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3)) - diff --git a/tests/baselines/reference/jsDocTypes.types b/tests/baselines/reference/jsDocTypes.types deleted file mode 100644 index 116e9f0a245..00000000000 --- a/tests/baselines/reference/jsDocTypes.types +++ /dev/null @@ -1,135 +0,0 @@ -=== tests/cases/conformance/salsa/a.js === -/** @type {String} */ -var S; ->S : string - -/** @type {string} */ -var s; ->s : string - -/** @type {Number} */ -var N; ->N : number - -/** @type {number} */ -var n; ->n : number - -/** @type {Boolean} */ -var B; ->B : boolean - -/** @type {boolean} */ -var b; ->b : boolean - -/** @type {Void} */ -var V; ->V : void - -/** @type {void} */ -var v; ->v : void - -/** @type {Undefined} */ -var U; ->U : undefined - -/** @type {undefined} */ -var u; ->u : undefined - -/** @type {Null} */ -var Nl; ->Nl : null - -/** @type {null} */ -var nl; ->nl : null - -/** @type {Array} */ -var A; ->A : any[] - -/** @type {array} */ -var a; ->a : any[] - -/** @type {Promise} */ -var P; ->P : Promise - -/** @type {promise} */ -var p; ->p : Promise - -/** @type {?number} */ -var nullable; ->nullable : number | null - -/** @type {Object} */ -var Obj; ->Obj : any - - - -=== tests/cases/conformance/salsa/b.ts === -var S: string; ->S : string - -var s: string; ->s : string - -var N: number; ->N : number - -var n: number ->n : number - -var B: boolean; ->B : boolean - -var b: boolean; ->b : boolean - -var V :void; ->V : void - -var v: void; ->v : void - -var U: undefined; ->U : undefined - -var u: undefined; ->u : undefined - -var Nl: null; ->Nl : null ->null : null - -var nl: null; ->nl : null ->null : null - -var A: any[]; ->A : any[] - -var a: any[]; ->a : any[] - -var P: Promise; ->P : Promise ->Promise : Promise - -var p: Promise; ->p : Promise ->Promise : Promise - -var nullable: number | null; ->nullable : number | null ->null : null - -var Obj: any; ->Obj : any - diff --git a/tests/baselines/reference/jsPropertyAssignedAfterMethodDeclaration.txt b/tests/baselines/reference/jsPropertyAssignedAfterMethodDeclaration.txt deleted file mode 100644 index a774e45ff66..00000000000 --- a/tests/baselines/reference/jsPropertyAssignedAfterMethodDeclaration.txt +++ /dev/null @@ -1,16 +0,0 @@ -/a.js(4,9): error TS2322: Type '0' is not assignable to type '() => void'. - - -==== /a.js (1 errors) ==== - const o = { - a() { - // Should not be treated as a declaration. Should be an error. - this.a = 0; - ~~~~~~ -!!! error TS2322: Type '0' is not assignable to type '() => void'. - }, - b() { - this.b = () => {}; // OK - } - }; - \ No newline at end of file diff --git a/tests/baselines/reference/namespacesDeclaration.js b/tests/baselines/reference/namespacesDeclaration.js deleted file mode 100644 index 7c7cfa84af0..00000000000 --- a/tests/baselines/reference/namespacesDeclaration.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [namespacesDeclaration.ts] - -module M { - export namespace N { - export module M2 { - export interface I {} - } - } -} - -//// [namespacesDeclaration.js] - - -//// [namespacesDeclaration.d.ts] -declare module M { - namespace N { - module M2 { - interface I { - } - } - } -} diff --git a/tests/baselines/reference/namespacesDeclaration.symbols b/tests/baselines/reference/namespacesDeclaration.symbols deleted file mode 100644 index 1706f212f34..00000000000 --- a/tests/baselines/reference/namespacesDeclaration.symbols +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/compiler/namespacesDeclaration.ts === - -module M { ->M : Symbol(M, Decl(namespacesDeclaration.ts, 0, 0)) - - export namespace N { ->N : Symbol(N, Decl(namespacesDeclaration.ts, 1, 10)) - - export module M2 { ->M2 : Symbol(M2, Decl(namespacesDeclaration.ts, 2, 23)) - - export interface I {} ->I : Symbol(I, Decl(namespacesDeclaration.ts, 3, 24)) - } - } -} diff --git a/tests/baselines/reference/namespacesDeclaration.types b/tests/baselines/reference/namespacesDeclaration.types deleted file mode 100644 index 944098097fc..00000000000 --- a/tests/baselines/reference/namespacesDeclaration.types +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/compiler/namespacesDeclaration.ts === - -module M { ->M : any - - export namespace N { ->N : any - - export module M2 { ->M2 : any - - export interface I {} ->I : I - } - } -} diff --git a/tests/baselines/reference/noImplicitThisObjectLiterals.errors.txt b/tests/baselines/reference/noImplicitThisObjectLiterals.errors.txt deleted file mode 100644 index 6f25f2d3a08..00000000000 --- a/tests/baselines/reference/noImplicitThisObjectLiterals.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/compiler/noImplicitThisObjectLiterals.ts(2,8): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. -tests/cases/compiler/noImplicitThisObjectLiterals.ts(4,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. -tests/cases/compiler/noImplicitThisObjectLiterals.ts(7,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. - - -==== tests/cases/compiler/noImplicitThisObjectLiterals.ts (3 errors) ==== - let o = { - d: this, // error, this: any - ~~~~ -!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. - m() { - return this.d.length; // error, this: any - ~~~~ -!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. - }, - f: function() { - return this.d.length; // error, this: any - ~~~~ -!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitThisObjectLiterals.js b/tests/baselines/reference/noImplicitThisObjectLiterals.js deleted file mode 100644 index 3888708a8da..00000000000 --- a/tests/baselines/reference/noImplicitThisObjectLiterals.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [noImplicitThisObjectLiterals.ts] -let o = { - d: this, // error, this: any - m() { - return this.d.length; // error, this: any - }, - f: function() { - return this.d.length; // error, this: any - } -} - - -//// [noImplicitThisObjectLiterals.js] -var o = { - d: this, - m: function () { - return this.d.length; // error, this: any - }, - f: function () { - return this.d.length; // error, this: any - } -}; diff --git a/tests/baselines/reference/objectSpreadInference.js b/tests/baselines/reference/objectSpreadInference.js deleted file mode 100644 index 77930e56511..00000000000 --- a/tests/baselines/reference/objectSpreadInference.js +++ /dev/null @@ -1,43 +0,0 @@ -//// [objectSpreadInference.ts] -interface Result { - t: T; - u: U; - v: V; -} -declare function infer(tuv: { ...T, ...U, a: V }): { t: T, u: U, v: V }; -declare function infer2(utv: { ...U, a: V, ...T }): { t: T, u: U, v: V }; -function generic(w: W, x: X, y: Y) { - // should infer { t: {}, u: {}, v: {} } because there is no trailing type parameter - return infer({ ...w, ...x, a: y, b: "different type" }); -} -let b: { b: number }; -let c: { c: number }; -// can only infer { t: {}, u: {}, v: {} } -let i1 = infer({ ...b, ...c, a: 12 }); -// can only infer { t: {}, u: {}, v: {} } -let i2 = infer2({ ...b, ...c, a: 12 }); -// can only infer { t: {}, u: {}, v: {} } -let i3 = generic(b, c, { a: 12 }); - - -//// [objectSpreadInference.js] -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -function generic(w, x, y) { - // should infer { t: {}, u: {}, v: {} } because there is no trailing type parameter - return infer(__assign({}, w, x, { a: y, b: "different type" })); -} -var b; -var c; -// can only infer { t: {}, u: {}, v: {} } -var i1 = infer(__assign({}, b, c, { a: 12 })); -// can only infer { t: {}, u: {}, v: {} } -var i2 = infer2(__assign({}, b, c, { a: 12 })); -// can only infer { t: {}, u: {}, v: {} } -var i3 = generic(b, c, { a: 12 }); diff --git a/tests/baselines/reference/objectSpreadInference.symbols b/tests/baselines/reference/objectSpreadInference.symbols deleted file mode 100644 index ddecc4d7e5d..00000000000 --- a/tests/baselines/reference/objectSpreadInference.symbols +++ /dev/null @@ -1,100 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadInference.ts === -interface Result { ->Result : Symbol(Result, Decl(objectSpreadInference.ts, 0, 0)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 0, 17)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 0, 19)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 0, 21)) - - t: T; ->t : Symbol(Result.t, Decl(objectSpreadInference.ts, 0, 25)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 0, 17)) - - u: U; ->u : Symbol(Result.u, Decl(objectSpreadInference.ts, 1, 9)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 0, 19)) - - v: V; ->v : Symbol(Result.v, Decl(objectSpreadInference.ts, 2, 9)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 0, 21)) -} -declare function infer(tuv: { ...T, ...U, a: V }): { t: T, u: U, v: V }; ->infer : Symbol(infer, Decl(objectSpreadInference.ts, 4, 1)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 5, 23)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 5, 25)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 5, 27)) ->tuv : Symbol(tuv, Decl(objectSpreadInference.ts, 5, 30)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 5, 23)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 5, 25)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 5, 48)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 5, 27)) ->t : Symbol(t, Decl(objectSpreadInference.ts, 5, 59)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 5, 23)) ->u : Symbol(u, Decl(objectSpreadInference.ts, 5, 65)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 5, 25)) ->v : Symbol(v, Decl(objectSpreadInference.ts, 5, 71)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 5, 27)) - -declare function infer2(utv: { ...U, a: V, ...T }): { t: T, u: U, v: V }; ->infer2 : Symbol(infer2, Decl(objectSpreadInference.ts, 5, 79)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 6, 24)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 6, 26)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 6, 28)) ->utv : Symbol(utv, Decl(objectSpreadInference.ts, 6, 31)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 6, 26)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 6, 43)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 6, 28)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 6, 24)) ->t : Symbol(t, Decl(objectSpreadInference.ts, 6, 60)) ->T : Symbol(T, Decl(objectSpreadInference.ts, 6, 24)) ->u : Symbol(u, Decl(objectSpreadInference.ts, 6, 66)) ->U : Symbol(U, Decl(objectSpreadInference.ts, 6, 26)) ->v : Symbol(v, Decl(objectSpreadInference.ts, 6, 72)) ->V : Symbol(V, Decl(objectSpreadInference.ts, 6, 28)) - -function generic(w: W, x: X, y: Y) { ->generic : Symbol(generic, Decl(objectSpreadInference.ts, 6, 80)) ->W : Symbol(W, Decl(objectSpreadInference.ts, 7, 17)) ->X : Symbol(X, Decl(objectSpreadInference.ts, 7, 19)) ->Y : Symbol(Y, Decl(objectSpreadInference.ts, 7, 22)) ->w : Symbol(w, Decl(objectSpreadInference.ts, 7, 26)) ->W : Symbol(W, Decl(objectSpreadInference.ts, 7, 17)) ->x : Symbol(x, Decl(objectSpreadInference.ts, 7, 31)) ->X : Symbol(X, Decl(objectSpreadInference.ts, 7, 19)) ->y : Symbol(y, Decl(objectSpreadInference.ts, 7, 37)) ->Y : Symbol(Y, Decl(objectSpreadInference.ts, 7, 22)) - - // should infer { t: {}, u: {}, v: {} } because there is no trailing type parameter - return infer({ ...w, ...x, a: y, b: "different type" }); ->infer : Symbol(infer, Decl(objectSpreadInference.ts, 4, 1)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 9, 30)) ->y : Symbol(y, Decl(objectSpreadInference.ts, 7, 37)) ->b : Symbol(b, Decl(objectSpreadInference.ts, 9, 36)) -} -let b: { b: number }; ->b : Symbol(b, Decl(objectSpreadInference.ts, 11, 3)) ->b : Symbol(b, Decl(objectSpreadInference.ts, 11, 8)) - -let c: { c: number }; ->c : Symbol(c, Decl(objectSpreadInference.ts, 12, 3)) ->c : Symbol(c, Decl(objectSpreadInference.ts, 12, 8)) - -// can only infer { t: {}, u: {}, v: {} } -let i1 = infer({ ...b, ...c, a: 12 }); ->i1 : Symbol(i1, Decl(objectSpreadInference.ts, 14, 3)) ->infer : Symbol(infer, Decl(objectSpreadInference.ts, 4, 1)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 14, 28)) - -// can only infer { t: {}, u: {}, v: {} } -let i2 = infer2({ ...b, ...c, a: 12 }); ->i2 : Symbol(i2, Decl(objectSpreadInference.ts, 16, 3)) ->infer2 : Symbol(infer2, Decl(objectSpreadInference.ts, 5, 79)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 16, 29)) - -// can only infer { t: {}, u: {}, v: {} } -let i3 = generic(b, c, { a: 12 }); ->i3 : Symbol(i3, Decl(objectSpreadInference.ts, 18, 3)) ->generic : Symbol(generic, Decl(objectSpreadInference.ts, 6, 80)) ->b : Symbol(b, Decl(objectSpreadInference.ts, 11, 3)) ->c : Symbol(c, Decl(objectSpreadInference.ts, 12, 3)) ->a : Symbol(a, Decl(objectSpreadInference.ts, 18, 24)) - diff --git a/tests/baselines/reference/objectSpreadInference.types b/tests/baselines/reference/objectSpreadInference.types deleted file mode 100644 index 3e71e29b83c..00000000000 --- a/tests/baselines/reference/objectSpreadInference.types +++ /dev/null @@ -1,118 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadInference.ts === -interface Result { ->Result : Result ->T : T ->U : U ->V : V - - t: T; ->t : T ->T : T - - u: U; ->u : U ->U : U - - v: V; ->v : V ->V : V -} -declare function infer(tuv: { ...T, ...U, a: V }): { t: T, u: U, v: V }; ->infer : (tuv: { ...T; ...U; a: V; }) => { t: T; u: U; v: V; } ->T : T ->U : U ->V : V ->tuv : { ...T; ...U; a: V; } ->T : T ->U : U ->a : V ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - -declare function infer2(utv: { ...U, a: V, ...T }): { t: T, u: U, v: V }; ->infer2 : (utv: { ...U; a: V; ...T }) => { t: T; u: U; v: V; } ->T : T ->U : U ->V : V ->utv : { ...U; a: V; ...T } ->U : U ->a : V ->V : V ->T : T ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - -function generic(w: W, x: X, y: Y) { ->generic : (w: W, x: X, y: Y) => { t: {}; u: {}; v: {}; } ->W : W ->X : X ->Y : Y ->w : W ->W : W ->x : X ->X : X ->y : Y ->Y : Y - - // should infer { t: {}, u: {}, v: {} } because there is no trailing type parameter - return infer({ ...w, ...x, a: y, b: "different type" }); ->infer({ ...w, ...x, a: y, b: "different type" }) : { t: {}; u: {}; v: {}; } ->infer : (tuv: { ...T; ...U; a: V; }) => { t: T; u: U; v: V; } ->{ ...w, ...x, a: y, b: "different type" } : { ...W; ...X; a: Y; b: string; } ->w : any ->x : any ->a : Y ->y : Y ->b : string ->"different type" : "different type" -} -let b: { b: number }; ->b : { b: number; } ->b : number - -let c: { c: number }; ->c : { c: number; } ->c : number - -// can only infer { t: {}, u: {}, v: {} } -let i1 = infer({ ...b, ...c, a: 12 }); ->i1 : { t: {}; u: {}; v: {}; } ->infer({ ...b, ...c, a: 12 }) : { t: {}; u: {}; v: {}; } ->infer : (tuv: { ...T; ...U; a: V; }) => { t: T; u: U; v: V; } ->{ ...b, ...c, a: 12 } : { a: number; c: number; b: number; } ->b : any ->c : any ->a : number ->12 : 12 - -// can only infer { t: {}, u: {}, v: {} } -let i2 = infer2({ ...b, ...c, a: 12 }); ->i2 : { t: {}; u: {}; v: {}; } ->infer2({ ...b, ...c, a: 12 }) : { t: {}; u: {}; v: {}; } ->infer2 : (utv: { ...U; a: V; ...T }) => { t: T; u: U; v: V; } ->{ ...b, ...c, a: 12 } : { a: number; c: number; b: number; } ->b : any ->c : any ->a : number ->12 : 12 - -// can only infer { t: {}, u: {}, v: {} } -let i3 = generic(b, c, { a: 12 }); ->i3 : { t: {}; u: {}; v: {}; } ->generic(b, c, { a: 12 }) : { t: {}; u: {}; v: {}; } ->generic : (w: W, x: X, y: Y) => { t: {}; u: {}; v: {}; } ->b : { b: number; } ->c : { c: number; } ->{ a: 12 } : { a: number; } ->a : number ->12 : 12 - diff --git a/tests/baselines/reference/objectSpreadIntersection.js b/tests/baselines/reference/objectSpreadIntersection.js deleted file mode 100644 index 2ec6ad35413..00000000000 --- a/tests/baselines/reference/objectSpreadIntersection.js +++ /dev/null @@ -1,77 +0,0 @@ -//// [objectSpreadIntersection.ts] -function iteratedUnionIntersection(t: T, u: U, v: V): void { - let tu: T | U; - let uv: U & V; - let result = { ...tu, ...uv, id: 'foo' }; - let assignable: { ...(T | U), ...(U & V), id: string } = result; -} -// concrete types work -interface A1 { a: number } -interface A2 { a: string } -interface B1 { b: number } -interface B2 { b: string } -let a12: A1 & A2; -let b12: B1 & B2; -let result = { ...a12, ...b12 }; -let sn: number & string = result.a; -sn = result.b; -let assignable: { ...(A1 & A2), ...(B1 & B2) } = result; - -function tripleIntersection(t: T, u: U, v: V): void { - let tuv: T & U & V; - let result = { ...tuv, id: 'bar' }; - let assignable: { ...(T & U & V), id: string } = result; -} -function iteratedDoubleIntersection(t: T, u: U, v: V): void { - let tu: T & U; - let uv: U & V; - let result = { ...tu, ...uv, id: 'baz' }; - let assignable: { ...(T & U), ...(U & V), id: string } = result; -} -function iteratedIntersectionUnion(t: T, u: U, v: V): void { - let tu: T & U; - let uv: U | V; - let result = { ...tu, ...uv, id: 'qux' }; - let assignable: { ...(T & U), ...(U | V), id: string } = result; -} - - - -//// [objectSpreadIntersection.js] -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -function iteratedUnionIntersection(t, u, v) { - var tu; - var uv; - var result = __assign({}, tu, uv, { id: 'foo' }); - var assignable = result; -} -var a12; -var b12; -var result = __assign({}, a12, b12); -var sn = result.a; -sn = result.b; -var assignable = result; -function tripleIntersection(t, u, v) { - var tuv; - var result = __assign({}, tuv, { id: 'bar' }); - var assignable = result; -} -function iteratedDoubleIntersection(t, u, v) { - var tu; - var uv; - var result = __assign({}, tu, uv, { id: 'baz' }); - var assignable = result; -} -function iteratedIntersectionUnion(t, u, v) { - var tu; - var uv; - var result = __assign({}, tu, uv, { id: 'qux' }); - var assignable = result; -} diff --git a/tests/baselines/reference/objectSpreadIntersection.symbols b/tests/baselines/reference/objectSpreadIntersection.symbols deleted file mode 100644 index bc63cb11348..00000000000 --- a/tests/baselines/reference/objectSpreadIntersection.symbols +++ /dev/null @@ -1,188 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadIntersection.ts === -function iteratedUnionIntersection(t: T, u: U, v: V): void { ->iteratedUnionIntersection : Symbol(iteratedUnionIntersection, Decl(objectSpreadIntersection.ts, 0, 0)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40)) ->t : Symbol(t, Decl(objectSpreadIntersection.ts, 0, 44)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35)) ->u : Symbol(u, Decl(objectSpreadIntersection.ts, 0, 49)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) ->v : Symbol(v, Decl(objectSpreadIntersection.ts, 0, 55)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40)) - - let tu: T | U; ->tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 1, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) - - let uv: U & V; ->uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 2, 7)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40)) - - let result = { ...tu, ...uv, id: 'foo' }; ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 3, 7)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 3, 32)) - - let assignable: { ...(T | U), ...(U & V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 4, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 4, 45)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 3, 7)) -} -// concrete types work -interface A1 { a: number } ->A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1)) ->a : Symbol(A1.a, Decl(objectSpreadIntersection.ts, 7, 14)) - -interface A2 { a: string } ->A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26)) ->a : Symbol(A2.a, Decl(objectSpreadIntersection.ts, 8, 14)) - -interface B1 { b: number } ->B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26)) ->b : Symbol(B1.b, Decl(objectSpreadIntersection.ts, 9, 14)) - -interface B2 { b: string } ->B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26)) ->b : Symbol(B2.b, Decl(objectSpreadIntersection.ts, 10, 14)) - -let a12: A1 & A2; ->a12 : Symbol(a12, Decl(objectSpreadIntersection.ts, 11, 3)) ->A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1)) ->A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26)) - -let b12: B1 & B2; ->b12 : Symbol(b12, Decl(objectSpreadIntersection.ts, 12, 3)) ->B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26)) ->B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26)) - -let result = { ...a12, ...b12 }; ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3)) - -let sn: number & string = result.a; ->sn : Symbol(sn, Decl(objectSpreadIntersection.ts, 14, 3)) ->result.a : Symbol(a, Decl(objectSpreadIntersection.ts, 7, 14), Decl(objectSpreadIntersection.ts, 8, 14)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3)) ->a : Symbol(a, Decl(objectSpreadIntersection.ts, 7, 14), Decl(objectSpreadIntersection.ts, 8, 14)) - -sn = result.b; ->sn : Symbol(sn, Decl(objectSpreadIntersection.ts, 14, 3)) ->result.b : Symbol(b, Decl(objectSpreadIntersection.ts, 9, 14), Decl(objectSpreadIntersection.ts, 10, 14)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3)) ->b : Symbol(b, Decl(objectSpreadIntersection.ts, 9, 14), Decl(objectSpreadIntersection.ts, 10, 14)) - -let assignable: { ...(A1 & A2), ...(B1 & B2) } = result; ->assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 16, 3)) ->A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1)) ->A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26)) ->B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26)) ->B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3)) - -function tripleIntersection(t: T, u: U, v: V): void { ->tripleIntersection : Symbol(tripleIntersection, Decl(objectSpreadIntersection.ts, 16, 56)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33)) ->t : Symbol(t, Decl(objectSpreadIntersection.ts, 18, 37)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28)) ->u : Symbol(u, Decl(objectSpreadIntersection.ts, 18, 42)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30)) ->v : Symbol(v, Decl(objectSpreadIntersection.ts, 18, 48)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33)) - - let tuv: T & U & V; ->tuv : Symbol(tuv, Decl(objectSpreadIntersection.ts, 19, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33)) - - let result = { ...tuv, id: 'bar' }; ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 20, 7)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 20, 26)) - - let assignable: { ...(T & U & V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 21, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 21, 37)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 20, 7)) -} -function iteratedDoubleIntersection(t: T, u: U, v: V): void { ->iteratedDoubleIntersection : Symbol(iteratedDoubleIntersection, Decl(objectSpreadIntersection.ts, 22, 1)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41)) ->t : Symbol(t, Decl(objectSpreadIntersection.ts, 23, 45)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36)) ->u : Symbol(u, Decl(objectSpreadIntersection.ts, 23, 50)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) ->v : Symbol(v, Decl(objectSpreadIntersection.ts, 23, 56)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41)) - - let tu: T & U; ->tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 24, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) - - let uv: U & V; ->uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 25, 7)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41)) - - let result = { ...tu, ...uv, id: 'baz' }; ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 26, 7)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 26, 32)) - - let assignable: { ...(T & U), ...(U & V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 27, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 27, 45)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 26, 7)) -} -function iteratedIntersectionUnion(t: T, u: U, v: V): void { ->iteratedIntersectionUnion : Symbol(iteratedIntersectionUnion, Decl(objectSpreadIntersection.ts, 28, 1)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40)) ->t : Symbol(t, Decl(objectSpreadIntersection.ts, 29, 44)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35)) ->u : Symbol(u, Decl(objectSpreadIntersection.ts, 29, 49)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) ->v : Symbol(v, Decl(objectSpreadIntersection.ts, 29, 55)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40)) - - let tu: T & U; ->tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 30, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) - - let uv: U | V; ->uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 31, 7)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40)) - - let result = { ...tu, ...uv, id: 'qux' }; ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 32, 7)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 32, 32)) - - let assignable: { ...(T & U), ...(U | V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 33, 7)) ->T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) ->U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37)) ->V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40)) ->id : Symbol(id, Decl(objectSpreadIntersection.ts, 33, 45)) ->result : Symbol(result, Decl(objectSpreadIntersection.ts, 32, 7)) -} - - diff --git a/tests/baselines/reference/objectSpreadIntersection.types b/tests/baselines/reference/objectSpreadIntersection.types deleted file mode 100644 index e6a7b7c19ee..00000000000 --- a/tests/baselines/reference/objectSpreadIntersection.types +++ /dev/null @@ -1,207 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadIntersection.ts === -function iteratedUnionIntersection(t: T, u: U, v: V): void { ->iteratedUnionIntersection : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tu: T | U; ->tu : T | U ->T : T ->U : U - - let uv: U & V; ->uv : U & V ->U : U ->V : V - - let result = { ...tu, ...uv, id: 'foo' }; ->result : { ...T; ...U & V; id: string; } | { ...U; ...U & V; id: string; } ->{ ...tu, ...uv, id: 'foo' } : { ...T; ...U & V; id: string; } | { ...U; ...U & V; id: string; } ->tu : any ->uv : any ->id : string ->'foo' : "foo" - - let assignable: { ...(T | U), ...(U & V), id: string } = result; ->assignable : { ...T; ...U & V; id: string; } | { ...U; ...U & V; id: string; } ->T : T ->U : U ->U : U ->V : V ->id : string ->result : { ...T; ...U & V; id: string; } | { ...U; ...U & V; id: string; } -} -// concrete types work -interface A1 { a: number } ->A1 : A1 ->a : number - -interface A2 { a: string } ->A2 : A2 ->a : string - -interface B1 { b: number } ->B1 : B1 ->b : number - -interface B2 { b: string } ->B2 : B2 ->b : string - -let a12: A1 & A2; ->a12 : A1 & A2 ->A1 : A1 ->A2 : A2 - -let b12: B1 & B2; ->b12 : B1 & B2 ->B1 : B1 ->B2 : B2 - -let result = { ...a12, ...b12 }; ->result : { b: number & string; a: number & string; } ->{ ...a12, ...b12 } : { b: number & string; a: number & string; } ->a12 : any ->b12 : any - -let sn: number & string = result.a; ->sn : number & string ->result.a : number & string ->result : { b: number & string; a: number & string; } ->a : number & string - -sn = result.b; ->sn = result.b : number & string ->sn : number & string ->result.b : number & string ->result : { b: number & string; a: number & string; } ->b : number & string - -let assignable: { ...(A1 & A2), ...(B1 & B2) } = result; ->assignable : { b: number & string; a: number & string; } ->A1 : A1 ->A2 : A2 ->B1 : B1 ->B2 : B2 ->result : { b: number & string; a: number & string; } - -function tripleIntersection(t: T, u: U, v: V): void { ->tripleIntersection : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tuv: T & U & V; ->tuv : T & U & V ->T : T ->U : U ->V : V - - let result = { ...tuv, id: 'bar' }; ->result : { ...T & U & V; id: string; } ->{ ...tuv, id: 'bar' } : { ...T & U & V; id: string; } ->tuv : any ->id : string ->'bar' : "bar" - - let assignable: { ...(T & U & V), id: string } = result; ->assignable : { ...T & U & V; id: string; } ->T : T ->U : U ->V : V ->id : string ->result : { ...T & U & V; id: string; } -} -function iteratedDoubleIntersection(t: T, u: U, v: V): void { ->iteratedDoubleIntersection : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tu: T & U; ->tu : T & U ->T : T ->U : U - - let uv: U & V; ->uv : U & V ->U : U ->V : V - - let result = { ...tu, ...uv, id: 'baz' }; ->result : { ...T & U; ...U & V; id: string; } ->{ ...tu, ...uv, id: 'baz' } : { ...T & U; ...U & V; id: string; } ->tu : any ->uv : any ->id : string ->'baz' : "baz" - - let assignable: { ...(T & U), ...(U & V), id: string } = result; ->assignable : { ...T & U; ...U & V; id: string; } ->T : T ->U : U ->U : U ->V : V ->id : string ->result : { ...T & U; ...U & V; id: string; } -} -function iteratedIntersectionUnion(t: T, u: U, v: V): void { ->iteratedIntersectionUnion : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tu: T & U; ->tu : T & U ->T : T ->U : U - - let uv: U | V; ->uv : U | V ->U : U ->V : V - - let result = { ...tu, ...uv, id: 'qux' }; ->result : { ...T & U; ...U; id: string; } | { ...T & U; ...V; id: string; } ->{ ...tu, ...uv, id: 'qux' } : { ...T & U; ...U; id: string; } | { ...T & U; ...V; id: string; } ->tu : any ->uv : any ->id : string ->'qux' : "qux" - - let assignable: { ...(T & U), ...(U | V), id: string } = result; ->assignable : { ...T & U; ...U; id: string; } | { ...T & U; ...V; id: string; } ->T : T ->U : U ->U : U ->V : V ->id : string ->result : { ...T & U; ...U; id: string; } | { ...T & U; ...V; id: string; } -} - - diff --git a/tests/baselines/reference/objectSpreadScenarios.js b/tests/baselines/reference/objectSpreadScenarios.js deleted file mode 100644 index 96ac98d2d35..00000000000 --- a/tests/baselines/reference/objectSpreadScenarios.js +++ /dev/null @@ -1,45 +0,0 @@ -//// [objectSpreadScenarios.ts] -interface A1 { a: boolean } -interface B1 { b: number }; -function override(initial: U, override: U): { ...U, ...U } { - return { ...initial, ...override }; -} -function update(this: { u: { ...U } }, override: U): void { - this.u = { ...this.u, ...override }; -} -function mixin(one: T, two: U): { ...T, ...U } { - return { ...one, ...two }; -} -let a1: A1 = { a: true }; -let b1: B1 = { b: 101 }; -a1 = override(a1, { a: false }); -let host = { u: a1, update }; -host.update({ a: false }); -let mixed = mixin(a1, b1); - - -//// [objectSpreadScenarios.js] -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -; -function override(initial, override) { - return __assign({}, initial, override); -} -function update(override) { - this.u = __assign({}, this.u, override); -} -function mixin(one, two) { - return __assign({}, one, two); -} -var a1 = { a: true }; -var b1 = { b: 101 }; -a1 = override(a1, { a: false }); -var host = { u: a1, update: update }; -host.update({ a: false }); -var mixed = mixin(a1, b1); diff --git a/tests/baselines/reference/objectSpreadScenarios.symbols b/tests/baselines/reference/objectSpreadScenarios.symbols deleted file mode 100644 index cf1e1833ac9..00000000000 --- a/tests/baselines/reference/objectSpreadScenarios.symbols +++ /dev/null @@ -1,85 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadScenarios.ts === -interface A1 { a: boolean } ->A1 : Symbol(A1, Decl(objectSpreadScenarios.ts, 0, 0)) ->a : Symbol(A1.a, Decl(objectSpreadScenarios.ts, 0, 14)) - -interface B1 { b: number }; ->B1 : Symbol(B1, Decl(objectSpreadScenarios.ts, 0, 27)) ->b : Symbol(B1.b, Decl(objectSpreadScenarios.ts, 1, 14)) - -function override(initial: U, override: U): { ...U, ...U } { ->override : Symbol(override, Decl(objectSpreadScenarios.ts, 1, 27)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 2, 18)) ->initial : Symbol(initial, Decl(objectSpreadScenarios.ts, 2, 21)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 2, 18)) ->override : Symbol(override, Decl(objectSpreadScenarios.ts, 2, 32)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 2, 18)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 2, 18)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 2, 18)) - - return { ...initial, ...override }; -} -function update(this: { u: { ...U } }, override: U): void { ->update : Symbol(update, Decl(objectSpreadScenarios.ts, 4, 1)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 5, 16)) ->this : Symbol(this, Decl(objectSpreadScenarios.ts, 5, 19)) ->u : Symbol(u, Decl(objectSpreadScenarios.ts, 5, 26)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 5, 16)) ->override : Symbol(override, Decl(objectSpreadScenarios.ts, 5, 41)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 5, 16)) - - this.u = { ...this.u, ...override }; ->this.u : Symbol(u, Decl(objectSpreadScenarios.ts, 5, 26)) ->this : Symbol(this, Decl(objectSpreadScenarios.ts, 5, 19)) ->u : Symbol(u, Decl(objectSpreadScenarios.ts, 5, 26)) ->this.u : Symbol(u, Decl(objectSpreadScenarios.ts, 5, 26)) ->this : Symbol(this, Decl(objectSpreadScenarios.ts, 5, 19)) ->u : Symbol(u, Decl(objectSpreadScenarios.ts, 5, 26)) -} -function mixin(one: T, two: U): { ...T, ...U } { ->mixin : Symbol(mixin, Decl(objectSpreadScenarios.ts, 7, 1)) ->T : Symbol(T, Decl(objectSpreadScenarios.ts, 8, 15)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 8, 17)) ->one : Symbol(one, Decl(objectSpreadScenarios.ts, 8, 21)) ->T : Symbol(T, Decl(objectSpreadScenarios.ts, 8, 15)) ->two : Symbol(two, Decl(objectSpreadScenarios.ts, 8, 28)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 8, 17)) ->T : Symbol(T, Decl(objectSpreadScenarios.ts, 8, 15)) ->U : Symbol(U, Decl(objectSpreadScenarios.ts, 8, 17)) - - return { ...one, ...two }; -} -let a1: A1 = { a: true }; ->a1 : Symbol(a1, Decl(objectSpreadScenarios.ts, 11, 3)) ->A1 : Symbol(A1, Decl(objectSpreadScenarios.ts, 0, 0)) ->a : Symbol(a, Decl(objectSpreadScenarios.ts, 11, 14)) - -let b1: B1 = { b: 101 }; ->b1 : Symbol(b1, Decl(objectSpreadScenarios.ts, 12, 3)) ->B1 : Symbol(B1, Decl(objectSpreadScenarios.ts, 0, 27)) ->b : Symbol(b, Decl(objectSpreadScenarios.ts, 12, 14)) - -a1 = override(a1, { a: false }); ->a1 : Symbol(a1, Decl(objectSpreadScenarios.ts, 11, 3)) ->override : Symbol(override, Decl(objectSpreadScenarios.ts, 1, 27)) ->a1 : Symbol(a1, Decl(objectSpreadScenarios.ts, 11, 3)) ->a : Symbol(a, Decl(objectSpreadScenarios.ts, 13, 19)) - -let host = { u: a1, update }; ->host : Symbol(host, Decl(objectSpreadScenarios.ts, 14, 3)) ->u : Symbol(u, Decl(objectSpreadScenarios.ts, 14, 12)) ->a1 : Symbol(a1, Decl(objectSpreadScenarios.ts, 11, 3)) ->update : Symbol(update, Decl(objectSpreadScenarios.ts, 14, 19)) - -host.update({ a: false }); ->host.update : Symbol(update, Decl(objectSpreadScenarios.ts, 14, 19)) ->host : Symbol(host, Decl(objectSpreadScenarios.ts, 14, 3)) ->update : Symbol(update, Decl(objectSpreadScenarios.ts, 14, 19)) ->a : Symbol(a, Decl(objectSpreadScenarios.ts, 15, 13)) - -let mixed = mixin(a1, b1); ->mixed : Symbol(mixed, Decl(objectSpreadScenarios.ts, 16, 3)) ->mixin : Symbol(mixin, Decl(objectSpreadScenarios.ts, 7, 1)) ->a1 : Symbol(a1, Decl(objectSpreadScenarios.ts, 11, 3)) ->b1 : Symbol(b1, Decl(objectSpreadScenarios.ts, 12, 3)) - diff --git a/tests/baselines/reference/objectSpreadScenarios.types b/tests/baselines/reference/objectSpreadScenarios.types deleted file mode 100644 index 2d1aa47bd50..00000000000 --- a/tests/baselines/reference/objectSpreadScenarios.types +++ /dev/null @@ -1,107 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadScenarios.ts === -interface A1 { a: boolean } ->A1 : A1 ->a : boolean - -interface B1 { b: number }; ->B1 : B1 ->b : number - -function override(initial: U, override: U): { ...U, ...U } { ->override : (initial: U, override: U) => { ...U } ->U : U ->initial : U ->U : U ->override : U ->U : U ->U : U ->U : U - - return { ...initial, ...override }; ->{ ...initial, ...override } : { ...U } ->initial : any ->override : any -} -function update(this: { u: { ...U } }, override: U): void { ->update : (this: { u: { ...U }; }, override: U) => void ->U : U ->this : { u: { ...U }; } ->u : { ...U } ->U : U ->override : U ->U : U - - this.u = { ...this.u, ...override }; ->this.u = { ...this.u, ...override } : { ...U } ->this.u : { ...U } ->this : { u: { ...U }; } ->u : { ...U } ->{ ...this.u, ...override } : { ...U } ->this.u : { ...U } ->this : { u: { ...U }; } ->u : { ...U } ->override : any -} -function mixin(one: T, two: U): { ...T, ...U } { ->mixin : (one: T, two: U) => { ...T; ...U } ->T : T ->U : U ->one : T ->T : T ->two : U ->U : U ->T : T ->U : U - - return { ...one, ...two }; ->{ ...one, ...two } : { ...T; ...U } ->one : any ->two : any -} -let a1: A1 = { a: true }; ->a1 : A1 ->A1 : A1 ->{ a: true } : { a: true; } ->a : boolean ->true : true - -let b1: B1 = { b: 101 }; ->b1 : B1 ->B1 : B1 ->{ b: 101 } : { b: number; } ->b : number ->101 : 101 - -a1 = override(a1, { a: false }); ->a1 = override(a1, { a: false }) : { a: boolean; } ->a1 : A1 ->override(a1, { a: false }) : { a: boolean; } ->override : (initial: U, override: U) => { ...U } ->a1 : A1 ->{ a: false } : { a: false; } ->a : boolean ->false : false - -let host = { u: a1, update }; ->host : { u: A1; update: (this: { u: { ...U }; }, override: U) => void; } ->{ u: a1, update } : { u: A1; update: (this: { u: { ...U }; }, override: U) => void; } ->u : A1 ->a1 : A1 ->update : (this: { u: { ...U }; }, override: U) => void - -host.update({ a: false }); ->host.update({ a: false }) : void ->host.update : (this: { u: { ...U }; }, override: U) => void ->host : { u: A1; update: (this: { u: { ...U }; }, override: U) => void; } ->update : (this: { u: { ...U }; }, override: U) => void ->{ a: false } : { a: false; } ->a : boolean ->false : false - -let mixed = mixin(a1, b1); ->mixed : { b: number; a: boolean; } ->mixin(a1, b1) : { b: number; a: boolean; } ->mixin : (one: T, two: U) => { ...T; ...U } ->a1 : A1 ->b1 : B1 - diff --git a/tests/baselines/reference/objectSpreadUnion.js b/tests/baselines/reference/objectSpreadUnion.js deleted file mode 100644 index b3a114c7722..00000000000 --- a/tests/baselines/reference/objectSpreadUnion.js +++ /dev/null @@ -1,52 +0,0 @@ -//// [objectSpreadUnion.ts] -// concrete types work -interface A1 { a: number } -interface A2 { a: string } -let a12: A1 | A2; -let result = { ...a12 }; -let sn: number | string = result.a; -let assignable: { ...(A1 | A2) } = result; - -function tripleUnion(t: T, u: U, v: V): void { - let tuv: T | U | V; - let result = { ...tuv, id: 'foo' }; - let expected: { ...T, id: string } | { ...U, id: string } | { ...V, id: string } = result; - let assignable: { ...(T | U | V), id: string } = result; -} -function iteratedDoubleUnion(t: T, u: U, v: V): void { - let tu: T | U; - let uv: U | V; - let result = { ...tu, ...uv, id: 'bar' }; - let expected: { ...T, ...U, id: string } | { ...T, ...V, id: string } | { ...U, id: string } | { ...U, ...V, id: string }; - let assignable: { ...(T | U), ...(U | V), id: string } = result; -} - - - - -//// [objectSpreadUnion.js] -var __assign = (this && this.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -var a12; -var result = __assign({}, a12); -var sn = result.a; -var assignable = result; -function tripleUnion(t, u, v) { - var tuv; - var result = __assign({}, tuv, { id: 'foo' }); - var expected = result; - var assignable = result; -} -function iteratedDoubleUnion(t, u, v) { - var tu; - var uv; - var result = __assign({}, tu, uv, { id: 'bar' }); - var expected; - var assignable = result; -} diff --git a/tests/baselines/reference/objectSpreadUnion.symbols b/tests/baselines/reference/objectSpreadUnion.symbols deleted file mode 100644 index d630fde518b..00000000000 --- a/tests/baselines/reference/objectSpreadUnion.symbols +++ /dev/null @@ -1,122 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadUnion.ts === -// concrete types work -interface A1 { a: number } ->A1 : Symbol(A1, Decl(objectSpreadUnion.ts, 0, 0)) ->a : Symbol(A1.a, Decl(objectSpreadUnion.ts, 1, 14)) - -interface A2 { a: string } ->A2 : Symbol(A2, Decl(objectSpreadUnion.ts, 1, 26)) ->a : Symbol(A2.a, Decl(objectSpreadUnion.ts, 2, 14)) - -let a12: A1 | A2; ->a12 : Symbol(a12, Decl(objectSpreadUnion.ts, 3, 3)) ->A1 : Symbol(A1, Decl(objectSpreadUnion.ts, 0, 0)) ->A2 : Symbol(A2, Decl(objectSpreadUnion.ts, 1, 26)) - -let result = { ...a12 }; ->result : Symbol(result, Decl(objectSpreadUnion.ts, 4, 3)) - -let sn: number | string = result.a; ->sn : Symbol(sn, Decl(objectSpreadUnion.ts, 5, 3)) ->result.a : Symbol(a, Decl(objectSpreadUnion.ts, 1, 14), Decl(objectSpreadUnion.ts, 2, 14)) ->result : Symbol(result, Decl(objectSpreadUnion.ts, 4, 3)) ->a : Symbol(a, Decl(objectSpreadUnion.ts, 1, 14), Decl(objectSpreadUnion.ts, 2, 14)) - -let assignable: { ...(A1 | A2) } = result; ->assignable : Symbol(assignable, Decl(objectSpreadUnion.ts, 6, 3)) ->A1 : Symbol(A1, Decl(objectSpreadUnion.ts, 0, 0)) ->A2 : Symbol(A2, Decl(objectSpreadUnion.ts, 1, 26)) ->result : Symbol(result, Decl(objectSpreadUnion.ts, 4, 3)) - -function tripleUnion(t: T, u: U, v: V): void { ->tripleUnion : Symbol(tripleUnion, Decl(objectSpreadUnion.ts, 6, 42)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 8, 21)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 8, 23)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 8, 26)) ->t : Symbol(t, Decl(objectSpreadUnion.ts, 8, 30)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 8, 21)) ->u : Symbol(u, Decl(objectSpreadUnion.ts, 8, 35)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 8, 23)) ->v : Symbol(v, Decl(objectSpreadUnion.ts, 8, 41)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 8, 26)) - - let tuv: T | U | V; ->tuv : Symbol(tuv, Decl(objectSpreadUnion.ts, 9, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 8, 21)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 8, 23)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 8, 26)) - - let result = { ...tuv, id: 'foo' }; ->result : Symbol(result, Decl(objectSpreadUnion.ts, 10, 7)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 10, 26)) - - let expected: { ...T, id: string } | { ...U, id: string } | { ...V, id: string } = result; ->expected : Symbol(expected, Decl(objectSpreadUnion.ts, 11, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 8, 21)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 11, 25)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 8, 23)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 11, 48)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 8, 26)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 11, 71)) ->result : Symbol(result, Decl(objectSpreadUnion.ts, 10, 7)) - - let assignable: { ...(T | U | V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadUnion.ts, 12, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 8, 21)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 8, 23)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 8, 26)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 12, 37)) ->result : Symbol(result, Decl(objectSpreadUnion.ts, 10, 7)) -} -function iteratedDoubleUnion(t: T, u: U, v: V): void { ->iteratedDoubleUnion : Symbol(iteratedDoubleUnion, Decl(objectSpreadUnion.ts, 13, 1)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) ->t : Symbol(t, Decl(objectSpreadUnion.ts, 14, 38)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->u : Symbol(u, Decl(objectSpreadUnion.ts, 14, 43)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->v : Symbol(v, Decl(objectSpreadUnion.ts, 14, 49)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) - - let tu: T | U; ->tu : Symbol(tu, Decl(objectSpreadUnion.ts, 15, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) - - let uv: U | V; ->uv : Symbol(uv, Decl(objectSpreadUnion.ts, 16, 7)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) - - let result = { ...tu, ...uv, id: 'bar' }; ->result : Symbol(result, Decl(objectSpreadUnion.ts, 17, 7)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 17, 32)) - - let expected: { ...T, ...U, id: string } | { ...T, ...V, id: string } | { ...U, id: string } | { ...U, ...V, id: string }; ->expected : Symbol(expected, Decl(objectSpreadUnion.ts, 18, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 18, 31)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 18, 60)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 18, 83)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 18, 112)) - - let assignable: { ...(T | U), ...(U | V), id: string } = result; ->assignable : Symbol(assignable, Decl(objectSpreadUnion.ts, 19, 7)) ->T : Symbol(T, Decl(objectSpreadUnion.ts, 14, 29)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->U : Symbol(U, Decl(objectSpreadUnion.ts, 14, 31)) ->V : Symbol(V, Decl(objectSpreadUnion.ts, 14, 34)) ->id : Symbol(id, Decl(objectSpreadUnion.ts, 19, 45)) ->result : Symbol(result, Decl(objectSpreadUnion.ts, 17, 7)) -} - - - diff --git a/tests/baselines/reference/objectSpreadUnion.types b/tests/baselines/reference/objectSpreadUnion.types deleted file mode 100644 index 20633295acb..00000000000 --- a/tests/baselines/reference/objectSpreadUnion.types +++ /dev/null @@ -1,131 +0,0 @@ -=== tests/cases/conformance/types/spread/objectSpreadUnion.ts === -// concrete types work -interface A1 { a: number } ->A1 : A1 ->a : number - -interface A2 { a: string } ->A2 : A2 ->a : string - -let a12: A1 | A2; ->a12 : A1 | A2 ->A1 : A1 ->A2 : A2 - -let result = { ...a12 }; ->result : { a: number; } | { a: string; } ->{ ...a12 } : { a: number; } | { a: string; } ->a12 : any - -let sn: number | string = result.a; ->sn : string | number ->result.a : string | number ->result : { a: number; } | { a: string; } ->a : string | number - -let assignable: { ...(A1 | A2) } = result; ->assignable : { a: number; } | { a: string; } ->A1 : A1 ->A2 : A2 ->result : { a: number; } | { a: string; } - -function tripleUnion(t: T, u: U, v: V): void { ->tripleUnion : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tuv: T | U | V; ->tuv : T | U | V ->T : T ->U : U ->V : V - - let result = { ...tuv, id: 'foo' }; ->result : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } ->{ ...tuv, id: 'foo' } : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } ->tuv : any ->id : string ->'foo' : "foo" - - let expected: { ...T, id: string } | { ...U, id: string } | { ...V, id: string } = result; ->expected : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } ->T : T ->id : string ->U : U ->id : string ->V : V ->id : string ->result : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } - - let assignable: { ...(T | U | V), id: string } = result; ->assignable : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } ->T : T ->U : U ->V : V ->id : string ->result : { ...T; id: string; } | { ...U; id: string; } | { ...V; id: string; } -} -function iteratedDoubleUnion(t: T, u: U, v: V): void { ->iteratedDoubleUnion : (t: T, u: U, v: V) => void ->T : T ->U : U ->V : V ->t : T ->T : T ->u : U ->U : U ->v : V ->V : V - - let tu: T | U; ->tu : T | U ->T : T ->U : U - - let uv: U | V; ->uv : U | V ->U : U ->V : V - - let result = { ...tu, ...uv, id: 'bar' }; ->result : { ...U; id: string; } | { ...T; ...U; id: string; } | { ...T; ...V; id: string; } | { ...U; ...V; id: string; } ->{ ...tu, ...uv, id: 'bar' } : { ...U; id: string; } | { ...T; ...U; id: string; } | { ...T; ...V; id: string; } | { ...U; ...V; id: string; } ->tu : any ->uv : any ->id : string ->'bar' : "bar" - - let expected: { ...T, ...U, id: string } | { ...T, ...V, id: string } | { ...U, id: string } | { ...U, ...V, id: string }; ->expected : { ...T; ...U; id: string; } | { ...T; ...V; id: string; } | { ...U; id: string; } | { ...U; ...V; id: string; } ->T : T ->U : U ->id : string ->T : T ->V : V ->id : string ->U : U ->id : string ->U : U ->V : V ->id : string - - let assignable: { ...(T | U), ...(U | V), id: string } = result; ->assignable : { ...U; id: string; } | { ...T; ...U; id: string; } | { ...T; ...V; id: string; } | { ...U; ...V; id: string; } ->T : T ->U : U ->U : U ->V : V ->id : string ->result : { ...U; id: string; } | { ...T; ...U; id: string; } | { ...T; ...V; id: string; } | { ...U; ...V; id: string; } -} - - - diff --git a/tests/baselines/reference/oldStyleOctalLiteralTypes.errors.txt b/tests/baselines/reference/oldStyleOctalLiteralTypes.errors.txt deleted file mode 100644 index 7d42963b05d..00000000000 --- a/tests/baselines/reference/oldStyleOctalLiteralTypes.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/compiler/oldStyleOctalLiteralTypes.ts(1,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'. -tests/cases/compiler/oldStyleOctalLiteralTypes.ts(2,8): error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'. - - -==== tests/cases/compiler/oldStyleOctalLiteralTypes.ts (2 errors) ==== - let x: 010; - ~~~ -!!! error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '0o10'. - let y: -020; - ~~~~ -!!! error TS8017: Octal literal types must use ES2015 syntax. Use the syntax '-0o20'. - \ No newline at end of file diff --git a/tests/baselines/reference/oldStyleOctalLiteralTypes.js b/tests/baselines/reference/oldStyleOctalLiteralTypes.js deleted file mode 100644 index 28b275774c3..00000000000 --- a/tests/baselines/reference/oldStyleOctalLiteralTypes.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [oldStyleOctalLiteralTypes.ts] -let x: 010; -let y: -020; - - -//// [oldStyleOctalLiteralTypes.js] -var x; -var y; diff --git a/tests/baselines/reference/parser537152.js b/tests/baselines/reference/parser537152.js deleted file mode 100644 index 0032eaf47e5..00000000000 --- a/tests/baselines/reference/parser537152.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parser537152.ts] -var t; -var y = t.e1; - - -//// [parser537152.js] -var t; -var y = t.e1; diff --git a/tests/baselines/reference/parser537152.symbols b/tests/baselines/reference/parser537152.symbols deleted file mode 100644 index 5aaaadc652a..00000000000 --- a/tests/baselines/reference/parser537152.symbols +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser537152.ts === -var t; ->t : Symbol(t, Decl(parser537152.ts, 0, 3)) - -var y = t.e1; ->y : Symbol(y, Decl(parser537152.ts, 1, 3)) ->t : Symbol(t, Decl(parser537152.ts, 0, 3)) - diff --git a/tests/baselines/reference/parser537152.types b/tests/baselines/reference/parser537152.types deleted file mode 100644 index 5c07bd6ae2d..00000000000 --- a/tests/baselines/reference/parser537152.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser537152.ts === -var t; ->t : any - -var y = t.e1; ->y : any ->t.e1 : any ->t : any ->e1 : any - diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.js b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.js deleted file mode 100644 index 87217a9c327..00000000000 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.js +++ /dev/null @@ -1,26 +0,0 @@ -//// [tests/cases/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.ts] //// - -//// [foo.ts] -export function foo() {} - -//// [bar.js] -export function bar() {} - -//// [a.ts] -import { foo } from "/foo"; -import { bar } from "/bar"; - - -//// [foo.js] -"use strict"; -exports.__esModule = true; -function foo() { } -exports.foo = foo; -//// [bar.js] -"use strict"; -exports.__esModule = true; -function bar() { } -exports.bar = bar; -//// [a.js] -"use strict"; -exports.__esModule = true; diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.symbols b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.symbols deleted file mode 100644 index 3509e873a65..00000000000 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /root/a.ts === -import { foo } from "/foo"; ->foo : Symbol(foo, Decl(a.ts, 0, 8)) - -import { bar } from "/bar"; ->bar : Symbol(bar, Decl(a.ts, 1, 8)) - -=== /root/src/foo.ts === -export function foo() {} ->foo : Symbol(foo, Decl(foo.ts, 0, 0)) - -=== /root/src/bar.js === -export function bar() {} ->bar : Symbol(bar, Decl(bar.js, 0, 0)) - diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.trace.json b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.trace.json deleted file mode 100644 index 7eaac73acb9..00000000000 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.trace.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - "======== Resolving module '/foo' from '/root/a.ts'. ========", - "Module resolution kind is not specified, using 'NodeJs'.", - "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '/foo'.", - "'paths' option is specified, looking for a pattern to match module name '/foo'.", - "Module name '/foo', matched pattern '*'.", - "Trying substitution './src/*', candidate module location: './src//foo'.", - "Loading module as file / folder, candidate module location '/root/src/foo', target file type 'TypeScript'.", - "File '/root/src/foo.ts' exist - use it as a name resolution result.", - "======== Module name '/foo' was successfully resolved to '/root/src/foo.ts'. ========", - "======== Resolving module '/bar' from '/root/a.ts'. ========", - "Module resolution kind is not specified, using 'NodeJs'.", - "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '/bar'.", - "'paths' option is specified, looking for a pattern to match module name '/bar'.", - "Module name '/bar', matched pattern '*'.", - "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'TypeScript'.", - "File '/root/src/bar.ts' does not exist.", - "File '/root/src/bar.tsx' does not exist.", - "File '/root/src/bar.d.ts' does not exist.", - "Directory '/root/src/bar' does not exist, skipping all lookups in it.", - "Loading module as file / folder, candidate module location '/bar', target file type 'TypeScript'.", - "File '/bar.ts' does not exist.", - "File '/bar.tsx' does not exist.", - "File '/bar.d.ts' does not exist.", - "Directory '/bar' does not exist, skipping all lookups in it.", - "'baseUrl' option is set to '/root', using this value to resolve non-relative module name '/bar'.", - "'paths' option is specified, looking for a pattern to match module name '/bar'.", - "Module name '/bar', matched pattern '*'.", - "Trying substitution './src/*', candidate module location: './src//bar'.", - "Loading module as file / folder, candidate module location '/root/src/bar', target file type 'JavaScript'.", - "File '/root/src/bar.js' exist - use it as a name resolution result.", - "======== Module name '/bar' was successfully resolved to '/root/src/bar.js'. ========" -] \ No newline at end of file diff --git a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.types b/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.types deleted file mode 100644 index 67c03269afe..00000000000 --- a/tests/baselines/reference/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_failedLookup.types +++ /dev/null @@ -1,15 +0,0 @@ -=== /root/a.ts === -import { foo } from "/foo"; ->foo : () => void - -import { bar } from "/bar"; ->bar : () => void - -=== /root/src/foo.ts === -export function foo() {} ->foo : () => void - -=== /root/src/bar.js === -export function bar() {} ->bar : () => void - diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 6a3d66ff920..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:../../ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 90f439ae62e..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/mapRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:../../ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 5568b3b59cc..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 146568254f8..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index ac740512f7d..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3a3cdb547f5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 0dfcd7002be..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 4ff78d4d802..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: /tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_mixed_subfolder/mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 3d3d83e8604..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index f9461bb3244..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/mapRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 672a3d34ea7..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index d75a1f63f6c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4358711b5b5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index aea9cbc53b3..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index c62d5b213f7..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/mapRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f2118484993..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e650d39612b..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 019ae2bd0aa..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/mapRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 425fd381ad6..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 94024fb5deb..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/mapRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c5eecc3b50f..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index be825d37963..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3777aaad545..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_module_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5ea98f50d2d..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5ea98f50d2d..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/mapRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 63c897e4e57..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 63c897e4e57..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/mapRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index e22b9099a6f..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index e22b9099a6f..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/mapRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_multifolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 6aabde30079..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 6aabde30079..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/mapRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 65b461791aa..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 65b461791aa..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/mapRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/m1.js.map -sourceRoot: -sources: ../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 997e0b9d7b4..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 997e0b9d7b4..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/mapRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_simple/mapFiles/test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_simple/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index f1b1b6d0916..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index f1b1b6d0916..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/mapRootAbsolutePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 00d6a44bcf5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 00d6a44bcf5..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/mapRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 35b71a7e999..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 35b71a7e999..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/mapRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_singleFile/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index d4bc9c6831c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index d4bc9c6831c..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/mapRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f166b50b856..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f166b50b856..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/mapRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d1e7478e384..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d1e7478e384..00000000000 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/mapRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: /tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=/tests/cases/projects/outputdir_subfolder/mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 757c3a44e79..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 4a0ed5bf5e3..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/mapRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 210c6a0aad0..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 2fcffbeed8b..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../mapFiles/ref/m2.js.map -sourceRoot: -sources: ../../outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 2d276f75b03..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d93d5e398e1..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/mapRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 1ad479bc3e3..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: ../../mapFiles/outAndOutDirFile.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index a593271d041..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: ../../mapFiles/outAndOutDirFile.js.map -sourceRoot: -sources: ../outputdir_mixed_subfolder/ref/m1.ts,../outputdir_mixed_subfolder/ref/m2.ts,../outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../mapFiles/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5db83dfb530..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index f0c44f724e6..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/mapRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 38204c88261..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../../../mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f6897055546..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../../../mapFiles/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 55627ab1167..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/mapRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../projects/outputdir_module_multifolder/ref/m1.ts,../projects/outputdir_module_multifolder_ref/m2.ts,../projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index f5cf250260f..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 04719a1aae2..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/mapRootRelativePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 3e9d27dcaa3..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index b6dbaeb77b1..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/mapRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index fd0ca24c30c..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/mapRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_simple/m1.ts,../outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 8e75611fa4c..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 775700c9f05..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/mapRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 9c72e15b36d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index d694c5e237b..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 1fcadcb6c3d..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/mapRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_module_subfolder/ref/m1.ts,../outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5d88f4ea1e9..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5d88f4ea1e9..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/mapRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:../../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 8864cb3a00b..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../../../mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 8864cb3a00b..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/mapRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: ../../../projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../../mapFiles/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: ../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../../../mapFiles/outputdir_multifolder/test.js.map -sourceRoot: -sources: ../../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../../mapFiles/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index b59dd72c617..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../projects/outputdir_multifolder/ref/m1.ts,../projects/outputdir_multifolder_ref/m2.ts,../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index b59dd72c617..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/mapRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../projects/outputdir_multifolder/ref/m1.ts,../projects/outputdir_multifolder_ref/m2.ts,../projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 7c35498a07a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/mapRootRelativePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 7c35498a07a..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/mapRootRelativePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 37598978973..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 37598978973..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/mapRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../mapFiles/m1.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 50d88c5b21e..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts,../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 50d88c5b21e..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/mapRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_simple/m1.ts,../outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index a283a5bc003..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index a283a5bc003..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/mapRootRelativePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ac697b960ff..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ac697b960ff..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/mapRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4960a310df0..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4960a310df0..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/mapRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index b3d5b6d2062..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index b3d5b6d2062..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/mapRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:../../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c41e06ccfe4..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c41e06ccfe4..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/mapRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: ../../../../mapFiles/ref/m1.js.map -sourceRoot: -sources: ../../outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../../mapFiles/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: ../../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=../../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 079730ccaea..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/ref/m1.ts,../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 079730ccaea..00000000000 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/mapRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: ../../mapFiles/test.js.map -sourceRoot: -sources: ../outputdir_subfolder/ref/m1.ts,../outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=../../mapFiles/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index dbfd0344358..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 442540b1d3b..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/maprootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index fe156c8ba30..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f586a84e5e6..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 364a5ead57e..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 01e66a8b573..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index a1c569ca056..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 18f7ae479e2..00000000000 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts,file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 71d04d54105..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index b30960959e0..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/maprootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 15e3b5d99f3..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 87c6c9341d1..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c6dd4570b29..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index e61a7e39edf..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/maprootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 7b3b27278b2..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/maprootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index b47d83c6920..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index bc75a6972d5..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index a571162721b..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_simple/m1.ts,file:///tests/cases/projects/outputdir_module_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_simple/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 6af7d974bc4..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 9b43f0d35d0..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/maprootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 80882be8d58..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ba8c64ade19..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 084f7eb3bf0..00000000000 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_module_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_module_subfolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index ad9f973f729..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/maprootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index ad9f973f729..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/maprootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c75dab52c24..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c75dab52c24..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3a2f01dd5e4..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3a2f01dd5e4..00000000000 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/maprootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts,file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts,file:///tests/cases/projects/outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 52784c4e840..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/maprootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 52784c4e840..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/maprootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ab1c1686d84..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ab1c1686d84..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/maprootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4bc337647db..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts,file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4bc337647db..00000000000 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/maprootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_simple/m1.ts,file:///tests/cases/projects/outputdir_simple/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_simple/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index f1c0f5ef4c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/maprootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index f1c0f5ef4c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/maprootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 62e13fc2153..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 62e13fc2153..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d731ec71ca2..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d731ec71ca2..00000000000 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/maprootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_singleFile/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_singleFile/test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 17e2a4ed7a2..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/maprootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 17e2a4ed7a2..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/maprootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c9a20be7073..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c9a20be7073..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4df5a29dcd8..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4df5a29dcd8..00000000000 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/maprootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: -sources: file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts,file:///tests/cases/projects/outputdir_subfolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:file:///tests/cases/projects/outputdir_subfolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index bc8f23fea5c..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index e5fd32b0435..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/maprootUrlsourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index bf37aa3d93e..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 9cfe0389ad8..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3f458619441..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 800d3c15dbe..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 580e372ac3b..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 68c732520a1..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: http://www.typescriptlang.org/outAndOutDirFile.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index c170dad96cc..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 21398ede2af..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/maprootUrlsourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 7b857161a31..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4b01b1f5ad6..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_module_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index dd28288d8e0..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index d3608640de2..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 8fa7e43f3d4..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/maprootUrlsourcerootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index dca2248f649..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 02c7fe0328c..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index fec4c012c2b..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 6f0d5455099..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 48628ba399b..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/maprootUrlsourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index cd2a9a86995..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 0572281f779..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index e720aaa9215..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index e470a39f235..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index e470a39f235..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/maprootUrlsourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index a1c7bf50c47..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index a1c7bf50c47..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/ref/m1.js.map=================================================================== -JsFile: m2.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder_ref/m2.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/outputdir_multifolder/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/outputdir_multifolder/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 5e3fe895b88..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 5e3fe895b88..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index b1ce5150ad1..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index b1ce5150ad1..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/maprootUrlsourcerootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 7b17d980416..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 7b17d980416..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 23ba392bf3a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 23ba392bf3a..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/maprootUrlsourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index c39a0fba501..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index c39a0fba501..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/maprootUrlsourcerootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e04f1bbe9c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e04f1bbe9c7..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 7e18311cc3d..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 7e18311cc3d..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 9391f8b0649..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 9391f8b0649..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/maprootUrlsourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c5760f4bd67..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c5760f4bd67..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: http://www.typescriptlang.org/ref/m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/ref/m1.js.map=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 86c45fec178..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 86c45fec178..00000000000 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: http://www.typescriptlang.org/test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=http://www.typescriptlang.org/test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt deleted file mode 100644 index 73cf17e69f8..00000000000 --- a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt +++ /dev/null @@ -1,124 +0,0 @@ -=================================================================== -JsFile: fileC.js -mapUrl: fileC.js.map -sourceRoot: -sources: ../../../../FolderA/FolderB/FolderC/fileC.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/FolderC/fileC.js -sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts -------------------------------------------------------------------- ->>>var C = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) ---- ->>> function C() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class C { - > -2 > } -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) ---- ->>> return C; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class C { - > } -1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) -3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileC.js.map=================================================================== -JsFile: fileB.js -mapUrl: fileB.js.map -sourceRoot: -sources: ../../../FolderA/FolderB/fileB.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/fileB.js -sourceFile:../../../FolderA/FolderB/fileB.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) ---- ->>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class B { - > public c: C; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return B; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class B { - > public c: C; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt deleted file mode 100644 index 73cf17e69f8..00000000000 --- a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt +++ /dev/null @@ -1,124 +0,0 @@ -=================================================================== -JsFile: fileC.js -mapUrl: fileC.js.map -sourceRoot: -sources: ../../../../FolderA/FolderB/FolderC/fileC.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/FolderC/fileC.js -sourceFile:../../../../FolderA/FolderB/FolderC/fileC.ts -------------------------------------------------------------------- ->>>var C = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) ---- ->>> function C() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class C { - > -2 > } -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) ---- ->>> return C; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class C { - > } -1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) -3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileC.js.map=================================================================== -JsFile: fileB.js -mapUrl: fileB.js.map -sourceRoot: -sources: ../../../FolderA/FolderB/fileB.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/fileB.js -sourceFile:../../../FolderA/FolderB/fileB.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) ---- ->>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class B { - > public c: C; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return B; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class B { - > public c: C; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.d.ts deleted file mode 100644 index 289bf129119..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -declare class B { - c: C; -} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.js deleted file mode 100644 index e3580f23910..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/FolderA/FolderB/fileB.js +++ /dev/null @@ -1,6 +0,0 @@ -/// -var B = /** @class */ (function () { - function B() { - } - return B; -}()); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.d.ts deleted file mode 100644 index 8147620b211..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare class C { -} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.js deleted file mode 100644 index 35b4a697f30..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileC.js +++ /dev/null @@ -1,5 +0,0 @@ -var C = /** @class */ (function () { - function C() { - } - return C; -}()); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.d.ts deleted file mode 100644 index 289bf129119..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -declare class B { - c: C; -} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.js deleted file mode 100644 index e3580f23910..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/FolderA/FolderB/fileB.js +++ /dev/null @@ -1,6 +0,0 @@ -/// -var B = /** @class */ (function () { - function B() { - } - return B; -}()); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.d.ts deleted file mode 100644 index 8147620b211..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare class C { -} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.js deleted file mode 100644 index 35b4a697f30..00000000000 --- a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileC.js +++ /dev/null @@ -1,5 +0,0 @@ -var C = /** @class */ (function () { - function C() { - } - return C; -}()); diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt deleted file mode 100644 index 633462db829..00000000000 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt +++ /dev/null @@ -1,124 +0,0 @@ -=================================================================== -JsFile: fileC.js -mapUrl: fileC.js.map -sourceRoot: SourceRootPath/ -sources: FolderB/FolderC/fileC.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/FolderC/fileC.js -sourceFile:FolderB/FolderC/fileC.ts -------------------------------------------------------------------- ->>>var C = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) ---- ->>> function C() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class C { - > -2 > } -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) ---- ->>> return C; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class C { - > } -1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) -3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileC.js.map=================================================================== -JsFile: fileB.js -mapUrl: fileB.js.map -sourceRoot: SourceRootPath/ -sources: FolderB/fileB.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/fileB.js -sourceFile:FolderB/fileB.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) ---- ->>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class B { - > public c: C; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return B; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class B { - > public c: C; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt deleted file mode 100644 index 633462db829..00000000000 --- a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt +++ /dev/null @@ -1,124 +0,0 @@ -=================================================================== -JsFile: fileC.js -mapUrl: fileC.js.map -sourceRoot: SourceRootPath/ -sources: FolderB/FolderC/fileC.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/FolderC/fileC.js -sourceFile:FolderB/FolderC/fileC.ts -------------------------------------------------------------------- ->>>var C = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) ---- ->>> function C() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class C { - > -2 > } -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) ---- ->>> return C; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class C { - > } -1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) -3 >Emitted(5, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(5, 6) Source(2, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileC.js.map=================================================================== -JsFile: fileB.js -mapUrl: fileB.js.map -sourceRoot: SourceRootPath/ -sources: FolderB/fileB.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/FolderB/fileB.js -sourceFile:FolderB/fileB.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) ---- ->>>var B = (function () { -1 > -2 >^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function B() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^-> -1->class B { - > public c: C; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return B; -1->^^^^ -2 > ^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class B { - > public c: C; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index bbf106066ce..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 2f8982c734b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/sourceRootAbsolutePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4850ffcc02c..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index bc0e71c54a8..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index f56fd16938c..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index b8f92c4674f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 7bf07c6a514..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 933fb217fd2..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: /tests/cases/projects/outputdir_mixed_subfolder/src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 4c90a092c72..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index ee780cef09b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/sourceRootAbsolutePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4a874b3ffde..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index fe6d3b5b4cc..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index b0755e21b7e..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_multifolder/src/ -sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 051c81cae40..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 91b3bdf8910..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/sourceRootAbsolutePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index aabfdcda958..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 8fd46afab66..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index eae02f5f5c0..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_simple/src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 8dc074fd8b7..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 31c1b28d081..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/sourceRootAbsolutePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 72c00cd5f7a..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 235470a3907..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4a0e300da47..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_module_subfolder/src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 837d9525df0..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 837d9525df0..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/sourceRootAbsolutePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index b09f90daa8f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index b09f90daa8f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index dcbb570728b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index dcbb570728b..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/sourceRootAbsolutePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_multifolder/src/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 49736d31a0f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 49736d31a0f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/sourceRootAbsolutePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 1cef37db0ad..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 1cef37db0ad..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/sourceRootAbsolutePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c9e8934ba27..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c9e8934ba27..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/sourceRootAbsolutePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_simple/src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index 5df64d65dda..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index 5df64d65dda..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/sourceRootAbsolutePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index fb45c5ce2a5..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index fb45c5ce2a5..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 70172cbcfcf..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 70172cbcfcf..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/sourceRootAbsolutePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_singleFile/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 04278e4304f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 04278e4304f..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/sourceRootAbsolutePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index eb461863ded..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index eb461863ded..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 5e0522712ed..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 5e0522712ed..00000000000 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/sourceRootAbsolutePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: /tests/cases/projects/outputdir_subfolder/src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 489e78d9fde..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index baef829e57b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/sourceRootRelativePathMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 81ab0390e62..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 2c1bc766f13..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index b38b33e3161..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 44b5904f085..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 0236ff46b03..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 31f4457f565..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index a82b4bfaabe..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index c110e9cbd87..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/sourceRootRelativePathModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 27786349283..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f21172cd798..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 6e350e166a9..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/sourceRootRelativePathModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index adef47fb19e..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 53d5f7aae84..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/sourceRootRelativePathModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 404c165ed4f..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 419535bbff4..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 8c581023df2..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/sourceRootRelativePathModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 9e9e1aad878..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 8700999ae53..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/sourceRootRelativePathModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 196de117349..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 8913576d745..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index e1c9ad562b4..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/sourceRootRelativePathModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 445dc0b3d7b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 445dc0b3d7b..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/sourceRootRelativePathMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4f66a91c563..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4f66a91c563..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/sourceRootRelativePathMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 95b3a8d15b1..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 95b3a8d15b1..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/sourceRootRelativePathMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 3257fb566ef..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 3257fb566ef..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/sourceRootRelativePathSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index bede164b9dc..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index bede164b9dc..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/sourceRootRelativePathSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 84caf2a5209..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 84caf2a5209..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/sourceRootRelativePathSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index e08628e78a5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index e08628e78a5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/sourceRootRelativePathSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ea92fb80cf5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index ea92fb80cf5..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/sourceRootRelativePathSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index a61409263fc..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index a61409263fc..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/sourceRootRelativePathSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index a986dda9056..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index a986dda9056..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/sourceRootRelativePathSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e90f9f14521..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e90f9f14521..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/sourceRootRelativePathSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: ../src/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3ef8bd4d658..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3ef8bd4d658..00000000000 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/sourceRootRelativePathSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: ../src/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index cffb2cc9397..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/sourcemapMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index d13bb52d152..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/sourcemapMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 787127afb9c..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../../ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f4599748e77..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:../../../ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c8992c0f939..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 3cdd70b7404..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/sourcemapMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 986e49e04c5..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 76d937730eb..00000000000 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: -sources: ../ref/m1.ts,../ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 9547f1b0342..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/sourcemapModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 943ec822c5b..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/sourcemapModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 36d7531c895..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 6e680ecfa65..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/sourcemapModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:../../../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../../outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:../../../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:../../../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 5b31e410aaf..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/sourcemapModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_module_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 56b251ecb62..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/sourcemapModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 412e5a18c8e..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/sourcemapModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index beebbe16454..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../../m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 8afcfe6117a..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/sourcemapModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../../m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 22) Source(1, 25) + SourceIndex(0) -6 >Emitted(2, 23) Source(1, 26) + SourceIndex(0) -7 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 2d14a8364a9..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/sourcemapModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 3a561ae023a..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/sourcemapModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 4565660454d..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/sourcemapModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4b55b597fc6..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index d0115edec0c..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/sourcemapModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 8ed04c04575..00000000000 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/sourcemapModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,368 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -3 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -4 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -5 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(24, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(24, 15) Source(3, 16) + SourceIndex(1) -3 >Emitted(24, 20) Source(5, 2) + SourceIndex(1) -4 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -3 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -4 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -5 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -6 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -7 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(29, 5) Source(8, 17) + SourceIndex(1) -2 >Emitted(29, 15) Source(8, 19) + SourceIndex(1) -3 >Emitted(29, 20) Source(10, 2) + SourceIndex(1) -4 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -3 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -4 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -5 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -6 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -7 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 10eebf86ef0..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/sourcemapMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 10eebf86ef0..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/sourcemapMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index d7d0942b868..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index d7d0942b868..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/sourcemapMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:../../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: -sources: ../../../../outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:../../../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:../../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c4c69a0ea78..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index c4c69a0ea78..00000000000 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/sourcemapMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../../outputdir_multifolder_ref/m2.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../../outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 1a11ea635c6..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/sourcemapSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 1a11ea635c6..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/sourcemapSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 66616a905f2..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 66616a905f2..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/sourcemapSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:../../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d61cb327bd4..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/sourcemapSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index d61cb327bd4..00000000000 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/sourcemapSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index a46d487d932..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/sourcemapSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index a46d487d932..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/sourcemapSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e408c9f1014..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index e408c9f1014..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/sourcemapSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index abee977af4c..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index abee977af4c..00000000000 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/sourcemapSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 13e2e393c73..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/sourcemapSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 13e2e393c73..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/sourcemapSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 661399a1d42..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 661399a1d42..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/sourcemapSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: -sources: ../../../ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:../../../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:../../test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4aec10765d4..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 4aec10765d4..00000000000 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/sourcemapSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: -sources: ../ref/m1.ts,../test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:../test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 7c7845dc4d7..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index dacb09a48ca..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/sourcerootUrlMixedSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index c5dc52b94a3..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,479 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 21a6509ddd4..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,478 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m2.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 34) Source(2, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 007af88a26a..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 507fc843895..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/sourcerootUrlMixedSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 22bd3570486..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,467 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m2.ts -------------------------------------------------------------------- ->>>define("ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1->export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1->Emitted(13, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(13, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(13, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(13, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(13, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(15, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(16, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(17, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(18, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(18, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(19, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(19, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(19, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(19, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(20, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(20, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(20, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(20, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(20, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(20, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(20, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(21, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(22, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(22, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(22, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(22, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(22, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(23, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(24, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(24, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(24, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1 > -2 >/// -1 >Emitted(26, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(26, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(27, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(27, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(28, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(28, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(28, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(28, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(28, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(28, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(29, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(30, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(31, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(31, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(32, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(32, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(33, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(33, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(33, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(33, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(34, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(34, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(34, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(34, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(34, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(34, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(34, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(34, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(35, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(36, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(36, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(36, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(36, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(36, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(37, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(37, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt deleted file mode 100644 index 1b656424d2c..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,300 +0,0 @@ -=================================================================== -JsFile: outAndOutDirFile.js -mapUrl: outAndOutDirFile.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,ref/m2.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/outAndOutDirFile.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^-> -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(12, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(12, 34) Source(2, 34) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(13, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(13, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(13, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(13, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(13, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(13, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(14, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(15, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(16, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(16, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(17, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(17, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(18, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(18, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(18, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(18, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(19, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(19, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(19, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(19, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(19, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(19, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(19, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(19, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(21, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(21, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(21, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(21, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(21, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(22, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(22, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=outAndOutDirFile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index a7a75d094b0..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 657327684ad..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/sourcerootUrlModuleMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index a3aaf686945..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,573 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1", "../outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(3, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(3, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(3, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(3, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(6, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(6, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(4, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(4, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(8, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(8, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(8, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(8, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(8, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(8, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(8, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(10, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(10, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(10, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(10, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(10, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(11, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(11, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(9, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(9, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(11, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(11, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(13, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(13, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(13, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(13, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(13, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(13, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(13, 26) + SourceIndex(0) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(16, 5) Source(14, 12) + SourceIndex(0) -2 >Emitted(16, 15) Source(14, 14) + SourceIndex(0) -3 >Emitted(16, 18) Source(14, 17) + SourceIndex(0) -4 >Emitted(16, 20) Source(14, 19) + SourceIndex(0) -5 >Emitted(16, 21) Source(14, 20) + SourceIndex(0) -6 >Emitted(16, 26) Source(14, 25) + SourceIndex(0) -7 >Emitted(16, 27) Source(14, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 5b61d42875b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/sourcerootUrlModuleMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,617 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/ref/m1.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder_ref/m2.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m2_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_c1 = m2_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m2_instance1 = new m2_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m2_f1 = m2_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_module_multifolder/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>var m2 = require("../outputdir_module_multifolder_ref/m2"); -1-> -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^ -1-> - > -2 >import -3 > m2 -4 > = require( -5 > "../outputdir_module_multifolder_ref/m2" -6 > ) -7 > ; -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(2, 8) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 21) + SourceIndex(0) -5 >Emitted(3, 58) Source(2, 61) + SourceIndex(0) -6 >Emitted(3, 59) Source(2, 62) + SourceIndex(0) -7 >Emitted(3, 60) Source(2, 63) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(4, 1) Source(3, 12) + SourceIndex(0) -2 >Emitted(4, 11) Source(3, 14) + SourceIndex(0) -3 >Emitted(4, 14) Source(3, 17) + SourceIndex(0) -4 >Emitted(4, 16) Source(3, 19) + SourceIndex(0) -5 >Emitted(4, 17) Source(3, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(8, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(9, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(9, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(9, 6) Source(6, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(10, 1) Source(4, 14) + SourceIndex(0) -2 >Emitted(10, 11) Source(4, 16) + SourceIndex(0) -3 >Emitted(10, 16) Source(6, 2) + SourceIndex(0) -4 >Emitted(10, 17) Source(6, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(11, 1) Source(8, 12) + SourceIndex(0) -2 >Emitted(11, 18) Source(8, 21) + SourceIndex(0) -3 >Emitted(11, 21) Source(8, 24) + SourceIndex(0) -4 >Emitted(11, 25) Source(8, 28) + SourceIndex(0) -5 >Emitted(11, 27) Source(8, 30) + SourceIndex(0) -6 >Emitted(11, 29) Source(8, 32) + SourceIndex(0) -7 >Emitted(11, 30) Source(8, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(13, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(13, 29) Source(10, 21) + SourceIndex(0) -5 >Emitted(13, 30) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(14, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(11, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(15, 1) Source(9, 17) + SourceIndex(0) -2 >Emitted(15, 11) Source(9, 19) + SourceIndex(0) -3 >Emitted(15, 16) Source(11, 2) + SourceIndex(0) -4 >Emitted(15, 17) Source(11, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(16, 1) Source(13, 12) + SourceIndex(0) -2 >Emitted(16, 11) Source(13, 14) + SourceIndex(0) -3 >Emitted(16, 14) Source(13, 17) + SourceIndex(0) -4 >Emitted(16, 16) Source(13, 19) + SourceIndex(0) -5 >Emitted(16, 17) Source(13, 20) + SourceIndex(0) -6 >Emitted(16, 22) Source(13, 25) + SourceIndex(0) -7 >Emitted(16, 23) Source(13, 26) + SourceIndex(0) ---- ->>>exports.a3 = m2.m2_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - >export var -2 >a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(17, 1) Source(14, 12) + SourceIndex(0) -2 >Emitted(17, 11) Source(14, 14) + SourceIndex(0) -3 >Emitted(17, 14) Source(14, 17) + SourceIndex(0) -4 >Emitted(17, 16) Source(14, 19) + SourceIndex(0) -5 >Emitted(17, 17) Source(14, 20) + SourceIndex(0) -6 >Emitted(17, 22) Source(14, 25) + SourceIndex(0) -7 >Emitted(17, 23) Source(14, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index ee3c5a5ca71..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/sourcerootUrlModuleMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,561 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_module_multifolder/ref/m1.ts,outputdir_module_multifolder_ref/m2.ts,outputdir_module_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>define("outputdir_module_multifolder/ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder_ref/m2", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m2_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m2_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(18, 5) Source(1, 12) + SourceIndex(1) -2 >Emitted(18, 18) Source(1, 17) + SourceIndex(1) -3 >Emitted(18, 21) Source(1, 20) + SourceIndex(1) -4 >Emitted(18, 23) Source(1, 22) + SourceIndex(1) -5 >Emitted(18, 24) Source(1, 23) + SourceIndex(1) ---- ->>> var m2_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(21, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(4, 1) + SourceIndex(1) -2 >Emitted(22, 21) Source(4, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(23, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(4, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_c1 = m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m2_c1 -3 > { - > public m2_c1_p1: number; - > } -4 > -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 18) Source(2, 19) + SourceIndex(1) -3 >Emitted(24, 26) Source(4, 2) + SourceIndex(1) -4 >Emitted(24, 27) Source(4, 2) + SourceIndex(1) ---- ->>> exports.m2_instance1 = new m2_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m2_instance1 -3 > = -4 > new -5 > m2_c1 -6 > () -7 > ; -1->Emitted(25, 5) Source(6, 12) + SourceIndex(1) -2 >Emitted(25, 25) Source(6, 24) + SourceIndex(1) -3 >Emitted(25, 28) Source(6, 27) + SourceIndex(1) -4 >Emitted(25, 32) Source(6, 31) + SourceIndex(1) -5 >Emitted(25, 37) Source(6, 36) + SourceIndex(1) -6 >Emitted(25, 39) Source(6, 38) + SourceIndex(1) -7 >Emitted(25, 40) Source(6, 39) + SourceIndex(1) ---- ->>> function m2_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(7, 1) + SourceIndex(1) ---- ->>> return exports.m2_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(27, 9) Source(8, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(8, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(8, 12) + SourceIndex(1) -4 >Emitted(27, 36) Source(8, 24) + SourceIndex(1) -5 >Emitted(27, 37) Source(8, 25) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(9, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(9, 2) + SourceIndex(1) ---- ->>> exports.m2_f1 = m2_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m2_f1 -3 > () { - > return m2_instance1; - > } -4 > -1->Emitted(29, 5) Source(7, 17) + SourceIndex(1) -2 >Emitted(29, 18) Source(7, 22) + SourceIndex(1) -3 >Emitted(29, 26) Source(9, 2) + SourceIndex(1) -4 >Emitted(29, 27) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_module_multifolder/test.ts -------------------------------------------------------------------- ->>>}); ->>>define("outputdir_module_multifolder/test", ["require", "exports", "outputdir_module_multifolder/ref/m1", "outputdir_module_multifolder_ref/m2"], function (require, exports, m1, m2) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >import m2 = require("../outputdir_module_multifolder_ref/m2"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(33, 5) Source(3, 12) + SourceIndex(2) -2 >Emitted(33, 15) Source(3, 14) + SourceIndex(2) -3 >Emitted(33, 18) Source(3, 17) + SourceIndex(2) -4 >Emitted(33, 20) Source(3, 19) + SourceIndex(2) -5 >Emitted(33, 21) Source(3, 20) + SourceIndex(2) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(34, 5) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(35, 9) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(36, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(36, 10) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(37, 9) Source(6, 1) + SourceIndex(2) -2 >Emitted(37, 18) Source(6, 2) + SourceIndex(2) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(38, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(38, 6) Source(6, 2) + SourceIndex(2) -3 >Emitted(38, 6) Source(4, 1) + SourceIndex(2) -4 >Emitted(38, 10) Source(6, 2) + SourceIndex(2) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(39, 5) Source(4, 14) + SourceIndex(2) -2 >Emitted(39, 15) Source(4, 16) + SourceIndex(2) -3 >Emitted(39, 20) Source(6, 2) + SourceIndex(2) -4 >Emitted(39, 21) Source(6, 2) + SourceIndex(2) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(40, 5) Source(8, 12) + SourceIndex(2) -2 >Emitted(40, 22) Source(8, 21) + SourceIndex(2) -3 >Emitted(40, 25) Source(8, 24) + SourceIndex(2) -4 >Emitted(40, 29) Source(8, 28) + SourceIndex(2) -5 >Emitted(40, 31) Source(8, 30) + SourceIndex(2) -6 >Emitted(40, 33) Source(8, 32) + SourceIndex(2) -7 >Emitted(40, 34) Source(8, 33) + SourceIndex(2) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(41, 5) Source(9, 1) + SourceIndex(2) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(42, 9) Source(10, 5) + SourceIndex(2) -2 >Emitted(42, 15) Source(10, 11) + SourceIndex(2) -3 >Emitted(42, 16) Source(10, 12) + SourceIndex(2) -4 >Emitted(42, 33) Source(10, 21) + SourceIndex(2) -5 >Emitted(42, 34) Source(10, 22) + SourceIndex(2) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(43, 5) Source(11, 1) + SourceIndex(2) -2 >Emitted(43, 6) Source(11, 2) + SourceIndex(2) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(44, 5) Source(9, 17) + SourceIndex(2) -2 >Emitted(44, 15) Source(9, 19) + SourceIndex(2) -3 >Emitted(44, 20) Source(11, 2) + SourceIndex(2) -4 >Emitted(44, 21) Source(11, 2) + SourceIndex(2) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^-> -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(45, 5) Source(13, 12) + SourceIndex(2) -2 >Emitted(45, 15) Source(13, 14) + SourceIndex(2) -3 >Emitted(45, 18) Source(13, 17) + SourceIndex(2) -4 >Emitted(45, 20) Source(13, 19) + SourceIndex(2) -5 >Emitted(45, 21) Source(13, 20) + SourceIndex(2) -6 >Emitted(45, 26) Source(13, 25) + SourceIndex(2) -7 >Emitted(45, 27) Source(13, 26) + SourceIndex(2) ---- ->>> exports.a3 = m2.m2_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - >export var -2 > a3 -3 > = -4 > m2 -5 > . -6 > m2_c1 -7 > ; -1->Emitted(46, 5) Source(14, 12) + SourceIndex(2) -2 >Emitted(46, 15) Source(14, 14) + SourceIndex(2) -3 >Emitted(46, 18) Source(14, 17) + SourceIndex(2) -4 >Emitted(46, 20) Source(14, 19) + SourceIndex(2) -5 >Emitted(46, 21) Source(14, 20) + SourceIndex(2) -6 >Emitted(46, 26) Source(14, 25) + SourceIndex(2) -7 >Emitted(46, 27) Source(14, 26) + SourceIndex(2) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 3040116f9df..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,365 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -4 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -5 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -6 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(6, 12) + SourceIndex(0) -3 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -4 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -5 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -6 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -7 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -8 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 > export function m1_f1() { - > return m1_instance1; - > } -1->Emitted(14, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class c1 { - > public p1: number; - > } -1->Emitted(9, 5) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 > export function f1() { - > return instance1; - > } -1->Emitted(14, 5) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 13) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 43f0e8169c0..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/sourcerootUrlModuleSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,371 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -4 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -5 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -6 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class m1_c1 { - > public m1_c1_p1: number; - >} -1->Emitted(8, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 9) Source(6, 12) + SourceIndex(0) -3 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -4 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -5 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -6 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -7 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -8 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function m1_f1() { - > return m1_instance1; - >} -1->Emitted(13, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >import m1 = require("m1"); -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 > - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class c1 { - > public p1: number; - >} -1->Emitted(9, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 9) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function f1() { - > return instance1; - >} -1->Emitted(14, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -9 > ^^^^^^^^^-> -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 9) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 73d7191bc56..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,365 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -4 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -5 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -6 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(6, 12) + SourceIndex(0) -3 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -4 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -5 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -6 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -7 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -8 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 > export function m1_f1() { - > return m1_instance1; - > } -1->Emitted(14, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class c1 { - > public p1: number; - > } -1->Emitted(9, 5) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 > export function f1() { - > return instance1; - > } -1->Emitted(14, 5) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 13) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index fa1fcffc859..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/sourcerootUrlModuleSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,371 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -4 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -5 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -6 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class m1_c1 { - > public m1_c1_p1: number; - >} -1->Emitted(8, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 9) Source(6, 12) + SourceIndex(0) -3 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -4 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -5 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -6 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -7 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -8 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function m1_f1() { - > return m1_instance1; - >} -1->Emitted(13, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("m1"); -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >import m1 = require("m1"); -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 24) Source(1, 27) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 > - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class c1 { - > public p1: number; - >} -1->Emitted(9, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 9) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function f1() { - > return instance1; - >} -1->Emitted(14, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -9 > ^^^^^^^^^-> -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 9) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 9a706f5a2b8..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/sourcerootUrlModuleSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,359 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>define("m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -4 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -5 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -6 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(6, 12) + SourceIndex(0) -3 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -4 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -5 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -6 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -7 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -8 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 > export function m1_f1() { - > return m1_instance1; - > } -1->Emitted(14, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >import m1 = require("m1"); - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 13) Source(2, 12) + SourceIndex(1) -3 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -4 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -5 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -6 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class c1 { - > public p1: number; - > } -1->Emitted(24, 5) Source(3, 1) + SourceIndex(1) -2 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 13) Source(7, 12) + SourceIndex(1) -3 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -4 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -5 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -6 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -7 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -8 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 > export function f1() { - > return instance1; - > } -1->Emitted(29, 5) Source(8, 1) + SourceIndex(1) -2 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 13) Source(12, 12) + SourceIndex(1) -3 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -4 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -5 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -6 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -7 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -8 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index cb3f179fd1b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,374 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 > m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -3 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -4 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -5 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(9, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(9, 18) Source(2, 19) + SourceIndex(0) -3 >Emitted(9, 26) Source(4, 2) + SourceIndex(0) -4 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -3 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -4 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -5 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -6 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -7 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -1-> -2 > m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(14, 5) Source(7, 17) + SourceIndex(0) -2 >Emitted(14, 18) Source(7, 22) + SourceIndex(0) -3 >Emitted(14, 26) Source(9, 2) + SourceIndex(0) -4 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 > c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 5) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 15) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 20) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 > instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 5) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 15) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 20) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -1-> - > - >export var -2 > a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 5073fc7ce1c..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/sourcerootUrlModuleSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,395 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 >export var -2 >m1_a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -3 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -5 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >m1_c1 -3 > { - > public m1_c1_p1: number; - > } -4 > -1->Emitted(8, 1) Source(2, 14) + SourceIndex(0) -2 >Emitted(8, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(8, 22) Source(4, 2) + SourceIndex(0) -4 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >m1_instance1 -3 > = -4 > new -5 > m1_c1 -6 > () -7 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -3 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -4 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -5 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -6 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -7 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >m1_f1 -3 > () { - > return m1_instance1; - > } -4 > -1->Emitted(13, 1) Source(7, 17) + SourceIndex(0) -2 >Emitted(13, 14) Source(7, 22) + SourceIndex(0) -3 >Emitted(13, 22) Source(9, 2) + SourceIndex(0) -4 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^ -3 > ^^ -4 > ^^^^^^^^^^^ -5 > ^^^^^^^^ -6 > ^ -7 > ^ -1 > -2 >import -3 > m1 -4 > = require( -5 > "ref/m1" -6 > ) -7 > ; -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 8) + SourceIndex(0) -3 >Emitted(2, 7) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 18) Source(1, 21) + SourceIndex(0) -5 >Emitted(2, 26) Source(1, 29) + SourceIndex(0) -6 >Emitted(2, 27) Source(1, 30) + SourceIndex(0) -7 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^-> -1 > - >export var -2 >a1 -3 > = -4 > 10 -5 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^-> -1-> -2 >c1 -3 > { - > public p1: number; - > } -4 > -1->Emitted(9, 1) Source(3, 14) + SourceIndex(0) -2 >Emitted(9, 11) Source(3, 16) + SourceIndex(0) -3 >Emitted(9, 16) Source(5, 2) + SourceIndex(0) -4 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^^^^^^^^^^ -3 > ^^^ -4 > ^^^^ -5 > ^^ -6 > ^^ -7 > ^ -1-> - > - >export var -2 >instance1 -3 > = -4 > new -5 > c1 -6 > () -7 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -3 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -5 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -6 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -7 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^ -3 > ^^^^^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 >f1 -3 > () { - > return instance1; - > } -4 > -1->Emitted(14, 1) Source(8, 17) + SourceIndex(0) -2 >Emitted(14, 11) Source(8, 19) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 2) + SourceIndex(0) -4 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^^^^^ -7 > ^ -8 > ^^^^^^^^^-> -1-> - > - >export var -2 >a2 -3 > = -4 > m1 -5 > . -6 > m1_c1 -7 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -3 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -4 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -5 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -6 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -7 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 5c24bd16a28..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,365 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define(["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -4 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -5 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -6 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(6, 12) + SourceIndex(0) -3 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -4 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -5 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -6 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -7 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -8 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 > export function m1_f1() { - > return m1_instance1; - > } -1->Emitted(14, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>define(["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 15) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 18) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 20) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 21) Source(2, 20) + SourceIndex(0) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 18) Source(5, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(5, 2) + SourceIndex(0) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class c1 { - > public p1: number; - > } -1->Emitted(9, 5) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 21) Source(5, 2) + SourceIndex(0) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 22) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 25) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 29) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 31) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 33) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 34) Source(7, 33) + SourceIndex(0) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 9) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 33) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 34) Source(9, 22) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(10, 2) + SourceIndex(0) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 > export function f1() { - > return instance1; - > } -1->Emitted(14, 5) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 21) Source(10, 2) + SourceIndex(0) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 5) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 13) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 15) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 18) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 20) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 21) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 26) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 27) Source(12, 26) + SourceIndex(0) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index f6b26376856..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/sourcerootUrlModuleSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,371 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>exports.m1_a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(1, 12) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(1, 17) + SourceIndex(0) -4 >Emitted(2, 17) Source(1, 20) + SourceIndex(0) -5 >Emitted(2, 19) Source(1, 22) + SourceIndex(0) -6 >Emitted(2, 20) Source(1, 23) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(7, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_c1 = m1_c1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class m1_c1 { - > public m1_c1_p1: number; - >} -1->Emitted(8, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(8, 23) Source(4, 2) + SourceIndex(0) ---- ->>>exports.m1_instance1 = new m1_c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(6, 12) + SourceIndex(0) -2 >Emitted(9, 9) Source(6, 12) + SourceIndex(0) -3 >Emitted(9, 21) Source(6, 24) + SourceIndex(0) -4 >Emitted(9, 24) Source(6, 27) + SourceIndex(0) -5 >Emitted(9, 28) Source(6, 31) + SourceIndex(0) -6 >Emitted(9, 33) Source(6, 36) + SourceIndex(0) -7 >Emitted(9, 35) Source(6, 38) + SourceIndex(0) -8 >Emitted(9, 36) Source(6, 39) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(11, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(11, 32) Source(8, 24) + SourceIndex(0) -5 >Emitted(11, 33) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(9, 2) + SourceIndex(0) ---- ->>>exports.m1_f1 = m1_f1; -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function m1_f1() { - > return m1_instance1; - >} -1->Emitted(13, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(13, 23) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>var m1 = require("ref/m1"); -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >import m1 = require("ref/m1"); -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 28) Source(1, 31) + SourceIndex(0) ---- ->>>exports.a1 = 10; -1 > -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 > - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(2, 12) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 11) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 14) Source(2, 17) + SourceIndex(0) -5 >Emitted(3, 16) Source(2, 19) + SourceIndex(0) -6 >Emitted(3, 17) Source(2, 20) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(5, 2) + SourceIndex(0) ---- ->>>exports.c1 = c1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 >export class c1 { - > public p1: number; - >} -1->Emitted(9, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(9, 17) Source(5, 2) + SourceIndex(0) ---- ->>>exports.instance1 = new c1(); -1-> -2 >^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(10, 1) Source(7, 12) + SourceIndex(0) -2 >Emitted(10, 9) Source(7, 12) + SourceIndex(0) -3 >Emitted(10, 18) Source(7, 21) + SourceIndex(0) -4 >Emitted(10, 21) Source(7, 24) + SourceIndex(0) -5 >Emitted(10, 25) Source(7, 28) + SourceIndex(0) -6 >Emitted(10, 27) Source(7, 30) + SourceIndex(0) -7 >Emitted(10, 29) Source(7, 32) + SourceIndex(0) -8 >Emitted(10, 30) Source(7, 33) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return exports.instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(12, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(12, 29) Source(9, 21) + SourceIndex(0) -5 >Emitted(12, 30) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(13, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(10, 2) + SourceIndex(0) ---- ->>>exports.f1 = f1; -1-> -2 >^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 >export function f1() { - > return instance1; - >} -1->Emitted(14, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 17) Source(10, 2) + SourceIndex(0) ---- ->>>exports.a2 = m1.m1_c1; -1-> -2 >^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -9 > ^^^^^^^^^-> -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(15, 1) Source(12, 12) + SourceIndex(0) -2 >Emitted(15, 9) Source(12, 12) + SourceIndex(0) -3 >Emitted(15, 11) Source(12, 14) + SourceIndex(0) -4 >Emitted(15, 14) Source(12, 17) + SourceIndex(0) -5 >Emitted(15, 16) Source(12, 19) + SourceIndex(0) -6 >Emitted(15, 17) Source(12, 20) + SourceIndex(0) -7 >Emitted(15, 22) Source(12, 25) + SourceIndex(0) -8 >Emitted(15, 23) Source(12, 26) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 8fca8ab873e..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/sourcerootUrlModuleSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,359 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>define("ref/m1", ["require", "exports"], function (require, exports) { ->>> "use strict"; ->>> exports.m1_a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >export var -2 > -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 5) Source(1, 12) + SourceIndex(0) -2 >Emitted(3, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(3, 18) Source(1, 17) + SourceIndex(0) -4 >Emitted(3, 21) Source(1, 20) + SourceIndex(0) -5 >Emitted(3, 23) Source(1, 22) + SourceIndex(0) -6 >Emitted(3, 24) Source(1, 23) + SourceIndex(0) ---- ->>> var m1_c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(5, 9) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->export class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(6, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 10) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(7, 21) Source(4, 2) + SourceIndex(0) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(8, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(4, 2) + SourceIndex(0) -3 >Emitted(8, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(8, 10) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_c1 = m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class m1_c1 { - > public m1_c1_p1: number; - > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(4, 2) + SourceIndex(0) ---- ->>> exports.m1_instance1 = new m1_c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(10, 5) Source(6, 12) + SourceIndex(0) -2 >Emitted(10, 13) Source(6, 12) + SourceIndex(0) -3 >Emitted(10, 25) Source(6, 24) + SourceIndex(0) -4 >Emitted(10, 28) Source(6, 27) + SourceIndex(0) -5 >Emitted(10, 32) Source(6, 31) + SourceIndex(0) -6 >Emitted(10, 37) Source(6, 36) + SourceIndex(0) -7 >Emitted(10, 39) Source(6, 38) + SourceIndex(0) -8 >Emitted(10, 40) Source(6, 39) + SourceIndex(0) ---- ->>> function m1_f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(11, 5) Source(7, 1) + SourceIndex(0) ---- ->>> return exports.m1_instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(12, 9) Source(8, 5) + SourceIndex(0) -2 >Emitted(12, 15) Source(8, 11) + SourceIndex(0) -3 >Emitted(12, 16) Source(8, 12) + SourceIndex(0) -4 >Emitted(12, 36) Source(8, 24) + SourceIndex(0) -5 >Emitted(12, 37) Source(8, 25) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(13, 5) Source(9, 1) + SourceIndex(0) -2 >Emitted(13, 6) Source(9, 2) + SourceIndex(0) ---- ->>> exports.m1_f1 = m1_f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 > export function m1_f1() { - > return m1_instance1; - > } -1->Emitted(14, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(14, 27) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>}); ->>>define("test", ["require", "exports", "ref/m1"], function (require, exports, m1) { ->>> "use strict"; ->>> exports.a1 = 10; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^-> -1 >import m1 = require("ref/m1"); - >export var -2 > -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(18, 5) Source(2, 12) + SourceIndex(1) -2 >Emitted(18, 13) Source(2, 12) + SourceIndex(1) -3 >Emitted(18, 15) Source(2, 14) + SourceIndex(1) -4 >Emitted(18, 18) Source(2, 17) + SourceIndex(1) -5 >Emitted(18, 20) Source(2, 19) + SourceIndex(1) -6 >Emitted(18, 21) Source(2, 20) + SourceIndex(1) ---- ->>> var c1 = (function () { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(19, 5) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^^^^^ -2 > ^^-> -1-> -1->Emitted(20, 9) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->export class c1 { - > public p1: number; - > -2 > } -1->Emitted(21, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(21, 10) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(22, 18) Source(5, 2) + SourceIndex(1) ---- ->>> }()); -1 >^^^^ -2 > ^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > export class c1 { - > public p1: number; - > } -1 >Emitted(23, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(23, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(23, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(23, 10) Source(5, 2) + SourceIndex(1) ---- ->>> exports.c1 = c1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^-> -1-> -2 > export class c1 { - > public p1: number; - > } -1->Emitted(24, 5) Source(3, 1) + SourceIndex(1) -2 >Emitted(24, 21) Source(5, 2) + SourceIndex(1) ---- ->>> exports.instance1 = new c1(); -1->^^^^ -2 > ^^^^^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - >export var -2 > -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(25, 5) Source(7, 12) + SourceIndex(1) -2 >Emitted(25, 13) Source(7, 12) + SourceIndex(1) -3 >Emitted(25, 22) Source(7, 21) + SourceIndex(1) -4 >Emitted(25, 25) Source(7, 24) + SourceIndex(1) -5 >Emitted(25, 29) Source(7, 28) + SourceIndex(1) -6 >Emitted(25, 31) Source(7, 30) + SourceIndex(1) -7 >Emitted(25, 33) Source(7, 32) + SourceIndex(1) -8 >Emitted(25, 34) Source(7, 33) + SourceIndex(1) ---- ->>> function f1() { -1 >^^^^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(26, 5) Source(8, 1) + SourceIndex(1) ---- ->>> return exports.instance1; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^ -5 > ^ -1->export function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(27, 9) Source(9, 5) + SourceIndex(1) -2 >Emitted(27, 15) Source(9, 11) + SourceIndex(1) -3 >Emitted(27, 16) Source(9, 12) + SourceIndex(1) -4 >Emitted(27, 33) Source(9, 21) + SourceIndex(1) -5 >Emitted(27, 34) Source(9, 22) + SourceIndex(1) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(28, 5) Source(10, 1) + SourceIndex(1) -2 >Emitted(28, 6) Source(10, 2) + SourceIndex(1) ---- ->>> exports.f1 = f1; -1->^^^^ -2 > ^^^^^^^^^^^^^^^^ -3 > ^^^^^^^-> -1-> -2 > export function f1() { - > return instance1; - > } -1->Emitted(29, 5) Source(8, 1) + SourceIndex(1) -2 >Emitted(29, 21) Source(10, 2) + SourceIndex(1) ---- ->>> exports.a2 = m1.m1_c1; -1->^^^^ -2 > ^^^^^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^ -8 > ^ -1-> - > - >export var -2 > -3 > a2 -4 > = -5 > m1 -6 > . -7 > m1_c1 -8 > ; -1->Emitted(30, 5) Source(12, 12) + SourceIndex(1) -2 >Emitted(30, 13) Source(12, 12) + SourceIndex(1) -3 >Emitted(30, 15) Source(12, 14) + SourceIndex(1) -4 >Emitted(30, 18) Source(12, 17) + SourceIndex(1) -5 >Emitted(30, 20) Source(12, 19) + SourceIndex(1) -6 >Emitted(30, 21) Source(12, 20) + SourceIndex(1) -7 >Emitted(30, 26) Source(12, 25) + SourceIndex(1) -8 >Emitted(30, 27) Source(12, 26) + SourceIndex(1) ---- ->>>}); ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 97837265fad..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/sourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt deleted file mode 100644 index 97837265fad..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/sourcerootUrlMultifolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:diskFile1.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 66f7557a512..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 66f7557a512..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/sourcerootUrlMultifolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,449 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/ref/m1.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: m2.js -mapUrl: m2.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder_ref/m2.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder_ref/m2.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m2.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/outputdir_multifolder/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 59) Source(2, 59) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) -4 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) -5 >Emitted(3, 12) Source(3, 12) + SourceIndex(0) -6 >Emitted(3, 13) Source(3, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(6, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 6) Source(6, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(7, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 14) Source(6, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) -3 >Emitted(8, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(8, 6) Source(6, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(9, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(8, 5) + SourceIndex(0) -3 >Emitted(9, 14) Source(8, 14) + SourceIndex(0) -4 >Emitted(9, 17) Source(8, 17) + SourceIndex(0) -5 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -6 >Emitted(9, 23) Source(8, 23) + SourceIndex(0) -7 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) -8 >Emitted(9, 26) Source(8, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(11, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 21) Source(10, 21) + SourceIndex(0) -5 >Emitted(11, 22) Source(10, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(12, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(11, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 6d3d1d19d8e..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 6d3d1d19d8e..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/sourcerootUrlMultifolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,437 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: outputdir_multifolder/ref/m1.ts,outputdir_multifolder_ref/m2.ts,outputdir_multifolder/test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder_ref/m2.ts -------------------------------------------------------------------- ->>>var m2_a1 = 10; -1-> -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1-> -2 >var -3 > m2_a1 -4 > = -5 > 10 -6 > ; -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 5) Source(1, 5) + SourceIndex(1) -3 >Emitted(11, 10) Source(1, 10) + SourceIndex(1) -4 >Emitted(11, 13) Source(1, 13) + SourceIndex(1) -5 >Emitted(11, 15) Source(1, 15) + SourceIndex(1) -6 >Emitted(11, 16) Source(1, 16) + SourceIndex(1) ---- ->>>var m2_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(12, 1) Source(2, 1) + SourceIndex(1) ---- ->>> function m2_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(13, 5) Source(2, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m2_c1 { - > public m2_c1_p1: number; - > -2 > } -1->Emitted(14, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(14, 6) Source(4, 2) + SourceIndex(1) ---- ->>> return m2_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(15, 5) Source(4, 1) + SourceIndex(1) -2 >Emitted(15, 17) Source(4, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m2_c1 { - > public m2_c1_p1: number; - > } -1 >Emitted(16, 1) Source(4, 1) + SourceIndex(1) -2 >Emitted(16, 2) Source(4, 2) + SourceIndex(1) -3 >Emitted(16, 2) Source(2, 1) + SourceIndex(1) -4 >Emitted(16, 6) Source(4, 2) + SourceIndex(1) ---- ->>>var m2_instance1 = new m2_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m2_instance1 -4 > = -5 > new -6 > m2_c1 -7 > () -8 > ; -1->Emitted(17, 1) Source(6, 1) + SourceIndex(1) -2 >Emitted(17, 5) Source(6, 5) + SourceIndex(1) -3 >Emitted(17, 17) Source(6, 17) + SourceIndex(1) -4 >Emitted(17, 20) Source(6, 20) + SourceIndex(1) -5 >Emitted(17, 24) Source(6, 24) + SourceIndex(1) -6 >Emitted(17, 29) Source(6, 29) + SourceIndex(1) -7 >Emitted(17, 31) Source(6, 31) + SourceIndex(1) -8 >Emitted(17, 32) Source(6, 32) + SourceIndex(1) ---- ->>>function m2_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(18, 1) Source(7, 1) + SourceIndex(1) ---- ->>> return m2_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m2_f1() { - > -2 > return -3 > -4 > m2_instance1 -5 > ; -1->Emitted(19, 5) Source(8, 5) + SourceIndex(1) -2 >Emitted(19, 11) Source(8, 11) + SourceIndex(1) -3 >Emitted(19, 12) Source(8, 12) + SourceIndex(1) -4 >Emitted(19, 24) Source(8, 24) + SourceIndex(1) -5 >Emitted(19, 25) Source(8, 25) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(20, 1) Source(9, 1) + SourceIndex(1) -2 >Emitted(20, 2) Source(9, 2) + SourceIndex(1) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:outputdir_multifolder/test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1-> -2 >/// -1->Emitted(21, 1) Source(1, 1) + SourceIndex(2) -2 >Emitted(21, 34) Source(1, 34) + SourceIndex(2) ---- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> - > -2 >/// -1->Emitted(22, 1) Source(2, 1) + SourceIndex(2) -2 >Emitted(22, 59) Source(2, 59) + SourceIndex(2) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(23, 1) Source(3, 1) + SourceIndex(2) -2 >Emitted(23, 5) Source(3, 5) + SourceIndex(2) -3 >Emitted(23, 7) Source(3, 7) + SourceIndex(2) -4 >Emitted(23, 10) Source(3, 10) + SourceIndex(2) -5 >Emitted(23, 12) Source(3, 12) + SourceIndex(2) -6 >Emitted(23, 13) Source(3, 13) + SourceIndex(2) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(24, 1) Source(4, 1) + SourceIndex(2) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(25, 5) Source(4, 1) + SourceIndex(2) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(26, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(26, 6) Source(6, 2) + SourceIndex(2) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(27, 5) Source(6, 1) + SourceIndex(2) -2 >Emitted(27, 14) Source(6, 2) + SourceIndex(2) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(28, 1) Source(6, 1) + SourceIndex(2) -2 >Emitted(28, 2) Source(6, 2) + SourceIndex(2) -3 >Emitted(28, 2) Source(4, 1) + SourceIndex(2) -4 >Emitted(28, 6) Source(6, 2) + SourceIndex(2) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(29, 1) Source(8, 1) + SourceIndex(2) -2 >Emitted(29, 5) Source(8, 5) + SourceIndex(2) -3 >Emitted(29, 14) Source(8, 14) + SourceIndex(2) -4 >Emitted(29, 17) Source(8, 17) + SourceIndex(2) -5 >Emitted(29, 21) Source(8, 21) + SourceIndex(2) -6 >Emitted(29, 23) Source(8, 23) + SourceIndex(2) -7 >Emitted(29, 25) Source(8, 25) + SourceIndex(2) -8 >Emitted(29, 26) Source(8, 26) + SourceIndex(2) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(30, 1) Source(9, 1) + SourceIndex(2) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(31, 5) Source(10, 5) + SourceIndex(2) -2 >Emitted(31, 11) Source(10, 11) + SourceIndex(2) -3 >Emitted(31, 12) Source(10, 12) + SourceIndex(2) -4 >Emitted(31, 21) Source(10, 21) + SourceIndex(2) -5 >Emitted(31, 22) Source(10, 22) + SourceIndex(2) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(32, 1) Source(11, 1) + SourceIndex(2) -2 >Emitted(32, 2) Source(11, 2) + SourceIndex(2) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 8613693d6fd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/sourcerootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt deleted file mode 100644 index 8613693d6fd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/sourcerootUrlSimpleNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 6b974c689f5..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 6b974c689f5..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/sourcerootUrlSimpleSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/m1.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 30) Source(1, 30) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 1b93109c406..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 1b93109c406..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/sourcerootUrlSimpleSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 30) Source(1, 30) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index 4c207cb647b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/sourcerootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt deleted file mode 100644 index 4c207cb647b..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/sourcerootUrlSingleFileNoOutdir.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 04204fceadc..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 04204fceadc..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/sourcerootUrlSingleFileSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 2f5fa2e9cbd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 2f5fa2e9cbd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/sourcerootUrlSingleFileSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,144 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 14) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 14) Source(6, 14) + SourceIndex(0) -4 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -5 >Emitted(7, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(7, 23) Source(6, 23) + SourceIndex(0) -7 >Emitted(7, 25) Source(6, 25) + SourceIndex(0) -8 >Emitted(7, 26) Source(6, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(9, 22) Source(8, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 2e2cd5bb0c9..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/sourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt deleted file mode 100644 index 2e2cd5bb0c9..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/sourcerootUrlSubfolderNoOutdir.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4ca0340ebfd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt deleted file mode 100644 index 4ca0340ebfd..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/sourcerootUrlSubfolderSpecifyOutputDirectory.sourcemap.txt +++ /dev/null @@ -1,296 +0,0 @@ -=================================================================== -JsFile: m1.js -mapUrl: m1.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/ref/m1.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=m1.js.map=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:outdir/simple/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1 > -2 >/// -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 34) Source(1, 34) + SourceIndex(0) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(3, 1) Source(3, 1) + SourceIndex(0) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(4, 5) Source(3, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(5, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(5, 2) + SourceIndex(0) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(6, 5) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 14) Source(5, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(7, 2) Source(3, 1) + SourceIndex(0) -4 >Emitted(7, 6) Source(5, 2) + SourceIndex(0) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(8, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) -3 >Emitted(8, 14) Source(7, 14) + SourceIndex(0) -4 >Emitted(8, 17) Source(7, 17) + SourceIndex(0) -5 >Emitted(8, 21) Source(7, 21) + SourceIndex(0) -6 >Emitted(8, 23) Source(7, 23) + SourceIndex(0) -7 >Emitted(8, 25) Source(7, 25) + SourceIndex(0) -8 >Emitted(8, 26) Source(7, 26) + SourceIndex(0) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(10, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(10, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(10, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(10, 21) Source(9, 21) + SourceIndex(0) -5 >Emitted(10, 22) Source(9, 22) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(11, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(10, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 14787fa8576..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt deleted file mode 100644 index 14787fa8576..00000000000 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/sourcerootUrlSubfolderSpecifyOutputFile.sourcemap.txt +++ /dev/null @@ -1,290 +0,0 @@ -=================================================================== -JsFile: test.js -mapUrl: test.js.map -sourceRoot: http://typescript.codeplex.com/ -sources: ref/m1.ts,test.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:ref/m1.ts -------------------------------------------------------------------- ->>>var m1_a1 = 10; -1 > -2 >^^^^ -3 > ^^^^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > -2 >var -3 > m1_a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) ---- ->>>var m1_c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) ---- ->>> function m1_c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> -1->class m1_c1 { - > public m1_c1_p1: number; - > -2 > } -1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) ---- ->>> return m1_c1; -1->^^^^ -2 > ^^^^^^^^^^^^ -1-> -2 > } -1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 17) Source(4, 2) + SourceIndex(0) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class m1_c1 { - > public m1_c1_p1: number; - > } -1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(6, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(6, 6) Source(4, 2) + SourceIndex(0) ---- ->>>var m1_instance1 = new m1_c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > m1_instance1 -4 > = -5 > new -6 > m1_c1 -7 > () -8 > ; -1->Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 5) Source(6, 5) + SourceIndex(0) -3 >Emitted(7, 17) Source(6, 17) + SourceIndex(0) -4 >Emitted(7, 20) Source(6, 20) + SourceIndex(0) -5 >Emitted(7, 24) Source(6, 24) + SourceIndex(0) -6 >Emitted(7, 29) Source(6, 29) + SourceIndex(0) -7 >Emitted(7, 31) Source(6, 31) + SourceIndex(0) -8 >Emitted(7, 32) Source(6, 32) + SourceIndex(0) ---- ->>>function m1_f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(8, 1) Source(7, 1) + SourceIndex(0) ---- ->>> return m1_instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^ -5 > ^ -1->function m1_f1() { - > -2 > return -3 > -4 > m1_instance1 -5 > ; -1->Emitted(9, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(9, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(9, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(9, 24) Source(8, 24) + SourceIndex(0) -5 >Emitted(9, 25) Source(8, 25) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(10, 1) Source(9, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(9, 2) + SourceIndex(0) ---- -------------------------------------------------------------------- -emittedFile:bin/test.js -sourceFile:test.ts -------------------------------------------------------------------- ->>>/// -1-> -2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1-> -2 >/// -1->Emitted(11, 1) Source(1, 1) + SourceIndex(1) -2 >Emitted(11, 34) Source(1, 34) + SourceIndex(1) ---- ->>>var a1 = 10; -1 > -2 >^^^^ -3 > ^^ -4 > ^^^ -5 > ^^ -6 > ^ -7 > ^^^^^^^^^^^^-> -1 > - > -2 >var -3 > a1 -4 > = -5 > 10 -6 > ; -1 >Emitted(12, 1) Source(2, 1) + SourceIndex(1) -2 >Emitted(12, 5) Source(2, 5) + SourceIndex(1) -3 >Emitted(12, 7) Source(2, 7) + SourceIndex(1) -4 >Emitted(12, 10) Source(2, 10) + SourceIndex(1) -5 >Emitted(12, 12) Source(2, 12) + SourceIndex(1) -6 >Emitted(12, 13) Source(2, 13) + SourceIndex(1) ---- ->>>var c1 = (function () { -1-> -2 >^^^^^^^^^^^^^^^^^^^^-> -1-> - > -1->Emitted(13, 1) Source(3, 1) + SourceIndex(1) ---- ->>> function c1() { -1->^^^^ -2 > ^^-> -1-> -1->Emitted(14, 5) Source(3, 1) + SourceIndex(1) ---- ->>> } -1->^^^^ -2 > ^ -3 > ^^^^^^^^^^-> -1->class c1 { - > public p1: number; - > -2 > } -1->Emitted(15, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(15, 6) Source(5, 2) + SourceIndex(1) ---- ->>> return c1; -1->^^^^ -2 > ^^^^^^^^^ -1-> -2 > } -1->Emitted(16, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(16, 14) Source(5, 2) + SourceIndex(1) ---- ->>>}()); -1 > -2 >^ -3 > -4 > ^^^^ -5 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 >} -3 > -4 > class c1 { - > public p1: number; - > } -1 >Emitted(17, 1) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 2) Source(5, 2) + SourceIndex(1) -3 >Emitted(17, 2) Source(3, 1) + SourceIndex(1) -4 >Emitted(17, 6) Source(5, 2) + SourceIndex(1) ---- ->>>var instance1 = new c1(); -1-> -2 >^^^^ -3 > ^^^^^^^^^ -4 > ^^^ -5 > ^^^^ -6 > ^^ -7 > ^^ -8 > ^ -1-> - > - > -2 >var -3 > instance1 -4 > = -5 > new -6 > c1 -7 > () -8 > ; -1->Emitted(18, 1) Source(7, 1) + SourceIndex(1) -2 >Emitted(18, 5) Source(7, 5) + SourceIndex(1) -3 >Emitted(18, 14) Source(7, 14) + SourceIndex(1) -4 >Emitted(18, 17) Source(7, 17) + SourceIndex(1) -5 >Emitted(18, 21) Source(7, 21) + SourceIndex(1) -6 >Emitted(18, 23) Source(7, 23) + SourceIndex(1) -7 >Emitted(18, 25) Source(7, 25) + SourceIndex(1) -8 >Emitted(18, 26) Source(7, 26) + SourceIndex(1) ---- ->>>function f1() { -1 > -2 >^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -1 >Emitted(19, 1) Source(8, 1) + SourceIndex(1) ---- ->>> return instance1; -1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ -1->function f1() { - > -2 > return -3 > -4 > instance1 -5 > ; -1->Emitted(20, 5) Source(9, 5) + SourceIndex(1) -2 >Emitted(20, 11) Source(9, 11) + SourceIndex(1) -3 >Emitted(20, 12) Source(9, 12) + SourceIndex(1) -4 >Emitted(20, 21) Source(9, 21) + SourceIndex(1) -5 >Emitted(20, 22) Source(9, 22) + SourceIndex(1) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(10, 1) + SourceIndex(1) -2 >Emitted(21, 2) Source(10, 2) + SourceIndex(1) ---- ->>>//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/tests/baselines/reference/third-output.js.map b/tests/baselines/reference/third-output.js.map deleted file mode 100644 index 744f7f7483a..00000000000 --- a/tests/baselines/reference/third-output.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../third_part1.ts","../../../../first_part1.ts","../../../../first_part2.ts","../../../../first_part3.ts","../../../../second/second_part1.ts","../../../../second/second_part2.ts"],"names":[],"mappings":"DCGD,IAAM,CAAC,GAAG,cAAc,CAAC;DAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;DCVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;DCAjB;GACI,OAAO,gBAAgB,CAAC;DAC5B,CAAC;;DCED,IAAU,CAAC,CAMV;DAND,WAAU,CAAC;GACP;OACI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;GAC3B,CAAC;GAED,CAAC,EAAE,CAAC;DACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;DCVD;GAAA;GAIA,CAAC;GAHG,uBAAW,GAAX;OACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;GACtC,CAAC;GACL,QAAC;DAAD,CAAC,AAJD,IAIC;;;ALHA,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToClassProp.js b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToClassProp.js deleted file mode 100644 index 1e316e31107..00000000000 --- a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToClassProp.js +++ /dev/null @@ -1,7 +0,0 @@ -class X { - constructor() { - // new comment! - // original comment. - this.foo = 1; - } -} diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options input is empty object.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options input is empty object.errors.txt deleted file mode 100644 index d7d6eb69300..00000000000 --- a/tests/baselines/reference/transpile/Report an error when compiler-options input is empty object.errors.txt +++ /dev/null @@ -1,6 +0,0 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015' - - -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015' -==== file.ts (0 errors) ==== - \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options input is empty string.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options input is empty string.errors.txt deleted file mode 100644 index d7d6eb69300..00000000000 --- a/tests/baselines/reference/transpile/Report an error when compiler-options input is empty string.errors.txt +++ /dev/null @@ -1,6 +0,0 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015' - - -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015' -==== file.ts (0 errors) ==== - \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictTuples.js b/tests/baselines/reference/transpile/Supports setting strictTuples.js deleted file mode 100644 index 8394371f908..00000000000 --- a/tests/baselines/reference/transpile/Supports setting strictTuples.js +++ /dev/null @@ -1,2 +0,0 @@ -x; -//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Supports setting strictTuples.oldTranspile.js b/tests/baselines/reference/transpile/Supports setting strictTuples.oldTranspile.js deleted file mode 100644 index 8394371f908..00000000000 --- a/tests/baselines/reference/transpile/Supports setting strictTuples.oldTranspile.js +++ /dev/null @@ -1,2 +0,0 @@ -x; -//# sourceMappingURL=input.js.map \ No newline at end of file diff --git a/tests/baselines/reference/untypedModuleImport_noLocalImports.errors.txt b/tests/baselines/reference/untypedModuleImport_noLocalImports.errors.txt deleted file mode 100644 index 0f376ea61ec..00000000000 --- a/tests/baselines/reference/untypedModuleImport_noLocalImports.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -/a.ts(1,22): error TS6143: Module './foo' was resolved to '/foo.js', but '--allowJs' is not set. - - -==== /a.ts (1 errors) ==== - import * as foo from "./foo"; - ~~~~~~~ -!!! error TS6143: Module './foo' was resolved to '/foo.js', but '--allowJs' is not set. - -==== /foo.js (0 errors) ==== - // This tests that untyped module imports don't happen with local imports. - - This file is not processed. - \ No newline at end of file diff --git a/tests/baselines/reference/untypedModuleImport_noLocalImports.js b/tests/baselines/reference/untypedModuleImport_noLocalImports.js deleted file mode 100644 index 6328101a2ee..00000000000 --- a/tests/baselines/reference/untypedModuleImport_noLocalImports.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [tests/cases/conformance/moduleResolution/untypedModuleImport_noLocalImports.ts] //// - -//// [foo.js] -// This tests that untyped module imports don't happen with local imports. - -This file is not processed. - -//// [a.ts] -import * as foo from "./foo"; - - -//// [a.js] -"use strict"; -exports.__esModule = true; From 0c4ceeec24f16f87e75386355c86ac38612a1175 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 08:35:36 -0800 Subject: [PATCH 023/322] Don't consider 'typeof a' as using 'a' (#28528) * Don't consider 'typeof a' as using 'a' * Also handle markPropertyAsReferenced * Use isInTypeQuery --- src/compiler/checker.ts | 4 ++-- .../unusedParameterUsedInTypeOf.errors.txt | 9 +++++++++ .../unusedPropertyUsedInTypeOf.errors.txt | 11 +++++++++++ .../reference/unusedPropertyUsedInTypeOf.js | 14 ++++++++++++++ .../reference/unusedPropertyUsedInTypeOf.symbols | 16 ++++++++++++++++ .../reference/unusedPropertyUsedInTypeOf.types | 16 ++++++++++++++++ .../cases/compiler/unusedPropertyUsedInTypeOf.ts | 7 +++++++ 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt create mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt create mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.js create mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols create mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.types create mode 100644 tests/cases/compiler/unusedPropertyUsedInTypeOf.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e88da2c261c..1ad721ad5b4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1478,7 +1478,7 @@ namespace ts { // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation!)) { result.isReferenced! |= meaning; } @@ -19022,7 +19022,7 @@ namespace ts { } function markPropertyAsReferenced(prop: Symbol, nodeForCheckWriteOnly: Node | undefined, isThisAccess: boolean) { - if (!prop || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !prop || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { return; } if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & SymbolFlags.SetAccessor && !(prop.flags & SymbolFlags.GetAccessor))) { diff --git a/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt b/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt new file mode 100644 index 00000000000..a2a30badc4a --- /dev/null +++ b/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/unusedParameterUsedInTypeOf.ts(1,14): error TS6133: 'a' is declared but its value is never read. + + +==== tests/cases/compiler/unusedParameterUsedInTypeOf.ts (1 errors) ==== + function f1 (a: number, b: typeof a) { + ~ +!!! error TS6133: 'a' is declared but its value is never read. + return b; + } \ No newline at end of file diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt b/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt new file mode 100644 index 00000000000..60657d9c8c9 --- /dev/null +++ b/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/unusedPropertyUsedInTypeOf.ts(2,29): error TS6133: 'x' is declared but its value is never read. + + +==== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts (1 errors) ==== + class C { + private static readonly x: number; + ~ +!!! error TS6133: 'x' is declared but its value is never read. + m(p: typeof C.x) { return p; } + } + \ No newline at end of file diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.js b/tests/baselines/reference/unusedPropertyUsedInTypeOf.js new file mode 100644 index 00000000000..98a1e9f0029 --- /dev/null +++ b/tests/baselines/reference/unusedPropertyUsedInTypeOf.js @@ -0,0 +1,14 @@ +//// [unusedPropertyUsedInTypeOf.ts] +class C { + private static readonly x: number; + m(p: typeof C.x) { return p; } +} + + +//// [unusedPropertyUsedInTypeOf.js] +var C = /** @class */ (function () { + function C() { + } + C.prototype.m = function (p) { return p; }; + return C; +}()); diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols b/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols new file mode 100644 index 00000000000..9715c3fa11f --- /dev/null +++ b/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts === +class C { +>C : Symbol(C, Decl(unusedPropertyUsedInTypeOf.ts, 0, 0)) + + private static readonly x: number; +>x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) + + m(p: typeof C.x) { return p; } +>m : Symbol(C.m, Decl(unusedPropertyUsedInTypeOf.ts, 1, 38)) +>p : Symbol(p, Decl(unusedPropertyUsedInTypeOf.ts, 2, 6)) +>C.x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) +>C : Symbol(C, Decl(unusedPropertyUsedInTypeOf.ts, 0, 0)) +>x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) +>p : Symbol(p, Decl(unusedPropertyUsedInTypeOf.ts, 2, 6)) +} + diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.types b/tests/baselines/reference/unusedPropertyUsedInTypeOf.types new file mode 100644 index 00000000000..12b40eb5ff6 --- /dev/null +++ b/tests/baselines/reference/unusedPropertyUsedInTypeOf.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts === +class C { +>C : C + + private static readonly x: number; +>x : number + + m(p: typeof C.x) { return p; } +>m : (p: number) => number +>p : number +>C.x : number +>C : typeof C +>x : number +>p : number +} + diff --git a/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts b/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts new file mode 100644 index 00000000000..41c685e4b06 --- /dev/null +++ b/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts @@ -0,0 +1,7 @@ +// @noUnusedLocals:true +// @noUnusedParameters:true + +class C { + private static readonly x: number; + m(p: typeof C.x) { return p; } +} From a6ef176dbb8b911f68783ac68d7ba9e6ebc654e3 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 08:58:00 -0800 Subject: [PATCH 024/322] Consistently return 'void' from ChangeTracker methods (#28563) --- src/services/textChanges.ts | 49 +++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 9c773f73f43..4689e18508c 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -228,9 +228,8 @@ namespace ts.textChanges { /** Public for tests only. Other callers should use `ChangeTracker.with`. */ constructor(private readonly newLineCharacter: string, private readonly formatContext: formatting.FormatContext) {} - public deleteRange(sourceFile: SourceFile, range: TextRange) { + public deleteRange(sourceFile: SourceFile, range: TextRange): void { this.changes.push({ kind: ChangeKind.Remove, sourceFile, range }); - return this; } delete(sourceFile: SourceFile, node: Node | NodeArray): void { @@ -241,11 +240,10 @@ namespace ts.textChanges { this.deleteRange(sourceFile, { pos: modifier.getStart(sourceFile), end: skipTrivia(sourceFile.text, modifier.end, /*stopAfterLineBreak*/ true) }); } - public deleteNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, options: ConfigurableStartEnd = {}) { + public deleteNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, options: ConfigurableStartEnd = {}): void { const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); const endPosition = getAdjustedEndPosition(sourceFile, endNode, options); this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - return this; } public deleteNodeRangeExcludingEnd(sourceFile: SourceFile, startNode: Node, afterEndNode: Node | undefined, options: ConfigurableStartEnd = {}): void { @@ -254,34 +252,32 @@ namespace ts.textChanges { this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); } - public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: InsertNodeOptions = {}) { + public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: InsertNodeOptions = {}): void { this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range, options, node: newNode }); - return this; } - public replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options: ChangeNodeOptions = useNonAdjustedPositions) { - return this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + public replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options: ChangeNodeOptions = useNonAdjustedPositions): void { + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); } - public replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options: ChangeNodeOptions = useNonAdjustedPositions) { + public replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options: ChangeNodeOptions = useNonAdjustedPositions): void { this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNode, options); } - private replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ReplaceWithMultipleNodesOptions & ConfigurableStartEnd = {}) { + private replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ReplaceWithMultipleNodesOptions & ConfigurableStartEnd = {}): void { this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile, range, options, nodes: newNodes }); - return this; } - public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeNodeOptions = useNonAdjustedPositions) { - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeNodeOptions = useNonAdjustedPositions): void { + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); } public replaceNodeWithText(sourceFile: SourceFile, oldNode: Node, text: string): void { this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, useNonAdjustedPositions), text); } - public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ReplaceWithMultipleNodesOptions & ConfigurableStartEnd = useNonAdjustedPositions) { - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ReplaceWithMultipleNodesOptions & ConfigurableStartEnd = useNonAdjustedPositions): void { + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); } private nextCommaToken(sourceFile: SourceFile, node: Node): Node | undefined { @@ -289,12 +285,12 @@ namespace ts.textChanges { return next && next.kind === SyntaxKind.CommaToken ? next : undefined; } - public replacePropertyAssignment(sourceFile: SourceFile, oldNode: PropertyAssignment, newNode: PropertyAssignment) { + public replacePropertyAssignment(sourceFile: SourceFile, oldNode: PropertyAssignment, newNode: PropertyAssignment): void { const suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ("," + this.newLineCharacter); - return this.replaceNode(sourceFile, oldNode, newNode, { suffix }); + this.replaceNode(sourceFile, oldNode, newNode, { suffix }); } - public insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}) { + public insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}): void { this.replaceRange(sourceFile, createRange(pos), newNode, options); } @@ -310,7 +306,7 @@ namespace ts.textChanges { }); } - public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, blankLineBetween = false) { + public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, blankLineBetween = false): void { this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, {}, Position.Start), newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); } @@ -343,7 +339,7 @@ namespace ts.textChanges { this.insertText(sourceFile, token.getStart(sourceFile), text); } - public insertJsdocCommentBefore(sourceFile: SourceFile, node: HasJSDoc, tag: JSDoc) { + public insertJsdocCommentBefore(sourceFile: SourceFile, node: HasJSDoc, tag: JSDoc): void { const fnStart = node.getStart(sourceFile); if (node.jsDoc) { for (const jsdoc of node.jsDoc) { @@ -358,7 +354,7 @@ namespace ts.textChanges { this.insertNodeAt(sourceFile, fnStart, tag, { preserveLeadingWhitespace: false, suffix: this.newLineCharacter + indent }); } - public replaceRangeWithText(sourceFile: SourceFile, range: TextRange, text: string) { + public replaceRangeWithText(sourceFile: SourceFile, range: TextRange, text: string): void { this.changes.push({ kind: ChangeKind.Text, sourceFile, range, text }); } @@ -500,7 +496,7 @@ namespace ts.textChanges { return endPosition; } - private getInsertNodeAfterOptions(sourceFile: SourceFile, after: Node) { + private getInsertNodeAfterOptions(sourceFile: SourceFile, after: Node): InsertNodeOptions { const options = this.getInsertNodeAfterOptionsWorker(after); return { ...options, @@ -571,14 +567,14 @@ namespace ts.textChanges { * i.e. arguments in arguments lists, parameters in parameter lists etc. * Note that separators are part of the node in statements and class elements. */ - public insertNodeInListAfter(sourceFile: SourceFile, after: Node, newNode: Node, containingList = formatting.SmartIndenter.getContainingList(after, sourceFile)) { + public insertNodeInListAfter(sourceFile: SourceFile, after: Node, newNode: Node, containingList = formatting.SmartIndenter.getContainingList(after, sourceFile)): void { if (!containingList) { Debug.fail("node is not a list element"); - return this; + return; } const index = indexOfNode(containingList, after); if (index < 0) { - return this; + return; } const end = after.getEnd(); if (index !== containingList.length - 1) { @@ -680,7 +676,6 @@ namespace ts.textChanges { this.replaceRange(sourceFile, createRange(end), newNode, { prefix: `${tokenToString(separator)} ` }); } } - return this; } private finishClassesWithNodesInsertedAtStart(): void { @@ -734,7 +729,7 @@ namespace ts.textChanges { return changes; } - public createNewFile(oldFile: SourceFile | undefined, fileName: string, statements: ReadonlyArray) { + public createNewFile(oldFile: SourceFile | undefined, fileName: string, statements: ReadonlyArray): void { this.newFiles.push({ oldFile, fileName, statements }); } } From 1089424035bc9ae6eb9188ff0dc4aa3471a091bf Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 09:30:37 -0800 Subject: [PATCH 025/322] Ensure getApplicableRefactors doesn't crash when given a position (#28361) --- src/server/session.ts | 11 ++++------- src/testRunner/unittests/tsserverProjectSystem.ts | 10 ++++++++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 7ff1364c4a0..ffc9dc75506 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1811,7 +1811,7 @@ namespace ts.server { return (locationOrSpan).line !== undefined; } - private extractPositionAndRange(args: protocol.FileLocationOrRangeRequestArgs, scriptInfo: ScriptInfo): { position: number, textRange: TextRange } { + private extractPositionOrRange(args: protocol.FileLocationOrRangeRequestArgs, scriptInfo: ScriptInfo): number | TextRange { let position: number | undefined; let textRange: TextRange | undefined; if (this.isLocation(args)) { @@ -1821,7 +1821,7 @@ namespace ts.server { const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo); textRange = { pos: startPosition, end: endPosition }; } - return { position: position!, textRange: textRange! }; // TODO: GH#18217 + return Debug.assertDefined(position === undefined ? textRange : position); function getPosition(loc: protocol.FileLocationRequestArgs) { return loc.position !== undefined ? loc.position : scriptInfo.lineOffsetToPosition(loc.line, loc.offset); @@ -1831,19 +1831,16 @@ namespace ts.server { private getApplicableRefactors(args: protocol.GetApplicableRefactorsRequestArgs): protocol.ApplicableRefactorInfo[] { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file)!; - const { position, textRange } = this.extractPositionAndRange(args, scriptInfo); - return project.getLanguageService().getApplicableRefactors(file, position || textRange, this.getPreferences(file)); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); } private getEditsForRefactor(args: protocol.GetEditsForRefactorRequestArgs, simplifiedResult: boolean): RefactorEditInfo | protocol.RefactorEditInfo { const { file, project } = this.getFileAndProject(args); const scriptInfo = project.getScriptInfoForNormalizedPath(file)!; - const { position, textRange } = this.extractPositionAndRange(args, scriptInfo); - const result = project.getLanguageService().getEditsForRefactor( file, this.getFormatOptions(file), - position || textRange, + this.extractPositionOrRange(args, scriptInfo), args.refactor, args.action, this.getPreferences(file), diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index b292ec5486c..ef01e2a740c 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -3433,7 +3433,17 @@ var x = 10;` command: protocol.CommandTypes.GetApplicableRefactors, arguments: { file: file2.path, startLine: 1, startOffset, endLine: 1, endOffset: startOffset + 1 } }); + }); + describe("getApplicableRefactors", () => { + it("works when taking position", () => { + const aTs: File = { path: "/a.ts", content: "" }; + const session = createSession(createServerHost([aTs])); + openFilesForSession([aTs], session); + const response = executeSessionRequest( + session, protocol.CommandTypes.GetApplicableRefactors, { file: aTs.path, line: 1, offset: 1 }); + assert.deepEqual | undefined>(response, []); + }); }); describe("includes deferred files in the project context", () => { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 120f3bcb5a1..910f3dce467 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8895,7 +8895,7 @@ declare namespace ts.server { private getFullNavigateToItems; private getSupportedCodeFixes; private isLocation; - private extractPositionAndRange; + private extractPositionOrRange; private getApplicableRefactors; private getEditsForRefactor; private organizeImports; From ea8ccc2ce4b0298a67ffa65b092b252e8bad312c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 16 Nov 2018 09:51:07 -0800 Subject: [PATCH 026/322] In JS, constructor functions infer from call+construct (#28353) * constructor functions infer from call+construct Also fix an incorrect combining of inferences for rest parameters: the inferred types will be arrays in the body of the function and the arguments from outside the function will be the element type. * All functions infer from call+construct contexts --- src/compiler/checker.ts | 5 ++++ src/compiler/types.ts | 1 + src/services/codefixes/inferFromUsage.ts | 10 +++---- .../codeFixInferFromUsageConstructor.ts | 27 ++++++++++++++++++ ...eFixInferFromUsageConstructorFunctionJS.ts | 28 +++++++++++++++++++ .../codeFixInferFromUsageRestParam2.ts | 2 +- 6 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/codeFixInferFromUsageConstructor.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageConstructorFunctionJS.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1ad721ad5b4..848758d5be2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -283,6 +283,7 @@ namespace ts { getNumberType: () => numberType, createPromiseType, createArrayType, + getElementTypeOfArrayType, getBooleanType: () => booleanType, getFalseType: (fresh?) => fresh ? falseType : regularFalseType, getTrueType: (fresh?) => fresh ? trueType : regularTrueType, @@ -13222,6 +13223,10 @@ namespace ts { return !!(getObjectFlags(type) & ObjectFlags.Reference) && (type).target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type: Type): Type | undefined { + return isArrayType(type) && (type as TypeReference).typeArguments ? (type as TypeReference).typeArguments![0] : undefined; + } + function isArrayLikeType(type: Type): boolean { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 897bfb00879..b4c405c3174 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3141,6 +3141,7 @@ namespace ts { /* @internal */ getNeverType(): Type; /* @internal */ getUnionType(types: Type[], subtypeReduction?: UnionReduction): Type; /* @internal */ createArrayType(elementType: Type): Type; + /* @internal */ getElementTypeOfArrayType(arrayType: Type): Type | undefined; /* @internal */ createPromiseType(type: Type): Type; /* @internal */ createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type; diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index a814e31962a..9cf5133d982 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -413,10 +413,9 @@ namespace ts.codefix { cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } - const isConstructor = declaration.kind === SyntaxKind.Constructor; - const callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - return callContexts && declaration.parameters.map((parameter, parameterIndex): ParameterInference => { - const types: Type[] = []; + const callContexts = [...usageContext.constructContexts || [], ...usageContext.callContexts || []]; + return declaration.parameters.map((parameter, parameterIndex): ParameterInference => { + const types = []; const isRest = isRestParameter(parameter); let isOptional = false; for (const callContext of callContexts) { @@ -434,7 +433,8 @@ namespace ts.codefix { } } if (isIdentifier(parameter.name)) { - types.push(...inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken)); + const inferred = inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken); + types.push(...(isRest ? mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred)); } const type = unifyFromContext(types, checker); return { diff --git a/tests/cases/fourslash/codeFixInferFromUsageConstructor.ts b/tests/cases/fourslash/codeFixInferFromUsageConstructor.ts new file mode 100644 index 00000000000..aa74fb2f6ff --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageConstructor.ts @@ -0,0 +1,27 @@ +/// +// @strictNullChecks: true + +////class TokenType { +//// label; +//// token; +//// constructor([|label, token? |]) { +//// this.label = label; +//// this.token = token || "N/A"; +//// } +////} +////new TokenType("HI"); +verify.codeFix({ + description: "Infer parameter types from usage", + index: 2, + newFileContent: + +`class TokenType { + label; + token; + constructor(label: string, token?: string | undefined ) { + this.label = label; + this.token = token || "N/A"; + } +} +new TokenType("HI");`, +}); diff --git a/tests/cases/fourslash/codeFixInferFromUsageConstructorFunctionJS.ts b/tests/cases/fourslash/codeFixInferFromUsageConstructorFunctionJS.ts new file mode 100644 index 00000000000..2177e5b8ea0 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageConstructorFunctionJS.ts @@ -0,0 +1,28 @@ +/// +// @allowJs: true +// @checkJs: true +// @noImplicitAny: true +// @Filename: test.js +////function TokenType([|label, token |]) { +//// this.label = label; +//// this.token = token || "N/A"; +////}; +////new TokenType("HI") + +verify.codeFix({ + description: "Infer parameter types from usage", + index: 0, + newFileContent: + +`/** + * @param {string} label + * @param {string} [token] + */ +function TokenType(label, token ) { + this.label = label; + this.token = token || "N/A"; +}; +new TokenType("HI")`, +}); + + diff --git a/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts b/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts index 1e0c5f7a195..0b0d0e1dfbf 100644 --- a/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts +++ b/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts @@ -9,4 +9,4 @@ ////f(3, false, "s2"); ////f(4, "s1", "s2", false, "s4"); -verify.rangeAfterCodeFix("...rest: (string | boolean)[]"); \ No newline at end of file +verify.rangeAfterCodeFix("...rest: (string | boolean)[]"); From a8c634d70db09137ce5e7ef5b77d2ff3e80cf99d Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 16 Nov 2018 10:43:15 -0800 Subject: [PATCH 027/322] Restore useText --- src/server/scriptInfo.ts | 14 +++----------- src/testRunner/unittests/textStorage.ts | 6 +++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index defc28f7495..77329099871 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -64,7 +64,8 @@ namespace ts.server { this.switchToScriptVersionCache(); } - public useText_TestOnly(newText?: string) { + /** Public for testing */ + public useText(newText?: string) { this.svc = undefined; this.text = newText; this.lineMap = undefined; @@ -90,22 +91,13 @@ namespace ts.server { // Reload always has fresh content this.pendingReloadFromDisk = false; - // We only need both this.text and this.fileSize if this.text - // is artificially empty because it was too large. - // We assume that an empty string passed to reload is not - // for a file that was too large to store. - this.fileSize = undefined; - // If text changed set the text // This also ensures that if we had switched to version cache, // we are switching back to text. // The change to version cache will happen when needed // Thus avoiding the computation if there are no changes if (this.text !== newText) { - this.text = newText; - this.version.text++; - this.svc = undefined; - this.lineMap = undefined; + this.useText(newText); // We cant guarantee new text is own file text this.ownFileText = false; return true; diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/textStorage.ts index b57d1109c7b..5dce083120b 100644 --- a/src/testRunner/unittests/textStorage.ts +++ b/src/testRunner/unittests/textStorage.ts @@ -18,7 +18,7 @@ namespace ts.textStorage { const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); ts1.useScriptVersionCache_TestOnly(); - ts2.useText_TestOnly(); + ts2.useText(); const lineMap = computeLineStarts(f.content); @@ -57,7 +57,7 @@ namespace ts.textStorage { ts1.edit(0, 5, " "); assert.isTrue(ts1.hasScriptVersionCache_TestOnly(), "have script version cache - 1"); - ts1.useText_TestOnly(); + ts1.useText(); assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 2"); ts1.getLineInfo(0); @@ -77,7 +77,7 @@ namespace ts.textStorage { // Since script info is not used in these tests, just cheat by passing undefined const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); - ts1.useText_TestOnly(f.content); + ts1.useText(f.content); assert.isFalse(ts1.hasScriptVersionCache_TestOnly()); assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); From 5c1c34a16e4326569b0708c9b11a354f7c848f7c Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 16 Nov 2018 11:00:41 -0800 Subject: [PATCH 028/322] Add telemetry test --- src/testRunner/unittests/telemetry.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/testRunner/unittests/telemetry.ts b/src/testRunner/unittests/telemetry.ts index 2eee552b38f..f2a7d854124 100644 --- a/src/testRunner/unittests/telemetry.ts +++ b/src/testRunner/unittests/telemetry.ts @@ -211,6 +211,26 @@ namespace ts.projectSystem { }, "/jsconfig.json"); }); + it("sends telemetry for file sizes", () => { + const jsFile = makeFile("/a.js", "1"); + const tsFile = makeFile("/b.ts", "12"); + const tsconfig = makeFile("/jsconfig.json", { + compilerOptions: autoJsCompilerOptions + }); + const et = new TestServerEventManager([tsconfig, jsFile, tsFile]); + et.service.openClientFile(jsFile.path); + et.assertProjectInfoTelemetryEvent({ + fileStats: fileStats({ js: 1, jsSize: 1, ts: 1, tsSize: 2 }), + compilerOptions: autoJsCompilerOptions, + typeAcquisition: { + enable: true, + include: false, + exclude: false, + }, + configFileName: "jsconfig.json", + }, "/jsconfig.json"); + }); + it("detects whether language service was disabled", () => { const file = makeFile("/a.js"); const tsconfig = makeFile("/jsconfig.json", {}); From e0dca0bd9584a3abfa872bacd4e91d79f7c1b69c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 12:47:05 -0800 Subject: [PATCH 029/322] Error when destructuring private property in a parameter (#28562) --- src/compiler/checker.ts | 10 ++++---- ...rsAreNotAccessibleDestructuring.errors.txt | 24 ++++++++++++++----- ...tedMembersAreNotAccessibleDestructuring.js | 14 +++++++---- ...mbersAreNotAccessibleDestructuring.symbols | 15 +++++++++--- ...MembersAreNotAccessibleDestructuring.types | 14 ++++++++--- ...tedMembersAreNotAccessibleDestructuring.ts | 7 ++++-- 6 files changed, 61 insertions(+), 23 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 848758d5be2..b5d0ef62cac 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19027,7 +19027,7 @@ namespace ts { } function markPropertyAsReferenced(prop: Symbol, nodeForCheckWriteOnly: Node | undefined, isThisAccess: boolean) { - if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !prop || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { return; } if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & SymbolFlags.SetAccessor && !(prop.flags & SymbolFlags.GetAccessor))) { @@ -25285,10 +25285,10 @@ namespace ts { if (!isBindingPattern(name)) { const nameText = getTextOfPropertyName(name); if (nameText) { - const property = getPropertyOfType(parentType!, nameText)!; // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === SyntaxKind.SuperKeyword, parentType!, property); + const property = getPropertyOfType(parentType!, nameText); // TODO: GH#18217 + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === SyntaxKind.SuperKeyword, parentType!, property); } } } diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.errors.txt b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.errors.txt index 40568c4fb85..9c0db527fee 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.errors.txt +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.errors.txt @@ -5,9 +5,12 @@ tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAre tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(20,5): error TS2341: Property 'priv' is private and only accessible within class 'K'. tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(20,5): error TS2341: Property 'privateMethod' is private and only accessible within class 'K'. tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(20,5): error TS2445: Property 'prot' is protected and only accessible within class 'K' and its subclasses. +tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(21,12): error TS2341: Property 'priv' is private and only accessible within class 'K'. +tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(21,12): error TS2341: Property 'privateMethod' is private and only accessible within class 'K'. +tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts(21,12): error TS2445: Property 'prot' is protected and only accessible within class 'K' and its subclasses. -==== tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts (7 errors) ==== +==== tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts (10 errors) ==== class K { private priv; protected prot; @@ -26,7 +29,7 @@ tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAre } } let k = new K(); - let { priv } = k; // error + let { priv } = k; // error ~~~~~~~~ !!! error TS2341: Property 'priv' is private and only accessible within class 'K'. let { prot } = k; // error @@ -35,11 +38,20 @@ tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAre let { privateMethod } = k; // error ~~~~~~~~~~~~~~~~~ !!! error TS2341: Property 'privateMethod' is private and only accessible within class 'K'. - let { priv: a, prot: b, privateMethod: f } = k; // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + let { priv: a, prot: b, privateMethod: pm } = k; // error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2341: Property 'priv' is private and only accessible within class 'K'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2341: Property 'privateMethod' is private and only accessible within class 'K'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2445: Property 'prot' is protected and only accessible within class 'K' and its subclasses. + function f({ priv, prot, privateMethod }: K) { + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2341: Property 'priv' is private and only accessible within class 'K'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2341: Property 'privateMethod' is private and only accessible within class 'K'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2445: Property 'prot' is protected and only accessible within class 'K' and its subclasses. + + } \ No newline at end of file diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index 57201e20761..eb45924bda7 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -15,10 +15,13 @@ class C extends K { } } let k = new K(); -let { priv } = k; // error +let { priv } = k; // error let { prot } = k; // error let { privateMethod } = k; // error -let { priv: a, prot: b, privateMethod: f } = k; // error +let { priv: a, prot: b, privateMethod: pm } = k; // error +function f({ priv, prot, privateMethod }: K) { + +} //// [privateProtectedMembersAreNotAccessibleDestructuring.js] @@ -57,7 +60,10 @@ var C = /** @class */ (function (_super) { return C; }(K)); var k = new K(); -var priv = k.priv; // error +var priv = k.priv; // error var prot = k.prot; // error var privateMethod = k.privateMethod; // error -var a = k.priv, b = k.prot, f = k.privateMethod; // error +var a = k.priv, b = k.prot, pm = k.privateMethod; // error +function f(_a) { + var priv = _a.priv, prot = _a.prot, privateMethod = _a.privateMethod; +} diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.symbols b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.symbols index 24881badb47..e346ae0b772 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.symbols +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.symbols @@ -49,7 +49,7 @@ let k = new K(); >k : Symbol(k, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 15, 3)) >K : Symbol(K, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 0, 0)) -let { priv } = k; // error +let { priv } = k; // error >priv : Symbol(priv, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 16, 5)) >k : Symbol(k, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 15, 3)) @@ -61,12 +61,21 @@ let { privateMethod } = k; // error >privateMethod : Symbol(privateMethod, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 18, 5)) >k : Symbol(k, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 15, 3)) -let { priv: a, prot: b, privateMethod: f } = k; // error +let { priv: a, prot: b, privateMethod: pm } = k; // error >priv : Symbol(K.priv, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 0, 9)) >a : Symbol(a, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 19, 5)) >prot : Symbol(K.prot, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 1, 17)) >b : Symbol(b, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 19, 14)) >privateMethod : Symbol(K.privateMethod, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 2, 19)) ->f : Symbol(f, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 19, 23)) +>pm : Symbol(pm, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 19, 23)) >k : Symbol(k, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 15, 3)) +function f({ priv, prot, privateMethod }: K) { +>f : Symbol(f, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 19, 48)) +>priv : Symbol(priv, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 20, 12)) +>prot : Symbol(prot, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 20, 18)) +>privateMethod : Symbol(privateMethod, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 20, 24)) +>K : Symbol(K, Decl(privateProtectedMembersAreNotAccessibleDestructuring.ts, 0, 0)) + +} + diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.types b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.types index 952e4327b2b..6f6803e21c1 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.types +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.types @@ -51,7 +51,7 @@ let k = new K(); >new K() : K >K : typeof K -let { priv } = k; // error +let { priv } = k; // error >priv : any >k : K @@ -63,12 +63,20 @@ let { privateMethod } = k; // error >privateMethod : () => void >k : K -let { priv: a, prot: b, privateMethod: f } = k; // error +let { priv: a, prot: b, privateMethod: pm } = k; // error >priv : any >a : any >prot : any >b : any >privateMethod : any ->f : () => void +>pm : () => void >k : K +function f({ priv, prot, privateMethod }: K) { +>f : ({ priv, prot, privateMethod }: K) => void +>priv : any +>prot : any +>privateMethod : () => void + +} + diff --git a/tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts b/tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts index 4473756d98d..5e25727d5f6 100644 --- a/tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts +++ b/tests/cases/conformance/classes/members/accessibility/privateProtectedMembersAreNotAccessibleDestructuring.ts @@ -14,7 +14,10 @@ class C extends K { } } let k = new K(); -let { priv } = k; // error +let { priv } = k; // error let { prot } = k; // error let { privateMethod } = k; // error -let { priv: a, prot: b, privateMethod: f } = k; // error +let { priv: a, prot: b, privateMethod: pm } = k; // error +function f({ priv, prot, privateMethod }: K) { + +} From b7da98b1c35d03f62859edd2651d34363de1e6ab Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 16 Nov 2018 15:59:00 -0800 Subject: [PATCH 030/322] Use intersection of member names to find largest overlap. --- src/compiler/checker.ts | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2bd831332f8..40a462e2ec6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11959,29 +11959,31 @@ namespace ts { } function findMostOverlappyType(source: Type, unionTarget: UnionOrIntersectionType) { - if (!(source.flags & (TypeFlags.Object | TypeFlags.Intersection))) { - return undefined; - } - const sourceProperties = getPropertiesOfType(source); - let bestType; - let count = -1; + let bestMatch: Type | undefined; + let matchingCount = 0; for (const target of unionTarget.types) { - if (!(target.flags & (TypeFlags.Object | TypeFlags.Intersection))) { - continue; + const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); + if (overlap.flags & TypeFlags.Index) { + // perfect overlap of keys + bestMatch = target; + matchingCount = Infinity; } - - let currentCount = 0; - for (const prop of sourceProperties) { - if (getPropertyOfType(target, prop.escapedName)) { - currentCount++; + else if (overlap.flags & TypeFlags.Union) { + // Some subset overlap if we have only string literals. + // If we have a union of index types, it seems likely that we + // needed to elaborate between two generic mapped types anyway. + const len = length((overlap as UnionType).types); + if (len >= matchingCount) { + bestMatch = target; + matchingCount = len; } } - if (currentCount >= count) { - count = currentCount; - bestType = target; + else if (!(overlap.flags & TypeFlags.Never) && 1 >= matchingCount) { + bestMatch = target; + matchingCount = 1; } } - return bestType; + return bestMatch; } // Keep this up-to-date with the same logic within `getApparentTypeOfContextualType`, since they should behave similarly From 5a4378ef1e3405723b5e8fe3164e817f7edbf62f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 16 Nov 2018 15:59:14 -0800 Subject: [PATCH 031/322] Accepted baselines. --- .../checkJsxChildrenProperty2.errors.txt | 16 ++++++++-------- tests/baselines/reference/inferTypes1.errors.txt | 4 ++-- .../intersectionWithUnionConstraint.errors.txt | 4 ++-- .../reference/keyofAndIndexedAccess.types | 2 +- .../reference/keyofAndIndexedAccessErrors.types | 2 +- .../reference/mappedTypeErrors.errors.txt | 12 ++++++------ .../reference/mappedTypeErrors2.errors.txt | 4 ++-- ...TypeWithRecursiveSubtypeReduction2.errors.txt | 13 +++---------- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt index 0edadf6dc1b..e2931b3fb5d 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt @@ -3,19 +3,19 @@ tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specif tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. - Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props + Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(number | Element)[]' is not assignable to type 'string | Element'. - Type '(number | Element)[]' is missing the following properties from type 'Element': type, props + Type '(number | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(string | Element)[]' is not assignable to type 'string | Element'. - Type '(string | Element)[]' is missing the following properties from type 'Element': type, props + Type '(string | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'string | Element'. - Type 'Element[]' is missing the following properties from type 'Element': type, props + Type 'Element[]' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (6 errors) ==== @@ -59,7 +59,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'.
My Div
{(name: string) =>
My name {name}
} ; @@ -70,7 +70,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(number | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string'.
My Div
{1000000} ; @@ -81,7 +81,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(string | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string'.
My Div
hi hi hi! ; @@ -92,7 +92,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type 'Element[]' is not assignable to type 'string'.
My Div
My Div
; \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 4684b8f5e34..cbe3eab039c 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -18,7 +18,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: E tests/cases/conformance/types/conditional/inferTypes1.ts(82,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'symbol'. + Type 'T' is not assignable to type 'string'. ==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== @@ -202,7 +202,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: type B = string extends T ? { [P in T]: void; } : T; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'symbol'. +!!! error TS2322: Type 'T' is not assignable to type 'string'. // Repro from #22302 diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt index 9bdfc6f30f9..5ed34cbe626 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt +++ b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(7,9): error TS2322: Type 'T & U' is not assignable to type 'string | number'. Type 'string | undefined' is not assignable to type 'string | number'. Type 'undefined' is not assignable to type 'string | number'. - Type 'T & U' is not assignable to type 'number'. + Type 'T & U' is not assignable to type 'string'. tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(8,9): error TS2322: Type 'T & U' is not assignable to type 'string | null'. Type 'string | undefined' is not assignable to type 'string | null'. Type 'undefined' is not assignable to type 'string | null'. @@ -32,7 +32,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12 !!! error TS2322: Type 'T & U' is not assignable to type 'string | number'. !!! error TS2322: Type 'string | undefined' is not assignable to type 'string | number'. !!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. -!!! error TS2322: Type 'T & U' is not assignable to type 'number'. +!!! error TS2322: Type 'T & U' is not assignable to type 'string'. let y2: string | null = x; // Error ~~ !!! error TS2322: Type 'T & U' is not assignable to type 'string | null'. diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 9a14549db4f..f4c47b26df0 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -58,7 +58,7 @@ type K00 = keyof any; // string >K00 : string | number | symbol type K01 = keyof string; // "toString" | "charAt" | ... ->K01 : number | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "valueOf" +>K01 : number | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "valueOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ... >K02 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index cbf56e6f671..68dc361c99e 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -23,7 +23,7 @@ type T00 = keyof K0; // Error >T00 : string | number | symbol type T01 = keyof Object; ->T01 : "toString" | "constructor" | "toLocaleString" | "valueOf" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" +>T01 : "toString" | "valueOf" | "toLocaleString" | "constructor" | "hasOwnProperty" | "isPrototypeOf" | "propertyIsEnumerable" type T02 = keyof keyof Object; >T02 : number | "length" | "toString" | "valueOf" | "charAt" | "charCodeAt" | "concat" | "indexOf" | "lastIndexOf" | "localeCompare" | "match" | "replace" | "search" | "slice" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 0ae4ebc4681..19be0493cc9 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(19,20): error TS2313: Type parameter 'P' has a circular constraint. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: Type 'Date' is not assignable to type 'string | number | symbol'. - Type 'Date' is not assignable to type 'symbol'. + Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. - Type 'Date' is not assignable to type 'symbol'. + Type 'Date' is not assignable to type 'number'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'. Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'. @@ -37,7 +37,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'symbol'. + Type 'T' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(148,17): error TS2339: Property 'foo' does not exist on type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type 'Record'. @@ -69,11 +69,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: type T02 = { [P in Date]: number }; // Error ~~~~ !!! error TS2322: Type 'Date' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'Date' is not assignable to type 'symbol'. +!!! error TS2322: Type 'Date' is not assignable to type 'number'. type T03 = Record; // Error ~~~~ !!! error TS2344: Type 'Date' does not satisfy the constraint 'string | number | symbol'. -!!! error TS2344: Type 'Date' is not assignable to type 'symbol'. +!!! error TS2344: Type 'Date' is not assignable to type 'number'. type T10 = Pick; type T11 = Pick; // Error @@ -249,7 +249,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: pt: {[P in T]?: T[P]}, // note: should be in keyof T ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'symbol'. +!!! error TS2322: Type 'T' is not assignable to type 'string'. ~~~~ !!! error TS2536: Type 'P' cannot be used to index type 'T'. }; diff --git a/tests/baselines/reference/mappedTypeErrors2.errors.txt b/tests/baselines/reference/mappedTypeErrors2.errors.txt index 9178731d189..d48db498154 100644 --- a/tests/baselines/reference/mappedTypeErrors2.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors2.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(9,30): error TS2536: T tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(13,30): error TS2536: Type 'K' cannot be used to index type 'T3'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,38): error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. - Type 'AB[S]' is not assignable to type 'symbol'. + Type 'AB[S]' is not assignable to type 'string'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2536: Type 'S' cannot be used to index type 'AB'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: Type 'L' cannot be used to index type '{ [key in AB[S]]: true; }'. @@ -31,7 +31,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: !!! error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. ~~~~~ !!! error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'AB[S]' is not assignable to type 'symbol'. +!!! error TS2322: Type 'AB[S]' is not assignable to type 'string'. ~~~~~ !!! error TS2536: Type 'S' cannot be used to index type 'AB'. diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt index 1bd7a693966..a849878087f 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt @@ -5,11 +5,7 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(19,1): error TS2 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is not assignable to type 'Property'. Types of property 'parent' are incompatible. Type 'Namespace' is not assignable to type 'Module | Class'. - Type 'Namespace' is not assignable to type 'Module'. - Types of property 'members' are incompatible. - Type '(Class | Property)[]' is not assignable to type 'Class[]'. - Type 'Class | Property' is not assignable to type 'Class'. - Type 'Property' is not assignable to type 'Class'. + Property 'parent' is missing in type 'Namespace' but required in type 'Class'. ==== tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts (2 errors) ==== @@ -43,9 +39,6 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2 !!! error TS2322: Type 'Class' is not assignable to type 'Property'. !!! error TS2322: Types of property 'parent' are incompatible. !!! error TS2322: Type 'Namespace' is not assignable to type 'Module | Class'. -!!! error TS2322: Type 'Namespace' is not assignable to type 'Module'. -!!! error TS2322: Types of property 'members' are incompatible. -!!! error TS2322: Type '(Class | Property)[]' is not assignable to type 'Class[]'. -!!! error TS2322: Type 'Class | Property' is not assignable to type 'Class'. -!!! error TS2322: Type 'Property' is not assignable to type 'Class'. +!!! error TS2322: Property 'parent' is missing in type 'Namespace' but required in type 'Class'. +!!! related TS2728 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts:10:12: 'parent' is declared here. \ No newline at end of file From 12f3d0d54c8dbdd0ffe996561c8da6f9370fd3d9 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 16:02:23 -0800 Subject: [PATCH 032/322] Enable --strictPropertyInitialization (#27558) * Enable --strictPropertyInitialization * Code review --- src/harness/client.ts | 4 +- src/harness/fakes.ts | 2 +- src/harness/fourslash.ts | 8 +- src/harness/harnessLanguageService.ts | 6 +- src/harness/typeWriter.ts | 2 +- src/harness/virtualFileSystemWithWatch.ts | 2 +- src/server/editorServices.ts | 6 +- src/server/project.ts | 40 ++--- src/server/scriptInfo.ts | 8 +- src/server/scriptVersionCache.ts | 6 +- src/server/session.ts | 2 +- src/services/formatting/formattingContext.ts | 26 ++- src/services/services.ts | 150 +++++++++--------- src/services/shims.ts | 16 +- src/services/types.ts | 2 +- src/testRunner/compilerRunner.ts | 2 +- src/testRunner/fourslashRunner.ts | 2 + src/testRunner/parallel/host.ts | 4 +- src/testRunner/projectsRunner.ts | 2 +- .../unittests/reuseProgramStructure.ts | 2 +- src/testRunner/unittests/session.ts | 6 +- .../unittests/tsserverProjectSystem.ts | 24 +-- src/tsconfig-base.json | 1 + src/tsserver/server.ts | 6 +- .../reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 26 files changed, 168 insertions(+), 165 deletions(-) diff --git a/src/harness/client.ts b/src/harness/client.ts index 2035802ca67..27365e3ecf1 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -37,7 +37,7 @@ namespace ts.server { private sequence = 0; private lineMaps: Map = createMap(); private messages: string[] = []; - private lastRenameEntry: RenameEntry; + private lastRenameEntry: RenameEntry | undefined; constructor(private host: SessionClientHost) { } @@ -431,7 +431,7 @@ namespace ts.server { this.getRenameInfo(fileName, position, findInStrings, findInComments); } - return this.lastRenameEntry.locations; + return this.lastRenameEntry!.locations; } private decodeNavigationBarItems(items: protocol.NavigationBarItem[] | undefined, fileName: string, lineMap: number[]): NavigationBarItem[] { diff --git a/src/harness/fakes.ts b/src/harness/fakes.ts index bd9d62f90e5..d25211d36d3 100644 --- a/src/harness/fakes.ts +++ b/src/harness/fakes.ts @@ -215,7 +215,7 @@ namespace fakes { private _setParentNodes: boolean; private _sourceFiles: collections.SortedMap; - private _parseConfigHost: ParseConfigHost; + private _parseConfigHost: ParseConfigHost | undefined; private _newLine: string; constructor(sys: System | vfs.FileSystem, options = ts.getDefaultCompilerOptions(), setParentNodes = false) { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 6cd24358556..34fedccc19c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -158,7 +158,7 @@ namespace FourSlash { public lastKnownMarker = ""; // The file that's currently 'opened' - public activeFile: FourSlashFile; + public activeFile!: FourSlashFile; // Whether or not we should format on keystrokes public enableFormatting = true; @@ -855,9 +855,9 @@ namespace FourSlash { } /** Use `getProgram` instead of accessing this directly. */ - private _program: ts.Program; + private _program: ts.Program | undefined; /** Use `getChecker` instead of accessing this directly. */ - private _checker: ts.TypeChecker; + private _checker: ts.TypeChecker | undefined; private getProgram(): ts.Program { return this._program || (this._program = this.languageService.getProgram()!); // TODO: GH#18217 @@ -3734,7 +3734,7 @@ namespace FourSlashInterface { } export class VerifyNegatable { - public not: VerifyNegatable; + public not: VerifyNegatable | undefined; constructor(protected state: FourSlash.TestState, private negative = false) { if (!negative) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index ccad290aed7..581d5cc045d 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -289,8 +289,8 @@ namespace Harness.LanguageService { class ShimLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceShimHost, ts.CoreServicesShimHost { private nativeHost: NativeLanguageServiceHost; - public getModuleResolutionsForFile: (fileName: string) => string; - public getTypeReferenceDirectiveResolutionsForFile: (fileName: string) => string; + public getModuleResolutionsForFile: ((fileName: string) => string) | undefined; + public getTypeReferenceDirectiveResolutionsForFile: ((fileName: string) => string) | undefined; constructor(preprocessToResolve: boolean, cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) { super(cancellationToken, options); @@ -639,7 +639,7 @@ namespace Harness.LanguageService { // Server adapter class SessionClientHost extends NativeLanguageServiceHost implements ts.server.SessionClientHost { - private client: ts.server.SessionClient; + private client!: ts.server.SessionClient; constructor(cancellationToken: ts.HostCancellationToken | undefined, settings: ts.CompilerOptions | undefined) { super(cancellationToken, settings); diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 67f79a1a1a3..b0b20c92e64 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -21,7 +21,7 @@ interface TypeWriterResult { } class TypeWriterWalker { - currentSourceFile: ts.SourceFile; + currentSourceFile!: ts.SourceFile; private checker: ts.TypeChecker; diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 9b030e212f1..e82ee36f8fe 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -341,7 +341,7 @@ interface Array {}` private readonly currentDirectory: string; private readonly dynamicPriorityWatchFile: HostWatchFile | undefined; private readonly customRecursiveWatchDirectory: HostWatchDirectory | undefined; - public require: (initialPath: string, moduleName: string) => server.RequireResult; + public require: ((initialPath: string, moduleName: string) => server.RequireResult) | undefined; constructor(public withSafeList: boolean, public useCaseSensitiveFileNames: boolean, executingFilePath: string, currentDirectory: string, fileOrFolderorSymLinkList: ReadonlyArray, public readonly newLine = "\n", public readonly useWindowsStylePath?: boolean, private readonly environmentVariables?: Map) { this.getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 23baa9119bf..90b516dadfc 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -479,7 +479,7 @@ namespace ts.server { */ private readonly openFilesWithNonRootedDiskPath = createMap(); - private compilerOptionsForInferredProjects: CompilerOptions; + private compilerOptionsForInferredProjects: CompilerOptions | undefined; private compilerOptionsForInferredProjectsPerProjectRoot = createMap(); /** * Project size for configured or external projects @@ -501,7 +501,7 @@ namespace ts.server { private pendingProjectUpdates = createMap(); /* @internal */ - pendingEnsureProjectForOpenFiles: boolean; + pendingEnsureProjectForOpenFiles = false; readonly currentDirectory: NormalizedPath; readonly toCanonicalFileName: (f: string) => string; @@ -1936,7 +1936,7 @@ namespace ts.server { } private createInferredProject(currentDirectory: string | undefined, isSingleInferredProject?: boolean, projectRootPath?: NormalizedPath): InferredProject { - const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects!; // TODO: GH#18217 const project = new InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath, currentDirectory, this.currentPluginConfigOverrides); if (isSingleInferredProject) { this.inferredProjects.unshift(project); diff --git a/src/server/project.ts b/src/server/project.ts index 45d932abc3e..fa39aa4abe9 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -112,9 +112,9 @@ namespace ts.server { export abstract class Project implements LanguageServiceHost, ModuleResolutionHost { private rootFiles: ScriptInfo[] = []; private rootFilesMap: Map = createMap(); - private program: Program; - private externalFiles: SortedReadonlyArray; - private missingFilesMap: Map; + private program: Program | undefined; + private externalFiles: SortedReadonlyArray | undefined; + private missingFilesMap: Map | undefined; private plugins: PluginModuleWithName[] = []; /*@internal*/ @@ -141,7 +141,7 @@ namespace ts.server { readonly realpath?: (path: string) => string; /*@internal*/ - hasInvalidatedResolution: HasInvalidatedResolution; + hasInvalidatedResolution: HasInvalidatedResolution | undefined; /*@internal*/ resolutionCache: ResolutionCache; @@ -154,7 +154,7 @@ namespace ts.server { /** * Set of files that was returned from the last call to getChangesSinceVersion. */ - private lastReportedFileNames: Map; + private lastReportedFileNames: Map | undefined; /** * Last version that was reported. */ @@ -512,8 +512,8 @@ namespace ts.server { return []; } updateProjectIfDirty(this); - this.builderState = BuilderState.create(this.program, this.projectService.toCanonicalFileName, this.builderState); - return mapDefined(BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, data => this.projectService.host.createHash!(data)), // TODO: GH#18217 + this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState); + return mapDefined(BuilderState.getFilesAffectedBy(this.builderState, this.program!, scriptInfo.path, this.cancellationToken, data => this.projectService.host.createHash!(data)), // TODO: GH#18217 sourceFile => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)!) ? sourceFile.fileName : undefined); } @@ -594,7 +594,7 @@ namespace ts.server { /* @internal */ getSourceFileOrConfigFile(path: Path): SourceFile | undefined { - const options = this.program.getCompilerOptions(); + const options = this.program!.getCompilerOptions(); return path === options.configFilePath ? options.configFile : this.getSourceFile(path); } @@ -681,7 +681,7 @@ namespace ts.server { // if language service is not enabled - return just root files return this.rootFiles; } - return map(this.program.getSourceFiles(), sourceFile => { + return map(this.program!.getSourceFiles(), sourceFile => { const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath); Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`); return scriptInfo!; @@ -749,7 +749,7 @@ namespace ts.server { } containsScriptInfo(info: ScriptInfo): boolean { - return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); + return this.isRoot(info) || (!!this.program && this.program.getSourceFileByPath(info.path) !== undefined); } containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean { @@ -845,7 +845,7 @@ namespace ts.server { // (can reuse cached imports for files that were not changed) // 4. compilation settings were changed in the way that might affect module resolution - drop all caches and collect all data from the scratch if (hasNewProgram || changedFiles.length) { - this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program, this.cachedUnresolvedImportsPerFile); + this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program!, this.cachedUnresolvedImportsPerFile); } this.projectService.typingsCache.enqueueInstallTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasAddedorRemovedFiles); @@ -872,7 +872,7 @@ namespace ts.server { } /* @internal */ - getCurrentProgram() { + getCurrentProgram(): Program | undefined { return this.program; } @@ -911,7 +911,7 @@ namespace ts.server { } oldProgram.forEachResolvedProjectReference((resolvedProjectReference, resolvedProjectReferencePath) => { - if (resolvedProjectReference && !this.program.getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { + if (resolvedProjectReference && !this.program!.getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { this.detachScriptInfoFromProject(resolvedProjectReference.sourceFile.fileName); } }); @@ -967,8 +967,8 @@ namespace ts.server { this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind); } - if (eventKind === FileWatcherEventKind.Created && this.missingFilesMap.has(missingFilePath)) { - this.missingFilesMap.delete(missingFilePath); + if (eventKind === FileWatcherEventKind.Created && this.missingFilesMap!.has(missingFilePath)) { + this.missingFilesMap!.delete(missingFilePath); fileWatcher.close(); // When a missing file is created, we should update the graph. @@ -983,7 +983,7 @@ namespace ts.server { } private isWatchedMissingFile(path: Path) { - return this.missingFilesMap && this.missingFilesMap.has(path); + return !!this.missingFilesMap && this.missingFilesMap.has(path); } getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined { @@ -1344,14 +1344,14 @@ namespace ts.server { * Otherwise it will create an InferredProject. */ export class ConfiguredProject extends Project { - private typeAcquisition: TypeAcquisition; + private typeAcquisition!: TypeAcquisition; // TODO: GH#18217 /* @internal */ configFileWatcher: FileWatcher | undefined; private directoriesWatchedForWildcards: Map | undefined; readonly canonicalConfigFilePath: NormalizedPath; /* @internal */ - pendingReload: ConfigFileProgramReloadLevel; + pendingReload: ConfigFileProgramReloadLevel | undefined; /* @internal */ pendingReloadReason: string | undefined; @@ -1359,7 +1359,7 @@ namespace ts.server { configFileSpecs: ConfigFileSpecs | undefined; /*@internal*/ - canConfigFileJsonReportNoInputFiles: boolean; + canConfigFileJsonReportNoInputFiles = false; /** Ref count to the project when opened from external project */ private externalProjectRefCount = 0; @@ -1590,7 +1590,7 @@ namespace ts.server { */ export class ExternalProject extends Project { excludedFiles: ReadonlyArray = []; - private typeAcquisition: TypeAcquisition; + private typeAcquisition!: TypeAcquisition; // TODO: GH#18217 /*@internal*/ constructor(public externalProjectName: string, projectService: ProjectService, diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 77329099871..c090b4b14d0 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -36,15 +36,15 @@ namespace ts.server { /** * True if the text is for the file thats open in the editor */ - public isOpen: boolean; + public isOpen = false; /** * True if the text present is the text from the file on the disk */ - private ownFileText: boolean; + private ownFileText = false; /** * True when reloading contents of file from the disk is pending */ - private pendingReloadFromDisk: boolean; + private pendingReloadFromDisk = false; constructor(private readonly host: ServerHost, private readonly fileName: NormalizedPath, initialVersion: ScriptInfoVersion | undefined, private readonly info: ScriptInfo) { this.version = initialVersion || { svc: 0, text: 0 }; @@ -279,7 +279,7 @@ namespace ts.server { private realpath: Path | undefined; /*@internal*/ - cacheSourceFile: DocumentRegistrySourceFileCache; + cacheSourceFile: DocumentRegistrySourceFileCache | undefined; /*@internal*/ mTime?: number; diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index 0ffb3a195ad..a350ed99f71 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -41,11 +41,11 @@ namespace ts.server { // path to start of range private readonly startPath: LineCollection[]; private readonly endBranch: LineCollection[] = []; - private branchNode: LineNode; + private branchNode: LineNode | undefined; // path to current node private readonly stack: LineNode[]; private state = CharRangeSection.Entire; - private lineCollectionAtBranch: LineCollection; + private lineCollectionAtBranch: LineCollection | undefined; private initialText = ""; private trailingText = ""; @@ -383,7 +383,7 @@ namespace ts.server { } export class LineIndex { - root: LineNode; + root!: LineNode; // set this to true to check each edit for accuracy checkEdits = false; diff --git a/src/server/session.ts b/src/server/session.ts index ffc9dc75506..0b9ad913f8a 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -516,7 +516,7 @@ namespace ts.server { protected projectService: ProjectService; private changeSeq = 0; - private currentRequestId: number; + private currentRequestId!: number; private errorCheck: MultistepOperation; protected host: ServerHost; diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 0ccf87680fe..e5a1ff5d4ac 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -10,11 +10,11 @@ namespace ts.formatting { } export class FormattingContext { - public currentTokenSpan: TextRangeWithKind; - public nextTokenSpan: TextRangeWithKind; - public contextNode: Node; - public currentTokenParent: Node; - public nextTokenParent: Node; + public currentTokenSpan!: TextRangeWithKind; + public nextTokenSpan!: TextRangeWithKind; + public contextNode!: Node; + public currentTokenParent!: Node; + public nextTokenParent!: Node; private contextNodeAllOnSameLine: boolean | undefined; private nextNodeAllOnSameLine: boolean | undefined; @@ -26,17 +26,11 @@ namespace ts.formatting { } public updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node) { - Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - Debug.assert(commonParent !== undefined, "commonParent is null"); - - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; + this.currentTokenSpan = Debug.assertDefined(currentRange); + this.currentTokenParent = Debug.assertDefined(currentTokenParent); + this.nextTokenSpan = Debug.assertDefined(nextRange); + this.nextTokenParent = Debug.assertDefined(nextTokenParent); + this.contextNode = Debug.assertDefined(commonParent); // drop cached results this.contextNodeAllOnSameLine = undefined; diff --git a/src/services/services.ts b/src/services/services.ts index 2abfe7095ec..20400a3ec47 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -17,9 +17,9 @@ namespace ts { public end: number; public flags: NodeFlags; public parent: Node; - public symbol: Symbol; - public jsDoc: JSDoc[]; - public original: Node; + public symbol!: Symbol; // Actually optional, but it was too annoying to access `node.symbol!` everywhere since in many cases we know it must be defined + public jsDoc?: JSDoc[]; + public original?: Node; public transformFlags: TransformFlags; private _children: Node[] | undefined; @@ -196,14 +196,14 @@ namespace ts { } class TokenOrIdentifierObject implements Node { - public kind: SyntaxKind; + public kind!: SyntaxKind; public pos: number; public end: number; public flags: NodeFlags; public parent: Node; - public symbol: Symbol; - public jsDocComments: JSDoc[]; - public transformFlags: TransformFlags; + public symbol!: Symbol; + public jsDocComments?: JSDoc[]; + public transformFlags!: TransformFlags; constructor(pos: number, end: number) { // Set properties in same order as NodeObject @@ -280,8 +280,8 @@ namespace ts { class SymbolObject implements Symbol { flags: SymbolFlags; escapedName: __String; - declarations: Declaration[]; - valueDeclaration: Declaration; + declarations!: Declaration[]; + valueDeclaration!: Declaration; // Undefined is used to indicate the value has not been computed. If, after computing, the // symbol has no doc comment, then the empty array will be returned. @@ -334,7 +334,7 @@ namespace ts { } class TokenObject extends TokenOrIdentifierObject implements Token { - public symbol: Symbol; + public symbol!: Symbol; public kind: TKind; constructor(kind: TKind, pos: number, end: number) { @@ -344,10 +344,10 @@ namespace ts { } class IdentifierObject extends TokenOrIdentifierObject implements Identifier { - public kind: SyntaxKind.Identifier; - public escapedText: __String; - public symbol: Symbol; - public autoGenerateFlags: GeneratedIdentifierFlags; + public kind!: SyntaxKind.Identifier; + public escapedText!: __String; + public symbol!: Symbol; + public autoGenerateFlags!: GeneratedIdentifierFlags; _primaryExpressionBrand: any; _memberExpressionBrand: any; _leftHandSideExpressionBrand: any; @@ -355,7 +355,7 @@ namespace ts { _unaryExpressionBrand: any; _expressionBrand: any; _declarationBrand: any; - /*@internal*/typeArguments: NodeArray; + /*@internal*/typeArguments!: NodeArray; constructor(_kind: SyntaxKind.Identifier, pos: number, end: number) { super(pos, end); } @@ -370,8 +370,8 @@ namespace ts { checker: TypeChecker; flags: TypeFlags; objectFlags?: ObjectFlags; - id: number; - symbol: Symbol; + id!: number; + symbol!: Symbol; constructor(checker: TypeChecker, flags: TypeFlags) { this.checker = checker; this.flags = flags; @@ -447,16 +447,16 @@ namespace ts { class SignatureObject implements Signature { checker: TypeChecker; - declaration: SignatureDeclaration; + declaration!: SignatureDeclaration; typeParameters?: TypeParameter[]; - parameters: Symbol[]; - thisParameter: Symbol; - resolvedReturnType: Type; + parameters!: Symbol[]; + thisParameter!: Symbol; + resolvedReturnType!: Type; resolvedTypePredicate: TypePredicate | undefined; - minTypeArgumentCount: number; - minArgumentCount: number; - hasRestParameter: boolean; - hasLiteralTypes: boolean; + minTypeArgumentCount!: number; + minArgumentCount!: number; + hasRestParameter!: boolean; + hasLiteralTypes!: boolean; // Undefined is used to indicate the value has not been computed. If, after computing, the // symbol has no doc comment, then the empty array will be returned. @@ -536,55 +536,55 @@ namespace ts { } class SourceFileObject extends NodeObject implements SourceFile { - public kind: SyntaxKind.SourceFile; + public kind!: SyntaxKind.SourceFile; public _declarationBrand: any; - public fileName: string; - public path: Path; - public resolvedPath: Path; - public originalFileName: string; - public text: string; - public scriptSnapshot: IScriptSnapshot; - public lineMap: ReadonlyArray; + public fileName!: string; + public path!: Path; + public resolvedPath!: Path; + public originalFileName!: string; + public text!: string; + public scriptSnapshot!: IScriptSnapshot; + public lineMap!: ReadonlyArray; - public statements: NodeArray; - public endOfFileToken: Token; + public statements!: NodeArray; + public endOfFileToken!: Token; - public amdDependencies: { name: string; path: string }[]; - public moduleName: string; - public referencedFiles: FileReference[]; - public typeReferenceDirectives: FileReference[]; - public libReferenceDirectives: FileReference[]; + public amdDependencies!: { name: string; path: string }[]; + public moduleName!: string; + public referencedFiles!: FileReference[]; + public typeReferenceDirectives!: FileReference[]; + public libReferenceDirectives!: FileReference[]; - public syntacticDiagnostics: DiagnosticWithLocation[]; - public parseDiagnostics: DiagnosticWithLocation[]; - public bindDiagnostics: DiagnosticWithLocation[]; + public syntacticDiagnostics!: DiagnosticWithLocation[]; + public parseDiagnostics!: DiagnosticWithLocation[]; + public bindDiagnostics!: DiagnosticWithLocation[]; public bindSuggestionDiagnostics?: DiagnosticWithLocation[]; - public isDeclarationFile: boolean; - public isDefaultLib: boolean; - public hasNoDefaultLib: boolean; - public externalModuleIndicator: Node; // The first node that causes this file to be an external module - public commonJsModuleIndicator: Node; // The first node that causes this file to be a CommonJS module - public nodeCount: number; - public identifierCount: number; - public symbolCount: number; - public version: string; - public scriptKind: ScriptKind; - public languageVersion: ScriptTarget; - public languageVariant: LanguageVariant; - public identifiers: Map; - public nameTable: UnderscoreEscapedMap; - public resolvedModules: Map; - public resolvedTypeReferenceDirectiveNames: Map; - public imports: ReadonlyArray; - public moduleAugmentations: StringLiteral[]; - private namedDeclarations: Map; - public ambientModuleNames: string[]; + public isDeclarationFile!: boolean; + public isDefaultLib!: boolean; + public hasNoDefaultLib!: boolean; + public externalModuleIndicator!: Node; // The first node that causes this file to be an external module + public commonJsModuleIndicator!: Node; // The first node that causes this file to be a CommonJS module + public nodeCount!: number; + public identifierCount!: number; + public symbolCount!: number; + public version!: string; + public scriptKind!: ScriptKind; + public languageVersion!: ScriptTarget; + public languageVariant!: LanguageVariant; + public identifiers!: Map; + public nameTable: UnderscoreEscapedMap | undefined; + public resolvedModules: Map | undefined; + public resolvedTypeReferenceDirectiveNames!: Map; + public imports!: ReadonlyArray; + public moduleAugmentations!: StringLiteral[]; + private namedDeclarations: Map | undefined; + public ambientModuleNames!: string[]; public checkJsDirective: CheckJsDirective | undefined; - public possiblyContainDynamicImport: boolean; - public pragmas: PragmaMap; - public localJsxFactory: EntityName; - public localJsxNamespace: __String; + public possiblyContainDynamicImport?: boolean; + public pragmas!: PragmaMap; + public localJsxFactory: EntityName | undefined; + public localJsxNamespace: __String | undefined; constructor(kind: SyntaxKind, pos: number, end: number) { super(kind, pos, end); @@ -774,7 +774,7 @@ namespace ts { } class SourceMapSourceObject implements SourceMapSource { - lineMap: number[]; + lineMap!: number[]; constructor(public fileName: string, public text: string, public skipTrivia?: (pos: number) => number) { } public getLineAndCharacterOfPosition(pos: number): LineAndCharacter { @@ -955,10 +955,10 @@ namespace ts { class SyntaxTreeCache { // For our syntactic only features, we also keep a cache of the syntax tree for the // currently edited file. - private currentFileName: string; - private currentFileVersion: string; - private currentFileScriptSnapshot: IScriptSnapshot; - private currentSourceFile: SourceFile; + private currentFileName: string | undefined; + private currentFileVersion: string | undefined; + private currentFileScriptSnapshot: IScriptSnapshot | undefined; + private currentSourceFile: SourceFile | undefined; constructor(private host: LanguageServiceHost) { } @@ -980,8 +980,8 @@ namespace ts { } else if (this.currentFileVersion !== version) { // This is the same file, just a newer version. Incrementally parse the file. - const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); + const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot!); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile!, scriptSnapshot, version, editRange); } if (sourceFile) { @@ -992,7 +992,7 @@ namespace ts { this.currentSourceFile = sourceFile; } - return this.currentSourceFile; + return this.currentSourceFile!; } } diff --git a/src/services/shims.ts b/src/services/shims.ts index 3ee11817c49..ff66680bdbc 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -331,9 +331,9 @@ namespace ts { private loggingEnabled = false; private tracingEnabled = false; - public resolveModuleNames: (moduleName: string[], containingFile: string) => (ResolvedModuleFull | undefined)[]; - public resolveTypeReferenceDirectives: (typeDirectiveNames: string[], containingFile: string) => (ResolvedTypeReferenceDirective | undefined)[]; - public directoryExists: (directoryName: string) => boolean; + public resolveModuleNames: ((moduleName: string[], containingFile: string) => (ResolvedModuleFull | undefined)[]) | undefined; + public resolveTypeReferenceDirectives: ((typeDirectiveNames: string[], containingFile: string) => (ResolvedTypeReferenceDirective | undefined)[]) | undefined; + public directoryExists: ((directoryName: string) => boolean) | undefined; constructor(private shimHost: LanguageServiceShimHost) { // if shimHost is a COM object then property check will become method call with no arguments. @@ -490,13 +490,19 @@ namespace ts { public useCaseSensitiveFileNames: boolean; constructor(private shimHost: CoreServicesShimHost) { - this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; + this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; if ("directoryExists" in this.shimHost) { this.directoryExists = directoryName => this.shimHost.directoryExists(directoryName); } + else { + this.directoryExists = undefined!; // TODO: GH#18217 + } if ("realpath" in this.shimHost) { this.realpath = path => this.shimHost.realpath!(path); // TODO: GH#18217 } + else { + this.realpath = undefined!; // TODO: GH#18217 + } } public readDirectory(rootDir: string, extensions: ReadonlyArray, exclude: ReadonlyArray, include: ReadonlyArray, depth?: number): string[] { @@ -1182,7 +1188,7 @@ namespace ts { export class TypeScriptServicesFactory implements ShimFactory { private _shims: Shim[] = []; - private documentRegistry: DocumentRegistry; + private documentRegistry: DocumentRegistry | undefined; /* * Returns script API version. diff --git a/src/services/types.ts b/src/services/types.ts index 0d14ad2b978..69f07b705a7 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -489,7 +489,7 @@ namespace ts { position: number; } - export class TextChange { + export interface TextChange { span: TextSpan; newText: string; } diff --git a/src/testRunner/compilerRunner.ts b/src/testRunner/compilerRunner.ts index bb481eca03e..c55cd1aa511 100644 --- a/src/testRunner/compilerRunner.ts +++ b/src/testRunner/compilerRunner.ts @@ -13,7 +13,7 @@ class CompilerBaselineRunner extends RunnerBase { private testSuiteName: TestRunnerKind; private emit: boolean; - public options: string; + public options: string | undefined; constructor(public testType: CompilerTestType) { super(); diff --git a/src/testRunner/fourslashRunner.ts b/src/testRunner/fourslashRunner.ts index 583311ba30e..f7d7bf621d5 100644 --- a/src/testRunner/fourslashRunner.ts +++ b/src/testRunner/fourslashRunner.ts @@ -21,6 +21,8 @@ class FourSlashRunner extends RunnerBase { this.basePath = "tests/cases/fourslash/server"; this.testSuiteName = "fourslash-server"; break; + default: + throw ts.Debug.assertNever(testType); } } diff --git a/src/testRunner/parallel/host.ts b/src/testRunner/parallel/host.ts index c10be2a9ff8..376896a4697 100644 --- a/src/testRunner/parallel/host.ts +++ b/src/testRunner/parallel/host.ts @@ -28,9 +28,9 @@ namespace Harness.Parallel.Host { let totalCost = 0; class RemoteSuite extends Mocha.Suite { - suites: RemoteSuite[]; + suites!: RemoteSuite[]; suiteMap = ts.createMap(); - tests: RemoteTest[]; + tests!: RemoteTest[]; constructor(title: string) { super(title); this.pending = false; diff --git a/src/testRunner/projectsRunner.ts b/src/testRunner/projectsRunner.ts index 457201c1387..f4e51afab4c 100644 --- a/src/testRunner/projectsRunner.ts +++ b/src/testRunner/projectsRunner.ts @@ -67,7 +67,7 @@ namespace project { class ProjectCompilerHost extends fakes.CompilerHost { private _testCase: ProjectRunnerTestCase & ts.CompilerOptions; - private _projectParseConfigHost: ProjectParseConfigHost; + private _projectParseConfigHost: ProjectParseConfigHost | undefined; constructor(sys: fakes.System | vfs.FileSystem, compilerOptions: ts.CompilerOptions, _testCaseJustName: string, testCase: ProjectRunnerTestCase & ts.CompilerOptions, _moduleKind: ts.ModuleKind) { super(sys, compilerOptions); diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index 0ab50a65105..9e56b48a911 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -27,7 +27,7 @@ namespace ts { } export class SourceText implements IScriptSnapshot { - private fullText: string; + private fullText: string | undefined; constructor(private references: string, private importsAndExports: string, diff --git a/src/testRunner/unittests/session.ts b/src/testRunner/unittests/session.ts index ac5d8093e31..bcbadac1d52 100644 --- a/src/testRunner/unittests/session.ts +++ b/src/testRunner/unittests/session.ts @@ -437,7 +437,7 @@ namespace ts.server { const command = "testhandler"; class TestSession extends Session { - lastSent: protocol.Message; + lastSent: protocol.Message | undefined; private exceptionRaisingHandler(_request: protocol.Request): { response?: any, responseRequired: boolean } { f1(); return Debug.fail(); // unreachable, throw to make compiler happy @@ -491,7 +491,7 @@ namespace ts.server { describe("how Session is extendable via subclassing", () => { class TestSession extends Session { - lastSent: protocol.Message; + lastSent: protocol.Message | undefined; customHandler = "testhandler"; constructor() { super({ @@ -610,7 +610,7 @@ namespace ts.server { } class InProcClient { - private server: InProcSession; + private server: InProcSession | undefined; private seq = 0; private callbacks: ((resp: protocol.Response) => void)[] = []; private eventHandlers = createMap<(args: any) => void>(); diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index cda60e9b5ff..6681b4bfa54 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -80,7 +80,7 @@ namespace ts.projectSystem { } export class TestTypingsInstaller extends TI.TypingsInstaller implements server.ITypingsInstaller { - protected projectService: server.ProjectService; + protected projectService!: server.ProjectService; constructor( readonly globalTypingsCacheLocation: string, throttleLimit: number, @@ -282,7 +282,7 @@ namespace ts.projectSystem { class TestSession extends server.Session { private seq = 0; public events: protocol.Event[] = []; - public host: TestServerHost; + public host!: TestServerHost; getProjectService() { return this.projectService; @@ -9396,16 +9396,16 @@ export const x = 10;` const project = getProject(service); const moduleInfo = service.getScriptInfo(moduleFile.path)!; - const sourceFile = moduleInfo.cacheSourceFile.sourceFile; + const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); // edit file changeFileToNotImportModule(service); - assert.equal(moduleInfo.cacheSourceFile.sourceFile, sourceFile); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); // write content back changeFileToImportModule(service); - assert.equal(moduleInfo.cacheSourceFile.sourceFile, sourceFile); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); }); @@ -9414,21 +9414,21 @@ export const x = 10;` const project = getProject(service); const moduleInfo = service.getScriptInfo(moduleFile.path)!; - const sourceFile = moduleInfo.cacheSourceFile.sourceFile; + const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); // edit file changeFileToNotImportModule(service); - assert.equal(moduleInfo.cacheSourceFile.sourceFile, sourceFile); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); const updatedModuleContent = moduleFile.content + "\nexport const b: number;"; host.writeFile(moduleFile.path, updatedModuleContent); // write content back changeFileToImportModule(service); - assert.notEqual(moduleInfo.cacheSourceFile.sourceFile, sourceFile); - assert.equal(project.getSourceFile(moduleInfo.path), moduleInfo.cacheSourceFile.sourceFile); - assert.equal(moduleInfo.cacheSourceFile.sourceFile.text, updatedModuleContent); + assert.notEqual(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); + assert.equal(project.getSourceFile(moduleInfo.path), moduleInfo.cacheSourceFile!.sourceFile); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile.text, updatedModuleContent); }); }); @@ -9457,7 +9457,7 @@ export const x = 10;` // large file for non ts file should be empty and for ts file should have content const service = session.getProjectService(); const info = service.getScriptInfo(largeFile.path)!; - assert.equal(info.cacheSourceFile.sourceFile.text, useLargeTsFile ? largeFile.content : ""); + assert.equal(info.cacheSourceFile!.sourceFile.text, useLargeTsFile ? largeFile.content : ""); assert.deepEqual(largeFileReferencedEvents, useLargeTsFile ? emptyArray : [{ eventName: server.LargeFileReferencedEvent, @@ -10970,7 +10970,7 @@ fn5();` function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray): void { openFilesForSession([file], session); const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false)); - const program = project.getCurrentProgram(); + const program = project.getCurrentProgram()!; const output = getFileEmitOutput(program, Debug.assertDefined(program.getSourceFile(file.path)), /*emitOnlyDtsFiles*/ true); closeFilesForSession([file], session); diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index a6df4100d9f..e9925f3a98b 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -14,6 +14,7 @@ "strictNullChecks": true, "noImplicitAny": true, "noImplicitThis": true, + "strictPropertyInitialization": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 8a5c5b50906..66574ceaac1 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -215,13 +215,13 @@ namespace ts.server { } class NodeTypingsInstaller implements ITypingsInstaller { - private installer: NodeChildProcess; - private projectService: ProjectService; + private installer!: NodeChildProcess; + private projectService!: ProjectService; private activeRequestCount = 0; private requestQueue: QueuedOperation[] = []; private requestMap = createMap(); // Maps operation ID to newest requestQueue entry with that ID /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */ - private requestedRegistry: boolean; + private requestedRegistry = false; private typesRegistryCache: Map> | undefined; // This number is essentially arbitrary. Processing more than one typings request diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c3076883b46..4aa83c7209c 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4869,7 +4869,7 @@ declare namespace ts { message: string; position: number; } - class TextChange { + interface TextChange { span: TextSpan; newText: string; } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index f4cebf2da7f..0702b175fb5 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4869,7 +4869,7 @@ declare namespace ts { message: string; position: number; } - class TextChange { + interface TextChange { span: TextSpan; newText: string; } From cd08a22ef59289d23ed6eaf1f3fd3f33809bcf6d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 16 Nov 2018 16:05:07 -0800 Subject: [PATCH 033/322] Clamp calculated sourcemap positions rather than throwing (#28583) * Clamp calculated sourcemap positions rather than throwing, to allow the underlying file to drift out of date with the sourcemap without a crash * Clamp line as well --- src/compiler/scanner.ts | 21 ++++++++++-- src/compiler/sourcemap.ts | 4 +-- .../server/declarationMapsOutOfDateMapping.ts | 32 +++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/server/declarationMapsOutOfDateMapping.ts diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index b8d4d248077..9eedfeefb53 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -342,12 +342,29 @@ namespace ts { } /* @internal */ - export function computePositionOfLineAndCharacter(lineStarts: ReadonlyArray, line: number, character: number, debugText?: string): number { + export function getPositionOfLineAndCharacterWithEdits(sourceFile: SourceFileLike, line: number, character: number): number { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + + /* @internal */ + export function computePositionOfLineAndCharacter(lineStarts: ReadonlyArray, line: number, character: number, debugText?: string, allowEdits?: true): number { if (line < 0 || line >= lineStarts.length) { - Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== undefined ? arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"}`); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== undefined ? arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"}`); + } } const res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { Debug.assert(res < lineStarts[line + 1]); } diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 76cf24e51dc..9b74fb22d58 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -608,7 +608,7 @@ namespace ts { function processMapping(mapping: Mapping): MappedPosition { const generatedPosition = generatedFile !== undefined - ? getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; let source: string | undefined; let sourcePosition: number | undefined; @@ -617,7 +617,7 @@ namespace ts { const sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { diff --git a/tests/cases/fourslash/server/declarationMapsOutOfDateMapping.ts b/tests/cases/fourslash/server/declarationMapsOutOfDateMapping.ts new file mode 100644 index 00000000000..2768e0d9621 --- /dev/null +++ b/tests/cases/fourslash/server/declarationMapsOutOfDateMapping.ts @@ -0,0 +1,32 @@ +/// + +// @Filename: /node_modules/a/dist/index.d.ts +////export declare class Foo { +//// bar: any; +////} +//////# sourceMappingURL=index.d.ts.map + +// @Filename: /node_modules/a/dist/index.d.ts.map +////{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,GAAG,MAAC;CACP"} + +// @Filename: /node_modules/a/src/index.ts +////export class /*2*/Foo { +////} +//// + +// @Filename: /node_modules/a/package.json +////{ +//// "name": "a", +//// "version": "0.0.0", +//// "private": true, +//// "main": "dist", +//// "types": "dist" +////} + +// @Filename: /index.ts +////import { Foo/*1*/ } from "a"; + +goTo.file("/index.ts"); + +goTo.marker("1"); +verify.goToDefinitionIs("2"); // getDefinitionAndBoundSpan From da33c580eb60440dfbecbd590d550f6d782ae91c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Nov 2018 16:58:36 -0800 Subject: [PATCH 034/322] Minor cleanups in checkUnusedIdentifiers (#28513) --- src/compiler/checker.ts | 129 ++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 66 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 52eb341ec60..ad720f22e6a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -24682,7 +24682,7 @@ namespace ts { function registerForUnusedIdentifiersCheck(node: PotentiallyUnusedIdentifier): void { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & NodeFlags.Ambient)) { const sourceFile = getSourceFileOfNode(node); let potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -24709,9 +24709,6 @@ namespace ts { checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case SyntaxKind.InterfaceDeclaration: - checkUnusedTypeParameters(node, addDiagnostic); - break; case SyntaxKind.SourceFile: case SyntaxKind.ModuleDeclaration: case SyntaxKind.Block: @@ -24728,7 +24725,7 @@ namespace ts { case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -24739,9 +24736,12 @@ namespace ts { case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.InferType: + case SyntaxKind.InterfaceDeclaration: checkUnusedTypeParameters(node, addDiagnostic); break; + case SyntaxKind.InferType: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -24759,76 +24759,73 @@ namespace ts { } function checkUnusedClassMembers(node: ClassDeclaration | ClassExpression, addDiagnostic: AddUnusedDiagnostic): void { - if (!(node.flags & NodeFlags.Ambient)) { - for (const member of node.members) { - switch (member.kind) { - case SyntaxKind.MethodDeclaration: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - if (member.kind === SyntaxKind.SetAccessor && member.symbol.flags & SymbolFlags.GetAccessor) { - // Already would have reported an error on the getter. - break; - } - const symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && hasModifier(member, ModifierFlags.Private)) { - addDiagnostic(member, UnusedKind.Local, createDiagnosticForNode(member.name!, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (const member of node.members) { + switch (member.kind) { + case SyntaxKind.MethodDeclaration: + case SyntaxKind.PropertyDeclaration: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + if (member.kind === SyntaxKind.SetAccessor && member.symbol.flags & SymbolFlags.GetAccessor) { + // Already would have reported an error on the getter. break; - case SyntaxKind.Constructor: - for (const parameter of (member).parameters) { - if (!parameter.symbol.isReferenced && hasModifier(parameter, ModifierFlags.Private)) { - addDiagnostic(parameter, UnusedKind.Local, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); - } + } + const symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && hasModifier(member, ModifierFlags.Private)) { + addDiagnostic(member, UnusedKind.Local, createDiagnosticForNode(member.name!, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case SyntaxKind.Constructor: + for (const parameter of (member).parameters) { + if (!parameter.symbol.isReferenced && hasModifier(parameter, ModifierFlags.Private)) { + addDiagnostic(parameter, UnusedKind.Local, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); } - break; - case SyntaxKind.IndexSignature: - case SyntaxKind.SemicolonClassElement: - // Can't be private - break; - default: - Debug.fail(); - } + } + break; + case SyntaxKind.IndexSignature: + case SyntaxKind.SemicolonClassElement: + // Can't be private + break; + default: + Debug.fail(); } } } - function checkUnusedTypeParameters(node: ClassLikeDeclaration | SignatureDeclaration | InterfaceDeclaration | TypeAliasDeclaration | InferTypeNode, addDiagnostic: AddUnusedDiagnostic): void { + function checkUnusedInferTypeParameter(node: InferTypeNode, addDiagnostic: AddUnusedDiagnostic): void { + const { typeParameter } = node; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, UnusedKind.Parameter, createDiagnosticForNode(node, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(typeParameter.name))); + } + } + + function checkUnusedTypeParameters(node: ClassLikeDeclaration | SignatureDeclaration | InterfaceDeclaration | TypeAliasDeclaration, addDiagnostic: AddUnusedDiagnostic): void { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & NodeFlags.Ambient || node.kind !== SyntaxKind.InferType && last(getSymbolOfNode(node).declarations) !== node) return; + if (last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === SyntaxKind.InferType) { - const { typeParameter } = node; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, UnusedKind.Parameter, createDiagnosticForNode(node, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(typeParameter.name))); + const typeParameters = getEffectiveTypeParameterDeclarations(node); + const seenParentsWithEveryUnused = new NodeSet(); + + for (const typeParameter of typeParameters) { + if (!isTypeParameterUnused(typeParameter)) continue; + + const name = idText(typeParameter.name); + const { parent } = typeParameter; + if (parent.kind !== SyntaxKind.InferType && parent.typeParameters!.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + const range = isJSDocTemplateTag(parent) + // Whole @template tag + ? rangeOfNode(parent) + // Include the `<>` in the error message + : rangeOfTypeParameters(parent.typeParameters!); + const only = typeParameters.length === 1; + const message = only ? Diagnostics._0_is_declared_but_its_value_is_never_read : Diagnostics.All_type_parameters_are_unused; + const arg0 = only ? name : undefined; + addDiagnostic(typeParameter, UnusedKind.Parameter, createFileDiagnostic(getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - const typeParameters = getEffectiveTypeParameterDeclarations(node); - const seenParentsWithEveryUnused = new NodeSet(); - - for (const typeParameter of typeParameters) { - if (!isTypeParameterUnused(typeParameter)) continue; - - const name = idText(typeParameter.name); - const { parent } = typeParameter; - if (parent.kind !== SyntaxKind.InferType && parent.typeParameters!.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - const range = isJSDocTemplateTag(parent) - // Whole @template tag - ? rangeOfNode(parent) - // Include the `<>` in the error message - : rangeOfTypeParameters(parent.typeParameters!); - const only = typeParameters.length === 1; - const message = only ? Diagnostics._0_is_declared_but_its_value_is_never_read : Diagnostics.All_type_parameters_are_unused; - const arg0 = only ? name : undefined; - addDiagnostic(typeParameter, UnusedKind.Parameter, createFileDiagnostic(getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, UnusedKind.Parameter, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, UnusedKind.Parameter, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } From 59c014ba32597ab9e9a2cca7f2c7b6767b64ea6f Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Fri, 16 Nov 2018 17:03:34 -0800 Subject: [PATCH 035/322] Properly set symbolMeanings when calling getSymbolsInScope --- src/services/completions.ts | 15 ++++++++++----- .../completionsIsTypeOnlyCompletion.ts | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 tests/cases/fourslash/completionsIsTypeOnlyCompletion.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 488af58a2f0..878b4bcd130 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1021,7 +1021,8 @@ namespace ts.Completions { const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; isInSnippetScope = isSnippetScope(scopeNode); - const symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; + const isTypeOnly = isTypeOnlyCompletion(); + const symbolMeanings = (isTypeOnly ? SymbolFlags.None : SymbolFlags.Value) | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias; symbols = Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); @@ -1070,9 +1071,9 @@ namespace ts.Completions { } function filterGlobalCompletion(symbols: Symbol[]): void { - const isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - const allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - if (isTypeOnlyCompletion) keywordFilters = KeywordCompletionFilters.TypeKeywords; + const isTypeOnly = isTypeOnlyCompletion(); + const allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + if (isTypeOnly) keywordFilters = KeywordCompletionFilters.TypeKeywords; filterMutate(symbols, symbol => { if (!isSourceFile(location)) { @@ -1091,7 +1092,7 @@ namespace ts.Completions { if (allowTypes) { // Its a type, but you can reach it by namespace.type as well const symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); - if (symbolAllowedAsType || isTypeOnlyCompletion) { + if (symbolAllowedAsType || isTypeOnly) { return symbolAllowedAsType; } } @@ -1102,6 +1103,10 @@ namespace ts.Completions { }); } + function isTypeOnlyCompletion(): boolean { + return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + } + function isContextTokenValueLocation(contextToken: Node) { return contextToken && contextToken.kind === SyntaxKind.TypeOfKeyword && diff --git a/tests/cases/fourslash/completionsIsTypeOnlyCompletion.ts b/tests/cases/fourslash/completionsIsTypeOnlyCompletion.ts new file mode 100644 index 00000000000..b14f7bc0efe --- /dev/null +++ b/tests/cases/fourslash/completionsIsTypeOnlyCompletion.ts @@ -0,0 +1,19 @@ +/// + +// @noLib: true + +// @Filename: /abc.ts +////export type Abc = number; + +// @Filename: /user.ts +//// import { Abc } from "./abc"; +////function f(Abc: Ab/**/) {} + +verify.completions({ + marker: "", + // Should not have an import completion for 'Abc', should use the local one + exact: ["Abc", ...completion.typeKeywords], + preferences: { + includeCompletionsForModuleExports: true, + }, +}); From 608a8307accdfdf0f0ae8fb8b356adedee939d09 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 16 Nov 2018 17:15:40 -0800 Subject: [PATCH 036/322] Dont emit module resolution errors when looking up specifiers for container symbols (#28558) --- src/compiler/checker.ts | 6 +++--- .../jsxImportForSideEffectsNonExtantNoError.js | 16 ++++++++++++++++ ...xImportForSideEffectsNonExtantNoError.symbols | 12 ++++++++++++ ...jsxImportForSideEffectsNonExtantNoError.types | 13 +++++++++++++ .../jsxImportForSideEffectsNonExtantNoError.tsx | 7 +++++++ 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.js create mode 100644 tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.symbols create mode 100644 tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.types create mode 100644 tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ad720f22e6a..ffa7a69fbd8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2239,8 +2239,8 @@ namespace ts { return initializer || decl; } - function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression): Symbol | undefined { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression, ignoreErrors?: boolean): Symbol | undefined { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location: Node, moduleReferenceExpression: Expression, moduleNotFoundError: DiagnosticMessage | undefined, isForAugmentation = false): Symbol | undefined { @@ -2602,7 +2602,7 @@ namespace ts { // Try to make an import using an import already in the enclosing file, if possible for (const importRef of containingFile.imports) { if (nodeIsSynthesized(importRef)) continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error - const resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef); + const resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); if (!resolvedModule) continue; const ref = getAliasForSymbolInContainer(resolvedModule, symbol); if (!ref) continue; diff --git a/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.js b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.js new file mode 100644 index 00000000000..8e1172f3752 --- /dev/null +++ b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.js @@ -0,0 +1,16 @@ +//// [jsxImportForSideEffectsNonExtantNoError.tsx] +/// +import * as React from "react"; + +import "./App.css"; // doesn't actually exist + +const tag =
; + + +//// [jsxImportForSideEffectsNonExtantNoError.js] +"use strict"; +exports.__esModule = true; +/// +var React = require("react"); +require("./App.css"); // doesn't actually exist +var tag = React.createElement("div", null); diff --git a/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.symbols b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.symbols new file mode 100644 index 00000000000..f64e0072861 --- /dev/null +++ b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx === +/// +import * as React from "react"; +>React : Symbol(React, Decl(jsxImportForSideEffectsNonExtantNoError.tsx, 1, 6)) + +import "./App.css"; // doesn't actually exist + +const tag =
; +>tag : Symbol(tag, Decl(jsxImportForSideEffectsNonExtantNoError.tsx, 5, 5)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) + diff --git a/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.types b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.types new file mode 100644 index 00000000000..aa220fd89ef --- /dev/null +++ b/tests/baselines/reference/jsxImportForSideEffectsNonExtantNoError.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx === +/// +import * as React from "react"; +>React : typeof React + +import "./App.css"; // doesn't actually exist + +const tag =
; +>tag : JSX.Element +>
: JSX.Element +>div : any +>div : any + diff --git a/tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx b/tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx new file mode 100644 index 00000000000..34f58a342af --- /dev/null +++ b/tests/cases/compiler/jsxImportForSideEffectsNonExtantNoError.tsx @@ -0,0 +1,7 @@ +// @jsx: react +/// +import * as React from "react"; + +import "./App.css"; // doesn't actually exist + +const tag =
; From 1acfce680ec3e0ba779ea520458a5607d90de345 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 17 Nov 2018 11:50:06 -0500 Subject: [PATCH 037/322] Remove jsdoc on ts namespace. --- src/compiler/utilities.ts | 1 - tests/baselines/reference/api/tsserverlibrary.d.ts | 1 - tests/baselines/reference/api/typescript.d.ts | 1 - 3 files changed, 3 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 33dfd2617c9..71d57894273 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1,4 +1,3 @@ -/** Non-internal stuff goes here */ namespace ts { export function isExternalModuleNameRelative(moduleName: string): boolean { // TypeScript 1.0 spec (April 2014): 11.2.1 diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 5e992f3847a..58e66725521 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3106,7 +3106,6 @@ declare namespace ts { function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } -/** Non-internal stuff goes here */ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): T[]; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 32761156558..1781a90cc5b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3106,7 +3106,6 @@ declare namespace ts { function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } -/** Non-internal stuff goes here */ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): T[]; From d6d9c9ec2053080f4ac632357a422e28e03f7391 Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 19 Nov 2018 19:06:43 +0900 Subject: [PATCH 038/322] Show diagnostic when error found with --showConfig option --- src/tsc/tsc.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index d3a60f58d05..89e1d6b68dd 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -133,8 +133,13 @@ namespace ts { if (configFileName) { const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217 if (commandLineOptions.showConfig) { + updateReportDiagnostic(configParseResult.options); + configParseResult.errors.forEach(reportDiagnostic); // tslint:disable-next-line:no-null-keyword sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); + if (configParseResult.errors.length !== 0) { + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsGenerated); + } return sys.exit(ExitStatus.Success); } updateReportDiagnostic(configParseResult.options); From b8a8ceae86d03682eca78d0921acb3d076bc4cc6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 19 Nov 2018 10:51:58 -0800 Subject: [PATCH 039/322] Handle merging unknownSymbol (#28453) * Handle merging unknownSymbol * mergeSymbol of unknown target returns source, not unknown --- src/compiler/checker.ts | 6 +++++- .../reference/exportAsNamespaceConflict.errors.txt | 13 +++++++++++++ .../reference/exportAsNamespaceConflict.symbols | 11 +++++++++++ .../reference/exportAsNamespaceConflict.types | 10 ++++++++++ tests/cases/compiler/exportAsNamespaceConflict.ts | 4 ++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/exportAsNamespaceConflict.errors.txt create mode 100644 tests/baselines/reference/exportAsNamespaceConflict.symbols create mode 100644 tests/baselines/reference/exportAsNamespaceConflict.types create mode 100644 tests/cases/compiler/exportAsNamespaceConflict.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ffa7a69fbd8..e4090f7d8c3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -870,7 +870,11 @@ namespace ts { (source.flags | target.flags) & SymbolFlags.Assignment) { Debug.assert(source !== target); if (!(target.flags & SymbolFlags.Transient)) { - target = cloneSymbol(resolveSymbol(target)); + const resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & SymbolFlags.ValueModule && target.flags & SymbolFlags.ValueModule && target.constEnumOnlyModule && !source.constEnumOnlyModule) { diff --git a/tests/baselines/reference/exportAsNamespaceConflict.errors.txt b/tests/baselines/reference/exportAsNamespaceConflict.errors.txt new file mode 100644 index 00000000000..02d7f859a69 --- /dev/null +++ b/tests/baselines/reference/exportAsNamespaceConflict.errors.txt @@ -0,0 +1,13 @@ +/a.d.ts(2,10): error TS2708: Cannot use namespace 'N' as a value. +/a.d.ts(3,1): error TS2303: Circular definition of import alias 'N'. + + +==== /a.d.ts (2 errors) ==== + declare global { namespace N {} } + export = N; + ~ +!!! error TS2708: Cannot use namespace 'N' as a value. + export as namespace N; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2303: Circular definition of import alias 'N'. + \ No newline at end of file diff --git a/tests/baselines/reference/exportAsNamespaceConflict.symbols b/tests/baselines/reference/exportAsNamespaceConflict.symbols new file mode 100644 index 00000000000..795d2ca869a --- /dev/null +++ b/tests/baselines/reference/exportAsNamespaceConflict.symbols @@ -0,0 +1,11 @@ +=== /a.d.ts === +declare global { namespace N {} } +>global : Symbol(global, Decl(a.d.ts, 0, 0)) +>N : Symbol(N, Decl(a.d.ts, 0, 16)) + +export = N; +>N : Symbol(N, Decl(a.d.ts, 0, 16)) + +export as namespace N; +>N : Symbol(N, Decl(a.d.ts, 1, 11)) + diff --git a/tests/baselines/reference/exportAsNamespaceConflict.types b/tests/baselines/reference/exportAsNamespaceConflict.types new file mode 100644 index 00000000000..cac9b95d22f --- /dev/null +++ b/tests/baselines/reference/exportAsNamespaceConflict.types @@ -0,0 +1,10 @@ +=== /a.d.ts === +declare global { namespace N {} } +>global : any + +export = N; +>N : any + +export as namespace N; +>N : any + diff --git a/tests/cases/compiler/exportAsNamespaceConflict.ts b/tests/cases/compiler/exportAsNamespaceConflict.ts new file mode 100644 index 00000000000..a30330bc205 --- /dev/null +++ b/tests/cases/compiler/exportAsNamespaceConflict.ts @@ -0,0 +1,4 @@ +// @Filename: /a.d.ts +declare global { namespace N {} } +export = N; +export as namespace N; From b3b927291f0c8a4674f005bb21333f8a4e2e4456 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 19 Nov 2018 10:54:13 -0800 Subject: [PATCH 040/322] Update user baselines (#28601) --- tests/baselines/reference/user/assert.log | 2 +- tests/baselines/reference/user/chrome-devtools-frontend.log | 4 ++-- tests/baselines/reference/user/npm.log | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/user/assert.log b/tests/baselines/reference/user/assert.log index 02b6f0a67a6..87f6ac257bf 100644 --- a/tests/baselines/reference/user/assert.log +++ b/tests/baselines/reference/user/assert.log @@ -1,6 +1,6 @@ Exit Code: 1 Standard output: -node_modules/assert/assert.js(124,8): error TS2540: Cannot assign to 'name' because it is a constant or a read-only property. +node_modules/assert/assert.js(124,8): error TS2540: Cannot assign to 'name' because it is a read-only property. node_modules/assert/assert.js(125,8): error TS2339: Property 'actual' does not exist on type 'typeof ok'. node_modules/assert/assert.js(126,8): error TS2339: Property 'expected' does not exist on type 'typeof ok'. node_modules/assert/assert.js(127,8): error TS2339: Property 'operator' does not exist on type 'typeof ok'. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index d15977ac947..7c6411141f5 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -3286,7 +3286,7 @@ node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/BindingsTes node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/BindingsTestRunner.js(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'url' must be of type 'any', but here has type 'string'. node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/BindingsTestRunner.js(108,11): error TS2339: Property 'src' does not exist on type 'HTMLElement'. node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(103,8): error TS2339: Property '_fileSystem' does not exist on type 'typeof TestFileSystem'. -node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(104,8): error TS2540: Cannot assign to 'name' because it is a constant or a read-only property. +node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(104,8): error TS2540: Cannot assign to 'name' because it is a read-only property. node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(105,8): error TS2339: Property '_children' does not exist on type 'typeof TestFileSystem'. node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(106,8): error TS2339: Property '_childrenMap' does not exist on type 'typeof TestFileSystem'. node_modules/chrome-devtools-frontend/front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js(107,8): error TS2339: Property 'isDirectory' does not exist on type 'typeof TestFileSystem'. @@ -5827,7 +5827,7 @@ node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTes node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(429,28): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(490,15): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(549,33): error TS2339: Property 'elements' does not exist on type 'any[]'. -node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(735,11): error TS2540: Cannot assign to 'name' because it is a constant or a read-only property. +node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(735,11): error TS2588: Cannot assign to 'name' because it is a constant. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1024,26): error TS2339: Property 'elements' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1048,13): error TS2339: Property 'elements' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1052,13): error TS2339: Property 'elements' does not exist on type 'any[]'. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index a9ba30c5c74..3ab08f4b545 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -623,6 +623,7 @@ node_modules/npm/lib/pack.js(177,25): error TS2339: Property 'config' does not e node_modules/npm/lib/pack.js(299,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/pack.js(300,20): error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'. node_modules/npm/lib/pack.js(300,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/pack.js(333,15): error TS2531: Object is possibly 'null'. node_modules/npm/lib/pack.js(335,17): error TS2339: Property 'code' does not exist on type 'Error'. node_modules/npm/lib/pack.js(336,17): error TS2339: Property 'signal' does not exist on type 'Error'. node_modules/npm/lib/pack.js(354,36): error TS2339: Property 'tmp' does not exist on type 'typeof EventEmitter'. From ca7f78b8df48353c6b3f0f9ee3beef81fbc3d032 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 19 Nov 2018 10:54:54 -0800 Subject: [PATCH 041/322] Fix typo (#28526) --- ...s.txt => unusedSwitchStatement.errors.txt} | 16 +++++------ ...chStatment.js => unusedSwitchStatement.js} | 4 +-- .../reference/unusedSwitchStatement.symbols | 27 +++++++++++++++++++ ...ment.types => unusedSwitchStatement.types} | 2 +- .../reference/unusedSwitchStatment.symbols | 27 ------------------- ...chStatment.ts => unusedSwitchStatement.ts} | 0 6 files changed, 38 insertions(+), 38 deletions(-) rename tests/baselines/reference/{unusedSwitchStatment.errors.txt => unusedSwitchStatement.errors.txt} (51%) rename tests/baselines/reference/{unusedSwitchStatment.js => unusedSwitchStatement.js} (83%) create mode 100644 tests/baselines/reference/unusedSwitchStatement.symbols rename tests/baselines/reference/{unusedSwitchStatment.types => unusedSwitchStatement.types} (77%) delete mode 100644 tests/baselines/reference/unusedSwitchStatment.symbols rename tests/cases/compiler/{unusedSwitchStatment.ts => unusedSwitchStatement.ts} (100%) diff --git a/tests/baselines/reference/unusedSwitchStatment.errors.txt b/tests/baselines/reference/unusedSwitchStatement.errors.txt similarity index 51% rename from tests/baselines/reference/unusedSwitchStatment.errors.txt rename to tests/baselines/reference/unusedSwitchStatement.errors.txt index 29dc18b5d9a..fbb6212ca3e 100644 --- a/tests/baselines/reference/unusedSwitchStatment.errors.txt +++ b/tests/baselines/reference/unusedSwitchStatement.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/unusedSwitchStatment.ts(2,10): error TS2678: Type '0' is not comparable to type '1'. -tests/cases/compiler/unusedSwitchStatment.ts(3,13): error TS6133: 'x' is declared but its value is never read. -tests/cases/compiler/unusedSwitchStatment.ts(6,15): error TS6133: 'c' is declared but its value is never read. -tests/cases/compiler/unusedSwitchStatment.ts(9,13): error TS6133: 'z' is declared but its value is never read. -tests/cases/compiler/unusedSwitchStatment.ts(14,10): error TS2678: Type '0' is not comparable to type '2'. -tests/cases/compiler/unusedSwitchStatment.ts(15,13): error TS6133: 'x' is declared but its value is never read. -tests/cases/compiler/unusedSwitchStatment.ts(16,10): error TS2678: Type '1' is not comparable to type '2'. +tests/cases/compiler/unusedSwitchStatement.ts(2,10): error TS2678: Type '0' is not comparable to type '1'. +tests/cases/compiler/unusedSwitchStatement.ts(3,13): error TS6133: 'x' is declared but its value is never read. +tests/cases/compiler/unusedSwitchStatement.ts(6,15): error TS6133: 'c' is declared but its value is never read. +tests/cases/compiler/unusedSwitchStatement.ts(9,13): error TS6133: 'z' is declared but its value is never read. +tests/cases/compiler/unusedSwitchStatement.ts(14,10): error TS2678: Type '0' is not comparable to type '2'. +tests/cases/compiler/unusedSwitchStatement.ts(15,13): error TS6133: 'x' is declared but its value is never read. +tests/cases/compiler/unusedSwitchStatement.ts(16,10): error TS2678: Type '1' is not comparable to type '2'. -==== tests/cases/compiler/unusedSwitchStatment.ts (7 errors) ==== +==== tests/cases/compiler/unusedSwitchStatement.ts (7 errors) ==== switch (1) { case 0: ~ diff --git a/tests/baselines/reference/unusedSwitchStatment.js b/tests/baselines/reference/unusedSwitchStatement.js similarity index 83% rename from tests/baselines/reference/unusedSwitchStatment.js rename to tests/baselines/reference/unusedSwitchStatement.js index d94f54357ef..83fdefba8ad 100644 --- a/tests/baselines/reference/unusedSwitchStatment.js +++ b/tests/baselines/reference/unusedSwitchStatement.js @@ -1,4 +1,4 @@ -//// [unusedSwitchStatment.ts] +//// [unusedSwitchStatement.ts] switch (1) { case 0: let x; @@ -18,7 +18,7 @@ switch (2) { x++; } -//// [unusedSwitchStatment.js] +//// [unusedSwitchStatement.js] switch (1) { case 0: var x = void 0; diff --git a/tests/baselines/reference/unusedSwitchStatement.symbols b/tests/baselines/reference/unusedSwitchStatement.symbols new file mode 100644 index 00000000000..87a4f02aa35 --- /dev/null +++ b/tests/baselines/reference/unusedSwitchStatement.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/unusedSwitchStatement.ts === +switch (1) { + case 0: + let x; +>x : Symbol(x, Decl(unusedSwitchStatement.ts, 2, 11)) + + break; + case 1: + const c = 1; +>c : Symbol(c, Decl(unusedSwitchStatement.ts, 5, 13)) + + break; + default: + let z = 2; +>z : Symbol(z, Decl(unusedSwitchStatement.ts, 8, 11)) +} + + +switch (2) { + case 0: + let x; +>x : Symbol(x, Decl(unusedSwitchStatement.ts, 14, 11)) + + case 1: + x++; +>x : Symbol(x, Decl(unusedSwitchStatement.ts, 14, 11)) +} diff --git a/tests/baselines/reference/unusedSwitchStatment.types b/tests/baselines/reference/unusedSwitchStatement.types similarity index 77% rename from tests/baselines/reference/unusedSwitchStatment.types rename to tests/baselines/reference/unusedSwitchStatement.types index 06183af895b..052feb82560 100644 --- a/tests/baselines/reference/unusedSwitchStatment.types +++ b/tests/baselines/reference/unusedSwitchStatement.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/unusedSwitchStatment.ts === +=== tests/cases/compiler/unusedSwitchStatement.ts === switch (1) { >1 : 1 diff --git a/tests/baselines/reference/unusedSwitchStatment.symbols b/tests/baselines/reference/unusedSwitchStatment.symbols deleted file mode 100644 index 0def3eae773..00000000000 --- a/tests/baselines/reference/unusedSwitchStatment.symbols +++ /dev/null @@ -1,27 +0,0 @@ -=== tests/cases/compiler/unusedSwitchStatment.ts === -switch (1) { - case 0: - let x; ->x : Symbol(x, Decl(unusedSwitchStatment.ts, 2, 11)) - - break; - case 1: - const c = 1; ->c : Symbol(c, Decl(unusedSwitchStatment.ts, 5, 13)) - - break; - default: - let z = 2; ->z : Symbol(z, Decl(unusedSwitchStatment.ts, 8, 11)) -} - - -switch (2) { - case 0: - let x; ->x : Symbol(x, Decl(unusedSwitchStatment.ts, 14, 11)) - - case 1: - x++; ->x : Symbol(x, Decl(unusedSwitchStatment.ts, 14, 11)) -} diff --git a/tests/cases/compiler/unusedSwitchStatment.ts b/tests/cases/compiler/unusedSwitchStatement.ts similarity index 100% rename from tests/cases/compiler/unusedSwitchStatment.ts rename to tests/cases/compiler/unusedSwitchStatement.ts From 79b9fa51b6118ff208ac06970ade8b95cd51b74f Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 19 Nov 2018 11:18:32 -0800 Subject: [PATCH 042/322] Avoid infinite loop checking yield expression (#21728) * Avoid infinite loop checking yield expression * Revert now-unneeded change * Revert test filename changes --- .../reference/yieldExpressionInFlowLoop.js | 16 ++++++++++++++++ .../yieldExpressionInFlowLoop.symbols | 14 ++++++++++++++ .../reference/yieldExpressionInFlowLoop.types | 18 ++++++++++++++++++ .../compiler/yieldExpressionInFlowLoop.ts | 9 +++++++++ 4 files changed, 57 insertions(+) create mode 100644 tests/baselines/reference/yieldExpressionInFlowLoop.js create mode 100644 tests/baselines/reference/yieldExpressionInFlowLoop.symbols create mode 100644 tests/baselines/reference/yieldExpressionInFlowLoop.types create mode 100644 tests/cases/compiler/yieldExpressionInFlowLoop.ts diff --git a/tests/baselines/reference/yieldExpressionInFlowLoop.js b/tests/baselines/reference/yieldExpressionInFlowLoop.js new file mode 100644 index 00000000000..d58c2857a00 --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInFlowLoop.js @@ -0,0 +1,16 @@ +//// [yieldExpressionInFlowLoop.ts] +function* f() { + let result; + while (1) { + result = yield result; + } +} + + +//// [yieldExpressionInFlowLoop.js] +function* f() { + let result; + while (1) { + result = yield result; + } +} diff --git a/tests/baselines/reference/yieldExpressionInFlowLoop.symbols b/tests/baselines/reference/yieldExpressionInFlowLoop.symbols new file mode 100644 index 00000000000..d2c2aaffba0 --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInFlowLoop.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/yieldExpressionInFlowLoop.ts === +function* f() { +>f : Symbol(f, Decl(yieldExpressionInFlowLoop.ts, 0, 0)) + + let result; +>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7)) + + while (1) { + result = yield result; +>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7)) +>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7)) + } +} + diff --git a/tests/baselines/reference/yieldExpressionInFlowLoop.types b/tests/baselines/reference/yieldExpressionInFlowLoop.types new file mode 100644 index 00000000000..a178d4b5ce7 --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInFlowLoop.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/yieldExpressionInFlowLoop.ts === +function* f() { +>f : () => IterableIterator + + let result; +>result : any + + while (1) { +>1 : 1 + + result = yield result; +>result = yield result : any +>result : any +>yield result : any +>result : any + } +} + diff --git a/tests/cases/compiler/yieldExpressionInFlowLoop.ts b/tests/cases/compiler/yieldExpressionInFlowLoop.ts new file mode 100644 index 00000000000..43d0895f9ef --- /dev/null +++ b/tests/cases/compiler/yieldExpressionInFlowLoop.ts @@ -0,0 +1,9 @@ +// @noImplicitAny: true +// @target: es6 + +function* f() { + let result; + while (1) { + result = yield result; + } +} From 99d357db575aacdecf67d1dbb20e3c690da8f1a5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 19 Nov 2018 11:15:48 -0800 Subject: [PATCH 043/322] Enable statistics reporting per program through temporary build api --- src/compiler/commandLineParser.ts | 24 ++++++++++++------------ src/compiler/tsbuild.ts | 17 ++++++++++++++++- src/tsc/tsc.ts | 11 +++++++---- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 18e88ad9d3a..e80c1c639b7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -119,6 +119,18 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: Diagnostics.Advanced_Options, + description: Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ @@ -592,18 +604,6 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: Diagnostics.Advanced_Options, - description: Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: Diagnostics.Advanced_Options, - description: Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 4b9e75102b6..e17057b9140 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -32,6 +32,8 @@ namespace ts { pretty?: boolean; traceResolution?: boolean; + /* @internal */ diagnostics?: boolean; + /* @internal */ extendedDiagnostics?: boolean; } enum BuildResultFlags { @@ -326,6 +328,11 @@ namespace ts { reportDiagnostic: DiagnosticReporter; // Technically we want to move it out and allow steps of actions on Solution, but for now just merge stuff in build host here reportSolutionBuilderStatus: DiagnosticReporter; + + // TODO: To do better with watch mode and normal build mode api that creates program and emits files + // This currently helps enable --diagnostics and --extendedDiagnostics + beforeCreateProgram?(options: CompilerOptions): void; + afterProgramEmitAndDiagnostics?(program: Program): void; } export interface SolutionBuilderHost extends SolutionBuilderHostBase { @@ -997,7 +1004,6 @@ namespace ts { } } - function buildSingleProject(proj: ResolvedConfigFileName): BuildResultFlags { if (options.dry) { reportStatus(Diagnostics.A_non_dry_build_would_build_project_0, proj); @@ -1030,6 +1036,9 @@ namespace ts { options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } const program = createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics @@ -1089,12 +1098,18 @@ namespace ts { }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics: ReadonlyArray, errorFlags: BuildResultFlags, errorType: string) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: `${errorType} errors` }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index d3a60f58d05..8d9b2f1afa7 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -199,11 +199,14 @@ namespace ts { reportWatchModeWithoutSysSupport(); } - // TODO: change this to host if watch => watchHost otherwiue without wathc - const builder = createSolutionBuilder(buildOptions.watch ? + // TODO: change this to host if watch => watchHost otherwiue without watch + const buildHost = buildOptions.watch ? createSolutionBuilderWithWatchHost(sys, reportDiagnostic, createBuilderStatusReporter(sys, shouldBePretty()), createWatchStatusReporter()) : - createSolutionBuilderHost(sys, reportDiagnostic, createBuilderStatusReporter(sys, shouldBePretty()), createReportErrorSummary(buildOptions)), - projects, buildOptions); + createSolutionBuilderHost(sys, reportDiagnostic, createBuilderStatusReporter(sys, shouldBePretty()), createReportErrorSummary(buildOptions)); + buildHost.beforeCreateProgram = enableStatistics; + buildHost.afterProgramEmitAndDiagnostics = reportStatistics; + + const builder = createSolutionBuilder(buildHost, projects, buildOptions); if (buildOptions.clean) { return sys.exit(builder.cleanAllProjects()); } From 0774bb81ceb1e47a85338d94a9ea01879e476d34 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 19 Nov 2018 13:29:46 -0800 Subject: [PATCH 044/322] Fix crash on property assignment of unresolved module (#28606) Previously, the compiler would crash when binding a non-top-level property assignment on the symbol of an unresolved module: ```js import x from 'arglebaz' { x.bar = 1 } ``` That's because `x` looks like an alias but doesn't have a valueDeclaration (since there is no file named 'arglebaz'), and the new code for binding Object.defineProperty calls forgot to check for an undefined valueDeclaration. This change adds the checks for an undefined valueDeclaration. --- src/compiler/binder.ts | 2 +- ...tyAssignmentOnUnresolvedImportedSymbol.errors.txt | 11 +++++++++++ ...pertyAssignmentOnUnresolvedImportedSymbol.symbols | 8 ++++++++ ...ropertyAssignmentOnUnresolvedImportedSymbol.types | 12 ++++++++++++ .../propertyAssignmentOnUnresolvedImportedSymbol.ts | 8 ++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.errors.txt create mode 100644 tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.symbols create mode 100644 tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.types create mode 100644 tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index fcd9b854c49..7cb321a95fa 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2608,7 +2608,7 @@ namespace ts { return true; } const node = symbol.valueDeclaration; - if (isCallExpression(node)) { + if (node && isCallExpression(node)) { return !!getAssignedExpandoInitializer(node); } let init = !node ? undefined : diff --git a/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.errors.txt b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.errors.txt new file mode 100644 index 00000000000..447285b8328 --- /dev/null +++ b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.errors.txt @@ -0,0 +1,11 @@ +tests/cases/conformance/salsa/bug28576.js(1,15): error TS2307: Cannot find module 'arglebaz'. + + +==== tests/cases/conformance/salsa/bug28576.js (1 errors) ==== + import x from 'arglebaz' + ~~~~~~~~~~ +!!! error TS2307: Cannot find module 'arglebaz'. + { + x.bar = 1 + } + \ No newline at end of file diff --git a/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.symbols b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.symbols new file mode 100644 index 00000000000..3a190cbaa86 --- /dev/null +++ b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.symbols @@ -0,0 +1,8 @@ +=== tests/cases/conformance/salsa/bug28576.js === +import x from 'arglebaz' +>x : Symbol(x, Decl(bug28576.js, 0, 6)) +{ + x.bar = 1 +>x : Symbol(x, Decl(bug28576.js, 0, 6)) +} + diff --git a/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.types b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.types new file mode 100644 index 00000000000..5ff245f8475 --- /dev/null +++ b/tests/baselines/reference/propertyAssignmentOnUnresolvedImportedSymbol.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/salsa/bug28576.js === +import x from 'arglebaz' +>x : any +{ + x.bar = 1 +>x.bar = 1 : 1 +>x.bar : any +>x : any +>bar : any +>1 : 1 +} + diff --git a/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts b/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts new file mode 100644 index 00000000000..a879367e06f --- /dev/null +++ b/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts @@ -0,0 +1,8 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @Filename: bug28576.js +import x from 'arglebaz' +{ + x.bar = 1 +} From 979dac3ceda6292bd85ea211c7addf6ada48ab34 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 19 Nov 2018 12:58:49 -0800 Subject: [PATCH 045/322] Create map from fileNames in referenced projects to resolvedProjectReference for quick determination of fileName to projectReferenceRedirect --- src/compiler/program.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 15c09a1a79b..968ad2d073e 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -683,6 +683,7 @@ namespace ts { // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files let resolvedProjectReferences: ReadonlyArray | undefined; let projectReferenceRedirects: Map | undefined; + let mapFromFileToProjectReferenceRedirects: Map | undefined; const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); const structuralIsReused = tryReuseStructureFromOldProgram(); @@ -2231,7 +2232,6 @@ namespace ts { if (!referencedProject) { return undefined; } - const out = referencedProject.commandLine.options.outFile || referencedProject.commandLine.options.out; return out ? changeExtension(out, Extension.Dts) : @@ -2242,16 +2242,20 @@ namespace ts { * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName: string) { - return forEachResolvedProjectReference((referencedProject, referenceProjectPath) => { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath!) === referenceProjectPath || - !contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = createMap(); + forEachResolvedProjectReference((referencedProject, referenceProjectPath) => { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath!) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(f => + mapFromFileToProjectReferenceRedirects!.set(toPath(f), referenceProjectPath)); + } + }); + } - return referencedProject; - }); + const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference( From 96937fd59277d8084f1c2ae51fdbf1e144e8c86c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 19 Nov 2018 17:05:28 -0800 Subject: [PATCH 046/322] Allow union signatures to merge when they have differing argument counts (#28604) * Allow union signatures to merge when they have differing argument counts * Accept updated baselines * Adjust comments io changed tests --- src/compiler/checker.ts | 9 +-- .../reactSFCAndFunctionResolvable.js | 41 +++++++++++ .../reactSFCAndFunctionResolvable.symbols | 67 ++++++++++++++++++ .../reactSFCAndFunctionResolvable.types | 69 +++++++++++++++++++ .../unionTypeCallSignatures.errors.txt | 62 +++++++---------- .../reference/unionTypeCallSignatures.js | 28 ++++---- .../reference/unionTypeCallSignatures.symbols | 14 ++-- .../reference/unionTypeCallSignatures.types | 28 ++++---- .../unionTypeCallSignatures4.errors.txt | 12 +--- .../reference/unionTypeCallSignatures4.js | 8 +-- .../unionTypeCallSignatures4.symbols | 4 +- .../reference/unionTypeCallSignatures4.types | 8 +-- .../unionTypeConstructSignatures.errors.txt | 64 ++++++++--------- .../reference/unionTypeConstructSignatures.js | 32 ++++----- .../unionTypeConstructSignatures.symbols | 16 ++--- .../unionTypeConstructSignatures.types | 30 ++++---- .../reactSFCAndFunctionResolvable.tsx | 25 +++++++ .../types/union/unionTypeCallSignatures.ts | 14 ++-- .../types/union/unionTypeCallSignatures4.ts | 4 +- .../union/unionTypeConstructSignatures.ts | 16 ++--- .../completionEntryForUnionProperty2.ts | 2 +- 21 files changed, 362 insertions(+), 191 deletions(-) create mode 100644 tests/baselines/reference/reactSFCAndFunctionResolvable.js create mode 100644 tests/baselines/reference/reactSFCAndFunctionResolvable.symbols create mode 100644 tests/baselines/reference/reactSFCAndFunctionResolvable.types create mode 100644 tests/cases/compiler/reactSFCAndFunctionResolvable.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e4090f7d8c3..6ef51bc401a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13105,13 +13105,8 @@ namespace ts { return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - const sourceRestCount = sourceHasRestParameter ? 1 : 0; - const targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && ( - sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; diff --git a/tests/baselines/reference/reactSFCAndFunctionResolvable.js b/tests/baselines/reference/reactSFCAndFunctionResolvable.js new file mode 100644 index 00000000000..a949f132170 --- /dev/null +++ b/tests/baselines/reference/reactSFCAndFunctionResolvable.js @@ -0,0 +1,41 @@ +//// [reactSFCAndFunctionResolvable.tsx] +/// + +import * as React from 'react'; + +declare const Radio: (props: {}) => React.ReactElement<{}>; +declare const OtherRadio: () => React.ReactElement<{}>; +declare const Checkbox: React.SFC; + +declare const condition1: boolean; +declare const condition2: boolean; +declare const condition3: boolean; + +const RandomComponent: React.SFC = () => { + const Component = + condition1 + ? Radio + : Checkbox; + + const OtherComponent = + condition2 + ? OtherRadio + : Checkbox; + return condition1 ? : ; +}; + + +//// [reactSFCAndFunctionResolvable.js] +"use strict"; +/// +exports.__esModule = true; +var React = require("react"); +var RandomComponent = function () { + var Component = condition1 + ? Radio + : Checkbox; + var OtherComponent = condition2 + ? OtherRadio + : Checkbox; + return condition1 ? React.createElement(Component, null) : React.createElement(OtherComponent, null); +}; diff --git a/tests/baselines/reference/reactSFCAndFunctionResolvable.symbols b/tests/baselines/reference/reactSFCAndFunctionResolvable.symbols new file mode 100644 index 00000000000..18231fa8b60 --- /dev/null +++ b/tests/baselines/reference/reactSFCAndFunctionResolvable.symbols @@ -0,0 +1,67 @@ +=== tests/cases/compiler/reactSFCAndFunctionResolvable.tsx === +/// + +import * as React from 'react'; +>React : Symbol(React, Decl(reactSFCAndFunctionResolvable.tsx, 2, 6)) + +declare const Radio: (props: {}) => React.ReactElement<{}>; +>Radio : Symbol(Radio, Decl(reactSFCAndFunctionResolvable.tsx, 4, 13)) +>props : Symbol(props, Decl(reactSFCAndFunctionResolvable.tsx, 4, 22)) +>React : Symbol(React, Decl(reactSFCAndFunctionResolvable.tsx, 2, 6)) +>ReactElement : Symbol(React.ReactElement, Decl(react16.d.ts, 135, 9)) + +declare const OtherRadio: () => React.ReactElement<{}>; +>OtherRadio : Symbol(OtherRadio, Decl(reactSFCAndFunctionResolvable.tsx, 5, 13)) +>React : Symbol(React, Decl(reactSFCAndFunctionResolvable.tsx, 2, 6)) +>ReactElement : Symbol(React.ReactElement, Decl(react16.d.ts, 135, 9)) + +declare const Checkbox: React.SFC; +>Checkbox : Symbol(Checkbox, Decl(reactSFCAndFunctionResolvable.tsx, 6, 13)) +>React : Symbol(React, Decl(reactSFCAndFunctionResolvable.tsx, 2, 6)) +>SFC : Symbol(React.SFC, Decl(react16.d.ts, 400, 9)) + +declare const condition1: boolean; +>condition1 : Symbol(condition1, Decl(reactSFCAndFunctionResolvable.tsx, 8, 13)) + +declare const condition2: boolean; +>condition2 : Symbol(condition2, Decl(reactSFCAndFunctionResolvable.tsx, 9, 13)) + +declare const condition3: boolean; +>condition3 : Symbol(condition3, Decl(reactSFCAndFunctionResolvable.tsx, 10, 13)) + +const RandomComponent: React.SFC = () => { +>RandomComponent : Symbol(RandomComponent, Decl(reactSFCAndFunctionResolvable.tsx, 12, 5)) +>React : Symbol(React, Decl(reactSFCAndFunctionResolvable.tsx, 2, 6)) +>SFC : Symbol(React.SFC, Decl(react16.d.ts, 400, 9)) + + const Component = +>Component : Symbol(Component, Decl(reactSFCAndFunctionResolvable.tsx, 13, 7)) + + condition1 +>condition1 : Symbol(condition1, Decl(reactSFCAndFunctionResolvable.tsx, 8, 13)) + + ? Radio +>Radio : Symbol(Radio, Decl(reactSFCAndFunctionResolvable.tsx, 4, 13)) + + : Checkbox; +>Checkbox : Symbol(Checkbox, Decl(reactSFCAndFunctionResolvable.tsx, 6, 13)) + + const OtherComponent = +>OtherComponent : Symbol(OtherComponent, Decl(reactSFCAndFunctionResolvable.tsx, 18, 7)) + + condition2 +>condition2 : Symbol(condition2, Decl(reactSFCAndFunctionResolvable.tsx, 9, 13)) + + ? OtherRadio +>OtherRadio : Symbol(OtherRadio, Decl(reactSFCAndFunctionResolvable.tsx, 5, 13)) + + : Checkbox; +>Checkbox : Symbol(Checkbox, Decl(reactSFCAndFunctionResolvable.tsx, 6, 13)) + + return condition1 ? : ; +>condition1 : Symbol(condition1, Decl(reactSFCAndFunctionResolvable.tsx, 8, 13)) +>Component : Symbol(Component, Decl(reactSFCAndFunctionResolvable.tsx, 13, 7)) +>OtherComponent : Symbol(OtherComponent, Decl(reactSFCAndFunctionResolvable.tsx, 18, 7)) + +}; + diff --git a/tests/baselines/reference/reactSFCAndFunctionResolvable.types b/tests/baselines/reference/reactSFCAndFunctionResolvable.types new file mode 100644 index 00000000000..d8061605b1f --- /dev/null +++ b/tests/baselines/reference/reactSFCAndFunctionResolvable.types @@ -0,0 +1,69 @@ +=== tests/cases/compiler/reactSFCAndFunctionResolvable.tsx === +/// + +import * as React from 'react'; +>React : typeof React + +declare const Radio: (props: {}) => React.ReactElement<{}>; +>Radio : (props: {}) => React.ReactElement<{}> +>props : {} +>React : any + +declare const OtherRadio: () => React.ReactElement<{}>; +>OtherRadio : () => React.ReactElement<{}> +>React : any + +declare const Checkbox: React.SFC; +>Checkbox : React.StatelessComponent<{}> +>React : any + +declare const condition1: boolean; +>condition1 : boolean + +declare const condition2: boolean; +>condition2 : boolean + +declare const condition3: boolean; +>condition3 : boolean + +const RandomComponent: React.SFC = () => { +>RandomComponent : React.StatelessComponent<{}> +>React : any +>() => { const Component = condition1 ? Radio : Checkbox; const OtherComponent = condition2 ? OtherRadio : Checkbox; return condition1 ? : ;} : () => JSX.Element + + const Component = +>Component : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) + + condition1 +>condition1 ? Radio : Checkbox : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) +>condition1 : boolean + + ? Radio +>Radio : (props: {}) => React.ReactElement<{}> + + : Checkbox; +>Checkbox : React.StatelessComponent<{}> + + const OtherComponent = +>OtherComponent : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) + + condition2 +>condition2 ? OtherRadio : Checkbox : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) +>condition2 : boolean + + ? OtherRadio +>OtherRadio : () => React.ReactElement<{}> + + : Checkbox; +>Checkbox : React.StatelessComponent<{}> + + return condition1 ? : ; +>condition1 ? : : JSX.Element +>condition1 : boolean +> : JSX.Element +>Component : React.StatelessComponent<{}> | ((props: {}) => React.ReactElement<{}>) +> : JSX.Element +>OtherComponent : React.StatelessComponent<{}> | (() => React.ReactElement<{}>) + +}; + diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 3f0ac662013..5a67bde722c 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -7,31 +7,27 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,1): error TS23 tests/cases/conformance/types/union/unionTypeCallSignatures.ts(21,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(24,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(26,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(29,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(30,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(31,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(29,1): error TS2554: Expected 2 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(30,1): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(36,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(37,12): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(40,12): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(42,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(43,12): error TS2554: Expected 2 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(47,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(48,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(49,12): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(48,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(49,12): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(55,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(56,12): error TS2555: Expected at least 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(59,12): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(61,12): error TS2554: Expected 2 arguments, but got 3. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(62,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(63,12): error TS2554: Expected 2 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(67,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(68,12): error TS2554: Expected 1 arguments, but got 3. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(69,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(70,12): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(69,45): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(70,12): error TS2555: Expected at least 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1. -==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (31 errors) ==== +==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (27 errors) ==== var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; @@ -80,15 +76,15 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ; - unionWithDifferentParameterCount();// no call signature + unionWithDifferentParameterCount();// needs more args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. - unionWithDifferentParameterCount("hello");// no call signature +!!! error TS2554: Expected 2 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:28:69: An argument for 'a' was not provided. + unionWithDifferentParameterCount("hello");// needs more args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. - unionWithDifferentParameterCount("hello", 10);// no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures. +!!! error TS2554: Expected 2 arguments, but got 1. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:28:80: An argument for 'b' was not provided. + unionWithDifferentParameterCount("hello", 10);// OK var unionWithOptionalParameter1: { (a: string, b?: number): string; } | { (a: string, b?: number): number; }; strOrNum = unionWithOptionalParameter1('hello'); @@ -117,16 +113,14 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 var unionWithOptionalParameter3: { (a: string, b?: number): string; } | { (a: string): number; }; strOrNum = unionWithOptionalParameter3('hello'); - strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. - strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. - strOrNum = unionWithOptionalParameter3(); // error no call signature + strOrNum = unionWithOptionalParameter3('hello', 10); // ok + strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. + strOrNum = unionWithOptionalParameter3(); // needs more args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 0. -!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:45:76: An argument for 'a' was not provided. +!!! error TS2554: Expected 1-2 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:45:37: An argument for 'a' was not provided. var unionWithRestParameter1: { (a: string, ...b: number[]): string; } | { (a: string, ...b: number[]): number }; strOrNum = unionWithRestParameter1('hello'); @@ -160,18 +154,14 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 var unionWithRestParameter3: { (a: string, ...b: number[]): string; } | { (a: string): number }; strOrNum = unionWithRestParameter3('hello'); strOrNum = unionWithRestParameter3('hello', 10); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 3. - strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. + strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = unionWithRestParameter3(); // error no call signature ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 0. -!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:65:76: An argument for 'a' was not provided. +!!! error TS2555: Expected at least 1 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:65:33: An argument for 'a' was not provided. var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature diff --git a/tests/baselines/reference/unionTypeCallSignatures.js b/tests/baselines/reference/unionTypeCallSignatures.js index 103d92fbef3..4689fd21d1a 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.js +++ b/tests/baselines/reference/unionTypeCallSignatures.js @@ -27,9 +27,9 @@ unionOfDifferentNumberOfSignatures(10); // error - no call signatures unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ; -unionWithDifferentParameterCount();// no call signature -unionWithDifferentParameterCount("hello");// no call signature -unionWithDifferentParameterCount("hello", 10);// no call signature +unionWithDifferentParameterCount();// needs more args +unionWithDifferentParameterCount("hello");// needs more args +unionWithDifferentParameterCount("hello", 10);// OK var unionWithOptionalParameter1: { (a: string, b?: number): string; } | { (a: string, b?: number): number; }; strOrNum = unionWithOptionalParameter1('hello'); @@ -45,9 +45,9 @@ strOrNum = unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3: { (a: string, b?: number): string; } | { (a: string): number; }; strOrNum = unionWithOptionalParameter3('hello'); -strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature -strOrNum = unionWithOptionalParameter3(); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', 10); // ok +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type +strOrNum = unionWithOptionalParameter3(); // needs more args var unionWithRestParameter1: { (a: string, ...b: number[]): string; } | { (a: string, ...b: number[]): number }; strOrNum = unionWithRestParameter1('hello'); @@ -67,7 +67,7 @@ var unionWithRestParameter3: { (a: string, ...b: number[]): string; } | { (a: st strOrNum = unionWithRestParameter3('hello'); strOrNum = unionWithRestParameter3('hello', 10); // error no call signature strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type strOrNum = unionWithRestParameter3(); // error no call signature var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; @@ -99,9 +99,9 @@ unionOfDifferentNumberOfSignatures(); // error - no call signatures unionOfDifferentNumberOfSignatures(10); // error - no call signatures unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount; -unionWithDifferentParameterCount(); // no call signature -unionWithDifferentParameterCount("hello"); // no call signature -unionWithDifferentParameterCount("hello", 10); // no call signature +unionWithDifferentParameterCount(); // needs more args +unionWithDifferentParameterCount("hello"); // needs more args +unionWithDifferentParameterCount("hello", 10); // OK var unionWithOptionalParameter1; strOrNum = unionWithOptionalParameter1('hello'); strOrNum = unionWithOptionalParameter1('hello', 10); @@ -114,9 +114,9 @@ strOrNum = unionWithOptionalParameter2('hello', "hello"); // error no call signa strOrNum = unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3; strOrNum = unionWithOptionalParameter3('hello'); -strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature -strOrNum = unionWithOptionalParameter3(); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', 10); // ok +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type +strOrNum = unionWithOptionalParameter3(); // needs more args var unionWithRestParameter1; strOrNum = unionWithRestParameter1('hello'); strOrNum = unionWithRestParameter1('hello', 10); @@ -133,7 +133,7 @@ var unionWithRestParameter3; strOrNum = unionWithRestParameter3('hello'); strOrNum = unionWithRestParameter3('hello', 10); // error no call signature strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type strOrNum = unionWithRestParameter3(); // error no call signature var unionWithRestParameter4; strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature diff --git a/tests/baselines/reference/unionTypeCallSignatures.symbols b/tests/baselines/reference/unionTypeCallSignatures.symbols index ed54cb56183..e3f18cb8299 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.symbols +++ b/tests/baselines/reference/unionTypeCallSignatures.symbols @@ -87,13 +87,13 @@ var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 27, 68)) >b : Symbol(b, Decl(unionTypeCallSignatures.ts, 27, 78)) -unionWithDifferentParameterCount();// no call signature +unionWithDifferentParameterCount();// needs more args >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeCallSignatures.ts, 27, 3)) -unionWithDifferentParameterCount("hello");// no call signature +unionWithDifferentParameterCount("hello");// needs more args >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeCallSignatures.ts, 27, 3)) -unionWithDifferentParameterCount("hello", 10);// no call signature +unionWithDifferentParameterCount("hello", 10);// OK >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeCallSignatures.ts, 27, 3)) var unionWithOptionalParameter1: { (a: string, b?: number): string; } | { (a: string, b?: number): number; }; @@ -152,15 +152,15 @@ strOrNum = unionWithOptionalParameter3('hello'); >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeCallSignatures.ts, 44, 3)) -strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', 10); // ok >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeCallSignatures.ts, 44, 3)) -strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeCallSignatures.ts, 44, 3)) -strOrNum = unionWithOptionalParameter3(); // error no call signature +strOrNum = unionWithOptionalParameter3(); // needs more args >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeCallSignatures.ts, 44, 3)) @@ -236,7 +236,7 @@ strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeCallSignatures.ts, 64, 3)) -strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type >strOrNum : Symbol(strOrNum, Decl(unionTypeCallSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeCallSignatures.ts, 64, 3)) diff --git a/tests/baselines/reference/unionTypeCallSignatures.types b/tests/baselines/reference/unionTypeCallSignatures.types index e08d815478e..ef38b524afd 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.types +++ b/tests/baselines/reference/unionTypeCallSignatures.types @@ -109,17 +109,17 @@ var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b >a : string >b : number -unionWithDifferentParameterCount();// no call signature +unionWithDifferentParameterCount();// needs more args >unionWithDifferentParameterCount() : any >unionWithDifferentParameterCount : ((a: string) => string) | ((a: string, b: number) => number) -unionWithDifferentParameterCount("hello");// no call signature +unionWithDifferentParameterCount("hello");// needs more args >unionWithDifferentParameterCount("hello") : any >unionWithDifferentParameterCount : ((a: string) => string) | ((a: string, b: number) => number) >"hello" : "hello" -unionWithDifferentParameterCount("hello", 10);// no call signature ->unionWithDifferentParameterCount("hello", 10) : any +unionWithDifferentParameterCount("hello", 10);// OK +>unionWithDifferentParameterCount("hello", 10) : string | number >unionWithDifferentParameterCount : ((a: string) => string) | ((a: string, b: number) => number) >"hello" : "hello" >10 : 10 @@ -209,15 +209,15 @@ strOrNum = unionWithOptionalParameter3('hello'); >unionWithOptionalParameter3 : ((a: string, b?: number) => string) | ((a: string) => number) >'hello' : "hello" -strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature ->strOrNum = unionWithOptionalParameter3('hello', 10) : any +strOrNum = unionWithOptionalParameter3('hello', 10); // ok +>strOrNum = unionWithOptionalParameter3('hello', 10) : string | number >strOrNum : string | number ->unionWithOptionalParameter3('hello', 10) : any +>unionWithOptionalParameter3('hello', 10) : string | number >unionWithOptionalParameter3 : ((a: string, b?: number) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 -strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type >strOrNum = unionWithOptionalParameter3('hello', "hello") : any >strOrNum : string | number >unionWithOptionalParameter3('hello', "hello") : any @@ -225,7 +225,7 @@ strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signa >'hello' : "hello" >"hello" : "hello" -strOrNum = unionWithOptionalParameter3(); // error no call signature +strOrNum = unionWithOptionalParameter3(); // needs more args >strOrNum = unionWithOptionalParameter3() : any >strOrNum : string | number >unionWithOptionalParameter3() : any @@ -335,23 +335,23 @@ strOrNum = unionWithRestParameter3('hello'); >'hello' : "hello" strOrNum = unionWithRestParameter3('hello', 10); // error no call signature ->strOrNum = unionWithRestParameter3('hello', 10) : any +>strOrNum = unionWithRestParameter3('hello', 10) : string | number >strOrNum : string | number ->unionWithRestParameter3('hello', 10) : any +>unionWithRestParameter3('hello', 10) : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature ->strOrNum = unionWithRestParameter3('hello', 10, 11) : any +>strOrNum = unionWithRestParameter3('hello', 10, 11) : string | number >strOrNum : string | number ->unionWithRestParameter3('hello', 10, 11) : any +>unionWithRestParameter3('hello', 10, 11) : string | number >unionWithRestParameter3 : ((a: string, ...b: number[]) => string) | ((a: string) => number) >'hello' : "hello" >10 : 10 >11 : 11 -strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type >strOrNum = unionWithRestParameter3('hello', "hello") : any >strOrNum : string | number >unionWithRestParameter3('hello', "hello") : any diff --git a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt index 9d2ca23bbbd..6ba8b9e3015 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures4.errors.txt @@ -1,10 +1,8 @@ -tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(10,1): error TS2554: Expected 1-2 arguments, but got 3. -tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(20,1): error TS2554: Expected 1-2 arguments, but got 3. tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(23,1): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2554: Expected 2 arguments, but got 3. -==== tests/cases/conformance/types/union/unionTypeCallSignatures4.ts (4 errors) ==== +==== tests/cases/conformance/types/union/unionTypeCallSignatures4.ts (2 errors) ==== type F1 = (a: string, b?: string) => void; type F2 = (a: string, b?: string, c?: string) => void; type F3 = (a: string, ...rest: string[]) => void; @@ -14,9 +12,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2 var f12: F1 | F2; f12("a"); f12("a", "b"); - f12("a", "b", "c"); // error - ~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1-2 arguments, but got 3. + f12("a", "b", "c"); // ok var f34: F3 | F4; f34("a"); @@ -26,9 +22,7 @@ tests/cases/conformance/types/union/unionTypeCallSignatures4.ts(25,1): error TS2 var f1234: F1 | F2 | F3 | F4; f1234("a"); f1234("a", "b"); - f1234("a", "b", "c"); // error - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1-2 arguments, but got 3. + f1234("a", "b", "c"); // ok var f12345: F1 | F2 | F3 | F4 | F5; f12345("a"); // error diff --git a/tests/baselines/reference/unionTypeCallSignatures4.js b/tests/baselines/reference/unionTypeCallSignatures4.js index be9a45b33c9..a98dbb084c6 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.js +++ b/tests/baselines/reference/unionTypeCallSignatures4.js @@ -8,7 +8,7 @@ type F5 = (a: string, b: string) => void; var f12: F1 | F2; f12("a"); f12("a", "b"); -f12("a", "b", "c"); // error +f12("a", "b", "c"); // ok var f34: F3 | F4; f34("a"); @@ -18,7 +18,7 @@ f34("a", "b", "c"); var f1234: F1 | F2 | F3 | F4; f1234("a"); f1234("a", "b"); -f1234("a", "b", "c"); // error +f1234("a", "b", "c"); // ok var f12345: F1 | F2 | F3 | F4 | F5; f12345("a"); // error @@ -30,7 +30,7 @@ f12345("a", "b", "c"); // error var f12; f12("a"); f12("a", "b"); -f12("a", "b", "c"); // error +f12("a", "b", "c"); // ok var f34; f34("a"); f34("a", "b"); @@ -38,7 +38,7 @@ f34("a", "b", "c"); var f1234; f1234("a"); f1234("a", "b"); -f1234("a", "b", "c"); // error +f1234("a", "b", "c"); // ok var f12345; f12345("a"); // error f12345("a", "b"); diff --git a/tests/baselines/reference/unionTypeCallSignatures4.symbols b/tests/baselines/reference/unionTypeCallSignatures4.symbols index 1157cc99e06..ef3dc1ba9b8 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.symbols +++ b/tests/baselines/reference/unionTypeCallSignatures4.symbols @@ -37,7 +37,7 @@ f12("a"); f12("a", "b"); >f12 : Symbol(f12, Decl(unionTypeCallSignatures4.ts, 6, 3)) -f12("a", "b", "c"); // error +f12("a", "b", "c"); // ok >f12 : Symbol(f12, Decl(unionTypeCallSignatures4.ts, 6, 3)) var f34: F3 | F4; @@ -67,7 +67,7 @@ f1234("a"); f1234("a", "b"); >f1234 : Symbol(f1234, Decl(unionTypeCallSignatures4.ts, 16, 3)) -f1234("a", "b", "c"); // error +f1234("a", "b", "c"); // ok >f1234 : Symbol(f1234, Decl(unionTypeCallSignatures4.ts, 16, 3)) var f12345: F1 | F2 | F3 | F4 | F5; diff --git a/tests/baselines/reference/unionTypeCallSignatures4.types b/tests/baselines/reference/unionTypeCallSignatures4.types index 12deb1fba37..a02ef1e8bfa 100644 --- a/tests/baselines/reference/unionTypeCallSignatures4.types +++ b/tests/baselines/reference/unionTypeCallSignatures4.types @@ -40,8 +40,8 @@ f12("a", "b"); >"a" : "a" >"b" : "b" -f12("a", "b", "c"); // error ->f12("a", "b", "c") : any +f12("a", "b", "c"); // ok +>f12("a", "b", "c") : void >f12 : F1 | F2 >"a" : "a" >"b" : "b" @@ -82,8 +82,8 @@ f1234("a", "b"); >"a" : "a" >"b" : "b" -f1234("a", "b", "c"); // error ->f1234("a", "b", "c") : any +f1234("a", "b", "c"); // ok +>f1234("a", "b", "c") : void >f1234 : F1 | F2 | F3 | F4 >"a" : "a" >"b" : "b" diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index 67973c3c206..a5ad21ba580 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -7,30 +7,26 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,1): error tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(21,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(24,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(26,40): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(29,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(30,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(31,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(29,1): error TS2554: Expected 2 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(30,1): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(36,53): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(37,12): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(40,12): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(42,53): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(43,12): error TS2554: Expected 2 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(47,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(48,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(49,12): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(48,53): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(49,12): error TS2554: Expected 1-2 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(55,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(56,12): error TS2555: Expected at least 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(59,12): error TS2554: Expected 2 arguments, but got 1. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(61,12): error TS2554: Expected 2 arguments, but got 3. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(62,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(63,12): error TS2554: Expected 2 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(67,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(68,12): error TS2554: Expected 1 arguments, but got 3. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(69,12): error TS2554: Expected 1 arguments, but got 2. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): error TS2554: Expected 1 arguments, but got 0. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(69,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): error TS2555: Expected at least 1 arguments, but got 0. -==== tests/cases/conformance/types/union/unionTypeConstructSignatures.ts (30 errors) ==== +==== tests/cases/conformance/types/union/unionTypeConstructSignatures.ts (26 errors) ==== var numOrDate: number | Date; var strOrBoolean: string | boolean; var strOrNum: string | number; @@ -79,15 +75,15 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro !!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. var unionWithDifferentParameterCount: { new (a: string): string; } | { new (a: string, b: number): number; }; - new unionWithDifferentParameterCount();// no call signature + new unionWithDifferentParameterCount();// needs more args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. - new unionWithDifferentParameterCount("hello");// no call signature +!!! error TS2554: Expected 2 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:28:77: An argument for 'a' was not provided. + new unionWithDifferentParameterCount("hello");// needs more args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. - new unionWithDifferentParameterCount("hello", 10);// no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2554: Expected 2 arguments, but got 1. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:28:88: An argument for 'b' was not provided. + new unionWithDifferentParameterCount("hello", 10);// ok var unionWithOptionalParameter1: { new (a: string, b?: number): string; } | { new (a: string, b?: number): number; }; strOrNum = new unionWithOptionalParameter1('hello'); @@ -116,16 +112,14 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro var unionWithOptionalParameter3: { new (a: string, b?: number): string; } | { new (a: string): number; }; strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature - strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. - strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. + strOrNum = new unionWithOptionalParameter3('hello', 10); // ok + strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = new unionWithOptionalParameter3(); // error no call signature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 0. -!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:45:84: An argument for 'a' was not provided. +!!! error TS2554: Expected 1-2 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:45:41: An argument for 'a' was not provided. var unionWithRestParameter1: { new (a: string, ...b: number[]): string; } | { new (a: string, ...b: number[]): number }; strOrNum = new unionWithRestParameter1('hello'); @@ -158,16 +152,12 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro var unionWithRestParameter3: { new (a: string, ...b: number[]): string; } | { new (a: string): number }; strOrNum = new unionWithRestParameter3('hello'); // error no call signature - strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. - strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 3. - strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 2. + strOrNum = new unionWithRestParameter3('hello', 10); // ok + strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok + strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. strOrNum = new unionWithRestParameter3(); // error no call signature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2554: Expected 1 arguments, but got 0. -!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:65:84: An argument for 'a' was not provided. \ No newline at end of file +!!! error TS2555: Expected at least 1 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:65:37: An argument for 'a' was not provided. \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeConstructSignatures.js b/tests/baselines/reference/unionTypeConstructSignatures.js index 83c3df44603..668ad3f335d 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.js +++ b/tests/baselines/reference/unionTypeConstructSignatures.js @@ -27,9 +27,9 @@ new unionOfDifferentNumberOfSignatures(10); // error - no call signatures new unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount: { new (a: string): string; } | { new (a: string, b: number): number; }; -new unionWithDifferentParameterCount();// no call signature -new unionWithDifferentParameterCount("hello");// no call signature -new unionWithDifferentParameterCount("hello", 10);// no call signature +new unionWithDifferentParameterCount();// needs more args +new unionWithDifferentParameterCount("hello");// needs more args +new unionWithDifferentParameterCount("hello", 10);// ok var unionWithOptionalParameter1: { new (a: string, b?: number): string; } | { new (a: string, b?: number): number; }; strOrNum = new unionWithOptionalParameter1('hello'); @@ -45,8 +45,8 @@ strOrNum = new unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3: { new (a: string, b?: number): string; } | { new (a: string): number; }; strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type strOrNum = new unionWithOptionalParameter3(); // error no call signature var unionWithRestParameter1: { new (a: string, ...b: number[]): string; } | { new (a: string, ...b: number[]): number }; @@ -65,9 +65,9 @@ strOrNum = new unionWithRestParameter2(); // error no call signature var unionWithRestParameter3: { new (a: string, ...b: number[]): string; } | { new (a: string): number }; strOrNum = new unionWithRestParameter3('hello'); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10); // ok +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type strOrNum = new unionWithRestParameter3(); // error no call signature //// [unionTypeConstructSignatures.js] @@ -94,9 +94,9 @@ new unionOfDifferentNumberOfSignatures(); // error - no call signatures new unionOfDifferentNumberOfSignatures(10); // error - no call signatures new unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount; -new unionWithDifferentParameterCount(); // no call signature -new unionWithDifferentParameterCount("hello"); // no call signature -new unionWithDifferentParameterCount("hello", 10); // no call signature +new unionWithDifferentParameterCount(); // needs more args +new unionWithDifferentParameterCount("hello"); // needs more args +new unionWithDifferentParameterCount("hello", 10); // ok var unionWithOptionalParameter1; strOrNum = new unionWithOptionalParameter1('hello'); strOrNum = new unionWithOptionalParameter1('hello', 10); @@ -109,8 +109,8 @@ strOrNum = new unionWithOptionalParameter2('hello', "hello"); // error no call s strOrNum = new unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3; strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type strOrNum = new unionWithOptionalParameter3(); // error no call signature var unionWithRestParameter1; strOrNum = new unionWithRestParameter1('hello'); @@ -126,7 +126,7 @@ strOrNum = new unionWithRestParameter2('hello', "hello"); // error no call signa strOrNum = new unionWithRestParameter2(); // error no call signature var unionWithRestParameter3; strOrNum = new unionWithRestParameter3('hello'); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10); // ok +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type strOrNum = new unionWithRestParameter3(); // error no call signature diff --git a/tests/baselines/reference/unionTypeConstructSignatures.symbols b/tests/baselines/reference/unionTypeConstructSignatures.symbols index b4123a6f746..ce4cc97bc1b 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.symbols +++ b/tests/baselines/reference/unionTypeConstructSignatures.symbols @@ -87,13 +87,13 @@ var unionWithDifferentParameterCount: { new (a: string): string; } | { new (a: s >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 27, 76)) >b : Symbol(b, Decl(unionTypeConstructSignatures.ts, 27, 86)) -new unionWithDifferentParameterCount();// no call signature +new unionWithDifferentParameterCount();// needs more args >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeConstructSignatures.ts, 27, 3)) -new unionWithDifferentParameterCount("hello");// no call signature +new unionWithDifferentParameterCount("hello");// needs more args >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeConstructSignatures.ts, 27, 3)) -new unionWithDifferentParameterCount("hello", 10);// no call signature +new unionWithDifferentParameterCount("hello", 10);// ok >unionWithDifferentParameterCount : Symbol(unionWithDifferentParameterCount, Decl(unionTypeConstructSignatures.ts, 27, 3)) var unionWithOptionalParameter1: { new (a: string, b?: number): string; } | { new (a: string, b?: number): number; }; @@ -152,11 +152,11 @@ strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeConstructSignatures.ts, 44, 3)) -strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeConstructSignatures.ts, 44, 3)) -strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithOptionalParameter3 : Symbol(unionWithOptionalParameter3, Decl(unionTypeConstructSignatures.ts, 44, 3)) @@ -228,15 +228,15 @@ strOrNum = new unionWithRestParameter3('hello'); // error no call signature >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeConstructSignatures.ts, 64, 3)) -strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10); // ok >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeConstructSignatures.ts, 64, 3)) -strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeConstructSignatures.ts, 64, 3)) -strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type >strOrNum : Symbol(strOrNum, Decl(unionTypeConstructSignatures.ts, 2, 3)) >unionWithRestParameter3 : Symbol(unionWithRestParameter3, Decl(unionTypeConstructSignatures.ts, 64, 3)) diff --git a/tests/baselines/reference/unionTypeConstructSignatures.types b/tests/baselines/reference/unionTypeConstructSignatures.types index 1a0c077fb56..ca378be3cc3 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.types +++ b/tests/baselines/reference/unionTypeConstructSignatures.types @@ -109,17 +109,17 @@ var unionWithDifferentParameterCount: { new (a: string): string; } | { new (a: s >a : string >b : number -new unionWithDifferentParameterCount();// no call signature +new unionWithDifferentParameterCount();// needs more args >new unionWithDifferentParameterCount() : any >unionWithDifferentParameterCount : (new (a: string) => string) | (new (a: string, b: number) => number) -new unionWithDifferentParameterCount("hello");// no call signature +new unionWithDifferentParameterCount("hello");// needs more args >new unionWithDifferentParameterCount("hello") : any >unionWithDifferentParameterCount : (new (a: string) => string) | (new (a: string, b: number) => number) >"hello" : "hello" -new unionWithDifferentParameterCount("hello", 10);// no call signature ->new unionWithDifferentParameterCount("hello", 10) : any +new unionWithDifferentParameterCount("hello", 10);// ok +>new unionWithDifferentParameterCount("hello", 10) : string | number >unionWithDifferentParameterCount : (new (a: string) => string) | (new (a: string, b: number) => number) >"hello" : "hello" >10 : 10 @@ -209,15 +209,15 @@ strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature >unionWithOptionalParameter3 : (new (a: string, b?: number) => string) | (new (a: string) => number) >'hello' : "hello" -strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature ->strOrNum = new unionWithOptionalParameter3('hello', 10) : any +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok +>strOrNum = new unionWithOptionalParameter3('hello', 10) : string | number >strOrNum : string | number ->new unionWithOptionalParameter3('hello', 10) : any +>new unionWithOptionalParameter3('hello', 10) : string | number >unionWithOptionalParameter3 : (new (a: string, b?: number) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 -strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type >strOrNum = new unionWithOptionalParameter3('hello', "hello") : any >strOrNum : string | number >new unionWithOptionalParameter3('hello', "hello") : any @@ -334,24 +334,24 @@ strOrNum = new unionWithRestParameter3('hello'); // error no call signature >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" -strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature ->strOrNum = new unionWithRestParameter3('hello', 10) : any +strOrNum = new unionWithRestParameter3('hello', 10); // ok +>strOrNum = new unionWithRestParameter3('hello', 10) : string | number >strOrNum : string | number ->new unionWithRestParameter3('hello', 10) : any +>new unionWithRestParameter3('hello', 10) : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 -strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature ->strOrNum = new unionWithRestParameter3('hello', 10, 11) : any +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok +>strOrNum = new unionWithRestParameter3('hello', 10, 11) : string | number >strOrNum : string | number ->new unionWithRestParameter3('hello', 10, 11) : any +>new unionWithRestParameter3('hello', 10, 11) : string | number >unionWithRestParameter3 : (new (a: string, ...b: number[]) => string) | (new (a: string) => number) >'hello' : "hello" >10 : 10 >11 : 11 -strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type >strOrNum = new unionWithRestParameter3('hello', "hello") : any >strOrNum : string | number >new unionWithRestParameter3('hello', "hello") : any diff --git a/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx b/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx new file mode 100644 index 00000000000..52803da993d --- /dev/null +++ b/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx @@ -0,0 +1,25 @@ +// @jsx: react +/// + +import * as React from 'react'; + +declare const Radio: (props: {}) => React.ReactElement<{}>; +declare const OtherRadio: () => React.ReactElement<{}>; +declare const Checkbox: React.SFC; + +declare const condition1: boolean; +declare const condition2: boolean; +declare const condition3: boolean; + +const RandomComponent: React.SFC = () => { + const Component = + condition1 + ? Radio + : Checkbox; + + const OtherComponent = + condition2 + ? OtherRadio + : Checkbox; + return condition1 ? : ; +}; diff --git a/tests/cases/conformance/types/union/unionTypeCallSignatures.ts b/tests/cases/conformance/types/union/unionTypeCallSignatures.ts index a25d27d9a29..532dd9f3e1f 100644 --- a/tests/cases/conformance/types/union/unionTypeCallSignatures.ts +++ b/tests/cases/conformance/types/union/unionTypeCallSignatures.ts @@ -26,9 +26,9 @@ unionOfDifferentNumberOfSignatures(10); // error - no call signatures unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ; -unionWithDifferentParameterCount();// no call signature -unionWithDifferentParameterCount("hello");// no call signature -unionWithDifferentParameterCount("hello", 10);// no call signature +unionWithDifferentParameterCount();// needs more args +unionWithDifferentParameterCount("hello");// needs more args +unionWithDifferentParameterCount("hello", 10);// OK var unionWithOptionalParameter1: { (a: string, b?: number): string; } | { (a: string, b?: number): number; }; strOrNum = unionWithOptionalParameter1('hello'); @@ -44,9 +44,9 @@ strOrNum = unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3: { (a: string, b?: number): string; } | { (a: string): number; }; strOrNum = unionWithOptionalParameter3('hello'); -strOrNum = unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = unionWithOptionalParameter3('hello', "hello"); // error no call signature -strOrNum = unionWithOptionalParameter3(); // error no call signature +strOrNum = unionWithOptionalParameter3('hello', 10); // ok +strOrNum = unionWithOptionalParameter3('hello', "hello"); // wrong argument type +strOrNum = unionWithOptionalParameter3(); // needs more args var unionWithRestParameter1: { (a: string, ...b: number[]): string; } | { (a: string, ...b: number[]): number }; strOrNum = unionWithRestParameter1('hello'); @@ -66,7 +66,7 @@ var unionWithRestParameter3: { (a: string, ...b: number[]): string; } | { (a: st strOrNum = unionWithRestParameter3('hello'); strOrNum = unionWithRestParameter3('hello', 10); // error no call signature strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = unionWithRestParameter3('hello', "hello"); // wrong argument type strOrNum = unionWithRestParameter3(); // error no call signature var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; }; diff --git a/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts b/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts index 1e27acd2083..9ac96262bdc 100644 --- a/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts +++ b/tests/cases/conformance/types/union/unionTypeCallSignatures4.ts @@ -7,7 +7,7 @@ type F5 = (a: string, b: string) => void; var f12: F1 | F2; f12("a"); f12("a", "b"); -f12("a", "b", "c"); // error +f12("a", "b", "c"); // ok var f34: F3 | F4; f34("a"); @@ -17,7 +17,7 @@ f34("a", "b", "c"); var f1234: F1 | F2 | F3 | F4; f1234("a"); f1234("a", "b"); -f1234("a", "b", "c"); // error +f1234("a", "b", "c"); // ok var f12345: F1 | F2 | F3 | F4 | F5; f12345("a"); // error diff --git a/tests/cases/conformance/types/union/unionTypeConstructSignatures.ts b/tests/cases/conformance/types/union/unionTypeConstructSignatures.ts index a02ba610ff7..8f38e38aee0 100644 --- a/tests/cases/conformance/types/union/unionTypeConstructSignatures.ts +++ b/tests/cases/conformance/types/union/unionTypeConstructSignatures.ts @@ -26,9 +26,9 @@ new unionOfDifferentNumberOfSignatures(10); // error - no call signatures new unionOfDifferentNumberOfSignatures("hello"); // error - no call signatures var unionWithDifferentParameterCount: { new (a: string): string; } | { new (a: string, b: number): number; }; -new unionWithDifferentParameterCount();// no call signature -new unionWithDifferentParameterCount("hello");// no call signature -new unionWithDifferentParameterCount("hello", 10);// no call signature +new unionWithDifferentParameterCount();// needs more args +new unionWithDifferentParameterCount("hello");// needs more args +new unionWithDifferentParameterCount("hello", 10);// ok var unionWithOptionalParameter1: { new (a: string, b?: number): string; } | { new (a: string, b?: number): number; }; strOrNum = new unionWithOptionalParameter1('hello'); @@ -44,8 +44,8 @@ strOrNum = new unionWithOptionalParameter2(); // error no call signature var unionWithOptionalParameter3: { new (a: string, b?: number): string; } | { new (a: string): number; }; strOrNum = new unionWithOptionalParameter3('hello'); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', 10); // error no call signature -strOrNum = new unionWithOptionalParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithOptionalParameter3('hello', 10); // ok +strOrNum = new unionWithOptionalParameter3('hello', "hello"); // wrong type strOrNum = new unionWithOptionalParameter3(); // error no call signature var unionWithRestParameter1: { new (a: string, ...b: number[]): string; } | { new (a: string, ...b: number[]): number }; @@ -64,7 +64,7 @@ strOrNum = new unionWithRestParameter2(); // error no call signature var unionWithRestParameter3: { new (a: string, ...b: number[]): string; } | { new (a: string): number }; strOrNum = new unionWithRestParameter3('hello'); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10); // error no call signature -strOrNum = new unionWithRestParameter3('hello', 10, 11); // error no call signature -strOrNum = new unionWithRestParameter3('hello', "hello"); // error no call signature +strOrNum = new unionWithRestParameter3('hello', 10); // ok +strOrNum = new unionWithRestParameter3('hello', 10, 11); // ok +strOrNum = new unionWithRestParameter3('hello', "hello"); // wrong type strOrNum = new unionWithRestParameter3(); // error no call signature \ No newline at end of file diff --git a/tests/cases/fourslash/completionEntryForUnionProperty2.ts b/tests/cases/fourslash/completionEntryForUnionProperty2.ts index c254213e473..1702465aa3e 100644 --- a/tests/cases/fourslash/completionEntryForUnionProperty2.ts +++ b/tests/cases/fourslash/completionEntryForUnionProperty2.ts @@ -17,7 +17,7 @@ verify.completions({ marker: "", exact: [ - { name: "toString", text: "(method) toString(): string", documentation: "Returns a string representation of a string.", }, + { name: "toString", text: "(method) toString(): string (+1 overload)", documentation: "Returns a string representation of a string.", }, { name: "valueOf", text: "(method) valueOf(): string | number", documentation: "Returns the primitive value of the specified object." }, ], }); From 4986091b328fe813ca69aa0fe28497e64b9a5584 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 20 Nov 2018 12:19:09 +0900 Subject: [PATCH 047/322] address comment --- src/tsc/tsc.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index 89e1d6b68dd..7548f2db072 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -133,13 +133,13 @@ namespace ts { if (configFileName) { const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic)!; // TODO: GH#18217 if (commandLineOptions.showConfig) { - updateReportDiagnostic(configParseResult.options); - configParseResult.errors.forEach(reportDiagnostic); - // tslint:disable-next-line:no-null-keyword - sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); if (configParseResult.errors.length !== 0) { + updateReportDiagnostic(configParseResult.options); + configParseResult.errors.forEach(reportDiagnostic); return sys.exit(ExitStatus.DiagnosticsPresent_OutputsGenerated); } + // tslint:disable-next-line:no-null-keyword + sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); return sys.exit(ExitStatus.Success); } updateReportDiagnostic(configParseResult.options); From ece46113a57313be331554806ccdfdbef4d4395e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 20 Nov 2018 01:52:42 -0500 Subject: [PATCH 048/322] Bump to 3.3. --- package.json | 2 +- src/compiler/core.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 86872c57c6b..3f5cb1223e9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "3.2.0", + "version": "3.3.0", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 4fe6674d3f5..f585ce2ec96 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,7 +1,7 @@ namespace ts { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - export const versionMajorMinor = "3.2"; + export const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ export const version = `${versionMajorMinor}.0-dev`; } From fdf37360d73524d14623d9f2751423a0dbccb8ba Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Tue, 20 Nov 2018 18:28:13 +0100 Subject: [PATCH 049/322] update API baselines with new version number --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index e67f6d36447..2b78178587e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index eb1e1760dfd..0e693f698f2 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } From 8ddb2b61d2c996ab442b282ab9b36195ed697c13 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 20 Nov 2018 12:28:45 -0500 Subject: [PATCH 050/322] Update LKG. --- lib/enu/diagnosticMessages.generated.json.lcg | 66 +- lib/tsc.js | 649 ++++++---- lib/tsserver.js | 1097 +++++++++++------ lib/tsserverlibrary.d.ts | 17 +- lib/tsserverlibrary.js | 1049 ++++++++++------ lib/typescript.d.ts | 9 +- lib/typescript.js | 953 ++++++++------ lib/typescriptServices.d.ts | 9 +- lib/typescriptServices.js | 953 ++++++++------ lib/typingsInstaller.js | 668 ++++++---- 10 files changed, 3401 insertions(+), 2069 deletions(-) diff --git a/lib/enu/diagnosticMessages.generated.json.lcg b/lib/enu/diagnosticMessages.generated.json.lcg index e4080a9bb37..61eb41991c4 100644 --- a/lib/enu/diagnosticMessages.generated.json.lcg +++ b/lib/enu/diagnosticMessages.generated.json.lcg @@ -51,6 +51,12 @@ + + + + + + @@ -63,12 +69,6 @@ - - - - - - @@ -693,6 +693,18 @@ + + + + + + + + + + + + @@ -705,12 +717,24 @@ + + + + + + + + + + + + @@ -1077,9 +1101,9 @@ - + - + @@ -1209,9 +1233,9 @@ - + - + @@ -1317,9 +1341,15 @@ - + - + + + + + + + @@ -4299,6 +4329,12 @@ + + + + + + @@ -5541,6 +5577,12 @@ + + + + + + diff --git a/lib/tsc.js b/lib/tsc.js index f04ae41349c..537612cb376 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -14,7 +14,8 @@ and limitations under the License. ***************************************************************************** */ -"use strict";"use strict"; +"use strict"; +"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { @@ -59,7 +60,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook }; var ts; (function (ts) { - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { @@ -3269,7 +3270,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -3376,7 +3377,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -3459,7 +3460,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -3490,7 +3491,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -3535,6 +3536,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -3634,6 +3636,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -4029,6 +4032,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -4124,6 +4128,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -4192,6 +4197,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -4370,11 +4378,23 @@ var ts; return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -9711,6 +9731,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 && kind <= 183) + || kind === 120 + || kind === 143 + || kind === 135 + || kind === 146 + || kind === 136 + || kind === 123 + || kind === 138 + || kind === 139 + || kind === 100 + || kind === 106 + || kind === 141 + || kind === 96 + || kind === 132 + || kind === 211 + || kind === 284 + || kind === 285 + || kind === 286 + || kind === 287 + || kind === 288 + || kind === 289 + || kind === 290; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -10952,6 +10997,10 @@ var ts; || kind === 17; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 || isTemplateLiteralKind(node.kind); } @@ -11106,32 +11155,8 @@ var ts; || kind === 159; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; - function isTypeNodeKind(kind) { - return (kind >= 163 && kind <= 183) - || kind === 120 - || kind === 143 - || kind === 135 - || kind === 146 - || kind === 136 - || kind === 123 - || kind === 138 - || kind === 139 - || kind === 100 - || kind === 106 - || kind === 141 - || kind === 96 - || kind === 132 - || kind === 211 - || kind === 284 - || kind === 285 - || kind === 286 - || kind === 287 - || kind === 288 - || kind === 289 - || kind === 290; - } function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -13335,53 +13360,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299: case 305: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300: - return visitNode(cbNode, node.typeExpression); - case 302: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304: - if (node.typeExpression && - node.typeExpression.kind === 283) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300: + case 302: case 301: - return visitNode(cbNode, node.typeExpression); case 298: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294: + case 296: + return visitNode(cbNode, node.tagName); case 308: return visitNode(cbNode, node.expression); } @@ -18751,6 +18769,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ { @@ -19202,18 +19232,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -23028,6 +23046,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -23957,7 +23976,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -25307,17 +25326,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -25345,6 +25354,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -25749,7 +25759,11 @@ var ts; (source.flags | target.flags) & 67108864) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) { target.constEnumOnlyModule = false; @@ -26191,7 +26205,7 @@ var ts; lastLocation = location; location = location.parent; } - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -26794,8 +26808,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -26823,7 +26837,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference); } return getMergedSymbol(sourceFile.symbol); @@ -27074,14 +27088,58 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } function getContainersOfSymbol(symbol, enclosingDeclaration) { var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920, false)) { - return ts.concatenate([container], additionalContainers); + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -27450,7 +27508,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4; } - var nodeFlags = 3112960; + var nodeFlags = 70221824; if (flags & 2) { nodeFlags |= 128; } @@ -27461,7 +27519,7 @@ var ts; nodeFlags |= 16384; } if (flags & 16) { - nodeFlags |= 67108864; + nodeFlags |= 134217728; } var builder = flags & 4 ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -27484,7 +27542,7 @@ var ts; else { sigOutput = kind === 1 ? 161 : 160; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4, sig, sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); @@ -27495,7 +27553,7 @@ var ts; if (flags === void 0) { flags = 1048576 | 16384; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | (noTruncation ? 1 : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | (noTruncation ? 1 : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -27545,7 +27603,7 @@ var ts; var context = { enclosingDeclaration: enclosingDeclaration, flags: flags || 0, - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -27790,11 +27848,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832); } else { - context.approximateLength += 3; - if (!(context.flags & 1)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), undefined); - } - return ts.createKeywordTypeNode(120); + return createElidedInformationPlaceholder(context); } } else { @@ -27806,11 +27860,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), undefined); - } - return ts.createKeywordTypeNode(120); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -27986,10 +28036,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1, context)); @@ -28020,8 +28075,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), undefined); + } + return ts.createKeywordTypeNode(120); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 && context.flags & 33554432 ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -28050,8 +28113,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048) ? 33554432 : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120); + context.flags |= propertyIsReverseMapped ? 33554432 : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133)] : undefined; if (modifiers) { @@ -28225,7 +28294,7 @@ var ts; context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); var chain; var isTypeParameter = symbol.flags & 262144; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64) && !(context.flags & 67108864)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64) && !(context.flags & 134217728)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, true)); ts.Debug.assert(chain && chain.length > 0); } @@ -28235,12 +28304,21 @@ var ts; return chain; function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -28259,6 +28337,21 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + return -1; + } + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -28337,6 +28430,12 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -28472,7 +28571,7 @@ var ts; if (flags === void 0) { flags = 16384; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4, predicate, sourceFile, writer); @@ -29734,7 +29833,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -29782,7 +29881,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -32667,7 +32766,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 100); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -35651,10 +35750,7 @@ var ts; sourceHasRestParameter === targetHasRestParameter) { return true; } - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -35744,6 +35840,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { return ts.getObjectFlags(type) & 4 && (type.target === globalArrayType || type.target === globalReadonlyArrayType) || !(type.flags & 98304) && isTypeAssignableTo(type, anyReadonlyArrayType); @@ -36075,6 +36174,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832, undefined, param.name.escapedText, true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -38177,7 +38286,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -39374,6 +39488,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2) : undefinedType; return createIndexInfo(unionType, false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); checkGrammarObjectLiteralExpression(node, inDestructuringPattern); @@ -39763,13 +39888,28 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { - var signatures = getSignaturesOfType(elementType, 1); - if (signatures.length === 0) { - signatures = getSignaturesOfType(elementType, 0); + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4) { + return [anySignature]; } - if (signatures.length === 0 && elementType.flags & 1048576) { - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + else if (elementType.flags & 128) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); + var signatures = getSignaturesOfType(apparentElemType, 1); + if (signatures.length === 0) { + signatures = getSignaturesOfType(apparentElemType, 0); + } + if (signatures.length === 0 && apparentElemType.flags & 1048576) { + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -40071,7 +40211,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -40239,7 +40379,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 && !(prop.flags & 32768))) { @@ -41351,20 +41491,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -42796,8 +42924,16 @@ var ts; leftType; case 59: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288) || + declKind !== 2 && + declKind !== 6 && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1)) { + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -42812,10 +42948,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32) { @@ -44526,7 +44661,7 @@ var ts; } } function registerForUnusedIdentifiersCheck(node) { - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -44545,9 +44680,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279: case 244: case 218: @@ -44575,9 +44707,12 @@ var ts; case 165: case 166: case 242: - case 176: + case 241: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -44592,72 +44727,68 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156: - case 154: - case 158: - case 159: - if (member.kind === 159 && member.symbol.flags & 32768) { - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8)) { - addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156: + case 154: + case 158: + case 159: + if (member.kind === 159 && member.symbol.flags & 32768) { break; - case 157: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { - addDiagnostic(parameter, 0, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8)) { + addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { + addDiagnostic(parameter, 0, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162: - case 217: - break; - default: - ts.Debug.fail(); - } + } + break; + case 162: + case 217: + break; + default: + ts.Debug.fail(); } } } - function checkUnusedTypeParameters(node, addDiagnostic) { - if (node.flags & 4194304 || node.kind !== 176 && ts.last(getSymbolOfNode(node).declarations) !== node) - return; - if (node.kind === 176) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); - } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - ? ts.rangeOfNode(parent) - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); + } + function checkUnusedTypeParameters(node, addDiagnostic) { + if (ts.last(getSymbolOfNode(node).declarations) !== node) + return; + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + ? ts.rangeOfNode(parent) + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); } } + else { + addDiagnostic(typeParameter, 1, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); + } } } function isTypeParameterUnused(typeParameter) { @@ -45006,9 +45137,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); - markPropertyAsReferenced(property, undefined, false); - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98, parentType, property); + if (property) { + markPropertyAsReferenced(property, undefined, false); + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98, parentType, property); } } } @@ -45861,7 +45992,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -47297,7 +47428,10 @@ var ts; return undefined; } if (isDeclarationNameOrImportPropertyName(node)) { - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -54576,7 +54710,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -54585,7 +54719,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -64530,6 +64664,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -64613,6 +64748,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -67287,7 +67427,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -67984,7 +68124,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -70162,6 +70302,7 @@ var ts; var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? ts.createMap() : undefined; var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2) { @@ -71319,14 +71460,19 @@ var ts; ts.getOutputDeclarationFileName(fileName, referencedProject.commandLine); } function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -73308,6 +73454,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -74879,6 +75026,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); if (syntaxDiagnostics.length) { @@ -74924,11 +75074,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } @@ -75414,10 +75570,13 @@ var ts; if (buildOptions.watch) { reportWatchModeWithoutSysSupport(); } - // TODO: change this to host if watch => watchHost otherwiue without wathc - var builder = ts.createSolutionBuilder(buildOptions.watch ? + // TODO: change this to host if watch => watchHost otherwiue without watch + var buildHost = buildOptions.watch ? ts.createSolutionBuilderWithWatchHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createWatchStatusReporter()) : - ts.createSolutionBuilderHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createReportErrorSummary(buildOptions)), projects, buildOptions); + ts.createSolutionBuilderHost(ts.sys, reportDiagnostic, ts.createBuilderStatusReporter(ts.sys, shouldBePretty()), createReportErrorSummary(buildOptions)); + buildHost.beforeCreateProgram = enableStatistics; + buildHost.afterProgramEmitAndDiagnostics = reportStatistics; + var builder = ts.createSolutionBuilder(buildHost, projects, buildOptions); if (buildOptions.clean) { return ts.sys.exit(builder.cleanAllProjects()); } diff --git a/lib/tsserver.js b/lib/tsserver.js index 2e2de2b5623..d7f25907257 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -86,7 +86,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); @@ -3064,13 +3064,15 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + // Errors (cont.) + NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 70221824] = "IgnoreErrors"; // State NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; - /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 67108864] = "DoNotIncludeSymbolChain"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -5262,7 +5264,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -5369,7 +5371,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -5452,7 +5454,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -5483,7 +5485,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -5528,6 +5530,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5627,6 +5630,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -6022,6 +6026,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6117,6 +6122,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -6185,6 +6191,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -6414,11 +6423,28 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + /* @internal */ + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -8070,7 +8096,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/** Non-internal stuff goes here */ var ts; (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -12355,6 +12380,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) + || kind === 120 /* AnyKeyword */ + || kind === 143 /* UnknownKeyword */ + || kind === 135 /* NumberKeyword */ + || kind === 146 /* BigIntKeyword */ + || kind === 136 /* ObjectKeyword */ + || kind === 123 /* BooleanKeyword */ + || kind === 138 /* StringKeyword */ + || kind === 139 /* SymbolKeyword */ + || kind === 100 /* ThisKeyword */ + || kind === 106 /* VoidKeyword */ + || kind === 141 /* UndefinedKeyword */ + || kind === 96 /* NullKeyword */ + || kind === 132 /* NeverKeyword */ + || kind === 211 /* ExpressionWithTypeArguments */ + || kind === 284 /* JSDocAllType */ + || kind === 285 /* JSDocUnknownType */ + || kind === 286 /* JSDocNullableType */ + || kind === 287 /* JSDocNonNullableType */ + || kind === 288 /* JSDocOptionalType */ + || kind === 289 /* JSDocFunctionType */ + || kind === 290 /* JSDocVariadicType */; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -13823,6 +13873,10 @@ var ts; || kind === 17 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } @@ -13991,37 +14045,13 @@ var ts; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type - function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 284 /* JSDocAllType */ - || kind === 285 /* JSDocUnknownType */ - || kind === 286 /* JSDocNullableType */ - || kind === 287 /* JSDocNonNullableType */ - || kind === 288 /* JSDocOptionalType */ - || kind === 289 /* JSDocFunctionType */ - || kind === 290 /* JSDocVariadicType */; - } /** * Node test that determines whether a node is a valid type node. * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* * of a TypeNode. */ function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -16542,53 +16572,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299 /* JSDocParameterTag */: case 305 /* JSDocPropertyTag */: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 302 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295 /* JSDocAugmentsTag */: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303 /* JSDocTemplateTag */: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304 /* JSDocTypedefTag */: - if (node.typeExpression && - node.typeExpression.kind === 283 /* JSDocTypeExpression */) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 /* JSDocTypeExpression */ + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297 /* JSDocCallbackTag */: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300 /* JSDocReturnTag */: + case 302 /* JSDocTypeTag */: case 301 /* JSDocThisTag */: - return visitNode(cbNode, node.typeExpression); case 298 /* JSDocEnumTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293 /* JSDocSignature */: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292 /* JSDocTypeLiteral */: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294 /* JSDocTag */: + case 296 /* JSDocClassTag */: + return visitNode(cbNode, node.tagName); case 308 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } @@ -23291,6 +23314,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23754,18 +23789,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -28236,6 +28259,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -29349,7 +29373,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -30921,17 +30945,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -30961,6 +30975,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -31510,7 +31525,11 @@ var ts; (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432 /* Transient */)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { @@ -32074,7 +32093,7 @@ var ts; // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -32769,8 +32788,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -32798,7 +32817,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations @@ -33069,6 +33088,50 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + // Try to make an import using an import already in the enclosing file, if possible + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached) + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } /** * Attempts to find the symbol corresponding to the container a symbol is in - usually this * is just its' `.parent`, but for locals, this value is `undefined` @@ -33077,10 +33140,12 @@ var ts; var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) { - return ts.concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); // This order expresses a preference for the real container if it is in scope } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -33519,7 +33584,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } - var nodeFlags = 3112960 /* IgnoreErrors */; + var nodeFlags = 70221824 /* IgnoreErrors */; if (flags & 2 /* UseOnlyExternalAliasing */) { nodeFlags |= 128 /* UseOnlyExternalAliasing */; } @@ -33530,7 +33595,7 @@ var ts; nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (flags & 16 /* DoNotIncludeSymbolChain */) { - nodeFlags |= 67108864 /* DoNotIncludeSymbolChain */; + nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */; } var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -33553,7 +33618,7 @@ var ts; else { sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); // TODO: GH#18217 @@ -33564,7 +33629,7 @@ var ts; if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -33615,7 +33680,7 @@ var ts; enclosingDeclaration: enclosingDeclaration, flags: flags || 0 /* None */, // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 /* DoNotIncludeSymbolChain */ ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -33868,11 +33933,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832 /* Type */); } else { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } } else { @@ -33886,11 +33947,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -34075,10 +34132,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048 /* ReverseMapped */) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -34109,8 +34171,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1 /* NoTruncation */)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); + } + return ts.createKeywordTypeNode(120 /* AnyKeyword */); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -34140,8 +34210,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; if (modifiers) { @@ -34327,7 +34403,7 @@ var ts; // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 67108864 /* DoNotIncludeSymbolChain */)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true)); ts.Debug.assert(chain && chain.length > 0); } @@ -34338,13 +34414,22 @@ var ts; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -34367,6 +34452,24 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + // Both relative or both non-relative, sort by number of parts + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + // A is non-relative, B is relative: prefer A + return -1; + } + // A is relative, B is non-relative: prefer B + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -34455,6 +34558,14 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error + // since declaration files with these kinds of references are liable to fail when published :( + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -34591,7 +34702,7 @@ var ts; if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); @@ -36016,7 +36127,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -36072,7 +36183,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -39372,7 +39483,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -42773,12 +42884,8 @@ var ts; return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -42884,6 +42991,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -43256,6 +43366,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151 /* Parameter */: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -45657,7 +45777,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3 /* Variable */) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -47142,6 +47267,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking @@ -47609,16 +47745,31 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4 /* String */) { + return [anySignature]; + } + else if (elementType.flags & 128 /* StringLiteral */) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); // Resolve the signatures, preferring constructor - var signatures = getSignaturesOfType(elementType, 1 /* Construct */); + var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); if (signatures.length === 0) { // No construct signatures, try call signatures - signatures = getSignaturesOfType(elementType, 0 /* Call */); + signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); } - if (signatures.length === 0 && elementType.flags & 1048576 /* Union */) { + if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { // If each member has some combination of new/call signatures; make a union signature list for those - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -47991,7 +48142,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -48190,7 +48341,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { @@ -49559,20 +49710,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128 /* StringLiteral */) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 /* String */ || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -51197,8 +51336,17 @@ var ts; leftType; case 59 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288 /* Object */) || + declKind !== 2 /* ModuleExports */ && + declKind !== 6 /* Prototype */ && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1 /* Class */)) { + // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -51213,10 +51361,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2 /* ModuleExports */) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32 /* Class */) { @@ -53281,7 +53428,7 @@ var ts; } function registerForUnusedIdentifiersCheck(node) { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304 /* Ambient */)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -53302,9 +53449,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279 /* SourceFile */: case 244 /* ModuleDeclaration */: case 218 /* Block */: @@ -53321,7 +53465,7 @@ var ts; case 156 /* MethodDeclaration */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -53332,9 +53476,12 @@ var ts; case 165 /* FunctionType */: case 166 /* ConstructorType */: case 242 /* TypeAliasDeclaration */: - case 176 /* InferType */: + case 241 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176 /* InferType */: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -53349,77 +53496,73 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304 /* Ambient */)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - // Already would have reported an error on the getter. - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156 /* MethodDeclaration */: + case 154 /* PropertyDeclaration */: + case 158 /* GetAccessor */: + case 159 /* SetAccessor */: + if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. break; - case 157 /* Constructor */: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { - addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157 /* Constructor */: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { + addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: - // Can't be private - break; - default: - ts.Debug.fail(); - } + } + break; + case 162 /* IndexSignature */: + case 217 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + } + } function checkUnusedTypeParameters(node, addDiagnostic) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & 4194304 /* Ambient */ || node.kind !== 176 /* InferType */ && ts.last(getSymbolOfNode(node).declarations) !== node) + if (ts.last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === 176 /* InferType */) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + // Whole @template tag + ? ts.rangeOfNode(parent) + // Include the `<>` in the error message + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - // Whole @template tag - ? ts.rangeOfNode(parent) - // Include the `<>` in the error message - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } @@ -53840,9 +53983,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); } } } @@ -54900,7 +55043,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -56506,7 +56649,10 @@ var ts; } if (isDeclarationNameOrImportPropertyName(node)) { // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -64714,7 +64860,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -64723,7 +64869,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -79713,6 +79859,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -79801,6 +79948,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -82788,7 +82940,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -83526,7 +83678,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -85980,6 +86132,7 @@ var ts; // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2 /* Completely */) { @@ -87338,15 +87491,20 @@ var ts; * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -89709,6 +89867,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -91451,6 +91610,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); @@ -91500,11 +91662,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } @@ -91899,12 +92067,6 @@ var ts; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); /* @internal */ ts.emptyOptions = {}; - var TextChange = /** @class */ (function () { - function TextChange() { - } - return TextChange; - }()); - ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -92368,6 +92530,10 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; + function isTagName(node) { + return ts.isJSDocTag(node.parent) && node.parent.tagName === node; + } + ts.isTagName = isTagName; function isRightSideOfQualifiedName(node) { return node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node; } @@ -93258,6 +93424,7 @@ var ts; ts.createTextChange = createTextChange; ts.typeKeywords = [ 120 /* AnyKeyword */, + 146 /* BigIntKeyword */, 123 /* BooleanKeyword */, 87 /* FalseKeyword */, 129 /* KeyOfKeyword */, @@ -93691,9 +93858,7 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { - return !!location.parent && - (location.parent.kind === 253 /* ImportSpecifier */ || location.parent.kind === 257 /* ExportSpecifier */) && - location.parent.propertyName === location; + return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; /** @@ -95115,26 +95280,21 @@ var ts; * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option */ - function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { // Make all paths absolute/normalized if they are not already rootDirs = rootDirs.map(function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); // Determine the path to the directory containing the script relative to the root directory it is contained within var relativeDirectory = ts.firstDefined(rootDirs, function (rootDirectory) { - return ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase) ? scriptPath.substr(rootDirectory.length) : undefined; + return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined; }); // TODO: GH#18217 // Now find a path for each potential directory that is to be merged with the one containing the script - return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); + return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensionOptions, compilerOptions, host, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - var result = []; - for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { - var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude, result); - } - return result; + var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return ts.flatMap(baseDirectories, function (baseDirectory) { return getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude); }); } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. @@ -96365,7 +96525,8 @@ var ts; position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; isInSnippetScope = isSnippetScope(scopeNode); - var symbolMeanings = 67897832 /* Type */ | 67220415 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + var isTypeOnly = isTypeOnlyCompletion(); + var symbolMeanings = (isTypeOnly ? 0 /* None */ : 67220415 /* Value */) | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 279 /* SourceFile */) { @@ -96414,9 +96575,9 @@ var ts; } } function filterGlobalCompletion(symbols) { - var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - if (isTypeOnlyCompletion) + var isTypeOnly = isTypeOnlyCompletion(); + var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + if (isTypeOnly) keywordFilters = 6 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -96432,7 +96593,7 @@ var ts; if (allowTypes) { // Its a type, but you can reach it by namespace.type as well var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); - if (symbolAllowedAsType || isTypeOnlyCompletion) { + if (symbolAllowedAsType || isTypeOnly) { return symbolAllowedAsType; } } @@ -96441,6 +96602,9 @@ var ts; return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */); }); } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 104 /* TypeOfKeyword */ && @@ -96826,6 +96990,7 @@ var ts; if (contextToken) { var parent = contextToken.parent; switch (contextToken.kind) { + case 30 /* GreaterThanToken */: // End of a type argument list case 29 /* LessThanSlashToken */: case 42 /* SlashToken */: case 72 /* Identifier */: @@ -96834,6 +96999,11 @@ var ts; case 267 /* JsxAttribute */: case 269 /* JsxSpreadAttribute */: if (parent && (parent.kind === 261 /* JsxSelfClosingElement */ || parent.kind === 262 /* JsxOpeningElement */)) { + if (contextToken.kind === 30 /* GreaterThanToken */) { + var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); + if (!parent.typeArguments || (precedingToken && precedingToken.kind === 42 /* SlashToken */)) + break; + } return parent; } else if (parent.kind === 267 /* JsxAttribute */) { @@ -98252,7 +98422,7 @@ var ts; return undefined; } var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); - return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + return { kind: 0 /* Import */, symbol: lhsSymbol }; } else { return exportInfo(symbol, getExportKindForDeclaration(exportNode)); @@ -98322,7 +98492,7 @@ var ts; // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = ts.symbolEscapedNameNoDefault(importedSymbol); if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { - return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + return { kind: 0 /* Import */, symbol: importedSymbol }; } } function exportInfo(symbol, kind) { @@ -98367,18 +98537,16 @@ var ts; var parent = node.parent; switch (parent.kind) { case 248 /* ImportEqualsDeclaration */: - return parent.name === node && isExternalModuleImportEquals(parent) - ? { isNamedImport: false } - : undefined; + return parent.name === node && isExternalModuleImportEquals(parent); case 253 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. - return parent.propertyName ? undefined : { isNamedImport: true }; + return !parent.propertyName; case 250 /* ImportClause */: case 251 /* NamespaceImport */: ts.Debug.assert(parent.name === node); - return { isNamedImport: false }; + return true; default: - return undefined; + return false; } } function getExportInfo(exportSymbol, exportKind, checker) { @@ -98496,7 +98664,7 @@ var ts; } } function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { - return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node); }); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node, program.getTypeChecker()); }); } FindAllReferences.findReferenceOrRenameEntries = findReferenceOrRenameEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { @@ -98550,8 +98718,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode)); + function toRenameLocation(entry, originalNode, checker) { + return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98580,25 +98748,27 @@ var ts; return { textSpan: getTextSpan(entry.node, sourceFile), fileName: sourceFile.fileName }; } } - function getPrefixAndSuffixText(entry, originalNode) { + function getPrefixAndSuffixText(entry, originalNode, checker) { if (entry.kind !== 0 /* Span */ && ts.isIdentifier(originalNode)) { var node = entry.node, kind = entry.kind; var name = originalNode.text; var isShorthandAssignment = ts.isShorthandPropertyAssignment(node.parent); if (isShorthandAssignment || ts.isObjectBindingElementWithoutPropertyName(node.parent)) { - if (kind === 3 /* SearchedLocalFoundProperty */) { - return { prefixText: name + ": " }; - } - else if (kind === 4 /* SearchedPropertyFoundLocal */) { - return { suffixText: ": " + name }; - } - else { - return isShorthandAssignment + var prefixColon = { prefixText: name + ": " }; + var suffixColon = { suffixText: ": " + name }; + return kind === 3 /* SearchedLocalFoundProperty */ ? prefixColon + : kind === 4 /* SearchedPropertyFoundLocal */ ? suffixColon // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol. - ? { suffixText: ": " + name } // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol. - : { prefixText: name + ": " }; - } + : isShorthandAssignment ? suffixColon : prefixColon; + } + else if (ts.isImportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + // If the original symbol was using this alias, just rename the alias. + var originalSymbol = ts.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return ts.contains(originalSymbol.declarations, entry.node.parent) ? { prefixText: name + " as " } : ts.emptyOptions; + } + else if (ts.isExportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + return originalNode === entry.node ? { prefixText: name + " as " } : { suffixText: " as " + name }; } } return ts.emptyOptions; @@ -98853,13 +99023,18 @@ var ts; return undefined; } /** Core find-all-references algorithm for a normal symbol. */ - function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - symbol = node && skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - if (node && node.kind === 80 /* DefaultKeyword */) { + var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + if (exportSpecifier) { + // When renaming at an export specifier, rename the export and not the thing being exported. + getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); + } + else if (node && node.kind === 80 /* DefaultKeyword */) { addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } @@ -98897,15 +99072,11 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { var parent = node.parent; - if (ts.isExportSpecifier(parent)) { + if (ts.isExportSpecifier(parent) && !isForRename) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } - if (ts.isImportSpecifier(parent) && parent.propertyName === node) { - // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. - return checker.getImmediateAliasedSymbol(symbol); - } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { @@ -99068,7 +99239,8 @@ var ts; var indirectUser = indirectUsers_2[_b]; for (var _c = 0, _d = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName); _c < _d.length; _c++) { var node = _d[_c]; - if (ts.isIdentifier(node) && checker.getSymbolAtLocation(node) === exportSymbol) { + // Import specifiers should be handled by importSearches + if (ts.isIdentifier(node) && !ts.isImportOrExportSpecifier(node.parent) && checker.getSymbolAtLocation(node) === exportSymbol) { cb(node); } } @@ -99084,7 +99256,7 @@ var ts; if (!ts.isIdentifier(singleRef)) return false; // At `default` in `import { default as x }` or `export { default as x }`, do add a reference, but do not rename. - return !((ts.isExportSpecifier(singleRef.parent) || ts.isImportSpecifier(singleRef.parent)) && singleRef.escapedText === "default" /* Default */); + return !(ts.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default" /* Default */); } // Go to the symbol we imported from and find references for it. function searchForImportedSymbol(symbol, state) { @@ -99363,16 +99535,16 @@ var ts; } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } - function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere) { + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); - if (!search.includes(localSymbol)) { + if (!alwaysGetReferences && !search.includes(localSymbol)) { return; } if (!propertyName) { // Don't rename at `export { default } from "m";`. (but do continue to search for imports of the re-export) - if (!(state.options.isForRename && name.escapedText === "default" /* Default */)) { + if (!(state.options.isForRename && (name.escapedText === "default" /* Default */))) { addRef(); } } @@ -99383,7 +99555,7 @@ var ts; addRef(); } if (addReferencesHere && !state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, state); + addReference(name, ts.Debug.assertDefined(exportSpecifier.symbol), state); } } else { @@ -99392,15 +99564,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!(referenceLocation === propertyName && state.options.isForRename)) { + if (!state.options.isForRename || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; - var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); - if (!exportInfo) - return ts.Debug.fail(); - searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); + var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99432,12 +99603,11 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename || importOrExport.isNamedImport) { + if (!state.options.isForRename) { searchForImportedSymbol(symbol, state); } } else { - // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); } } @@ -103435,7 +103605,7 @@ var ts; function getEnclosingDeclarationFromInvocation(invocation) { return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node; } - var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; function createSignatureHelpItems(candidates, resolvedSignature, _a, sourceFile, typeChecker) { var isTypeParameterList = _a.isTypeParameterList, argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex; var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); @@ -104601,16 +104771,11 @@ var ts; this.options = options; } FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - ts.Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; + this.currentTokenSpan = ts.Debug.assertDefined(currentRange); + this.currentTokenParent = ts.Debug.assertDefined(currentTokenParent); + this.nextTokenSpan = ts.Debug.assertDefined(nextRange); + this.nextTokenParent = ts.Debug.assertDefined(nextTokenParent); + this.contextNode = ts.Debug.assertDefined(commonParent); // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; @@ -107336,7 +107501,6 @@ var ts; }; ChangeTracker.prototype.deleteRange = function (sourceFile, range) { this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); - return this; }; ChangeTracker.prototype.delete = function (sourceFile, node) { this.deletedNodes.push({ sourceFile: sourceFile, node: node }); @@ -107349,7 +107513,6 @@ var ts; var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - return this; }; ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) { if (options === void 0) { options = {}; } @@ -107360,11 +107523,10 @@ var ts; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); - return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } @@ -107373,18 +107535,17 @@ var ts; ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); - return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); }; ChangeTracker.prototype.replaceNodeWithText = function (sourceFile, oldNode, text) { this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, textChanges_3.useNonAdjustedPositions), text); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); }; ChangeTracker.prototype.nextCommaToken = function (sourceFile, node) { var next = ts.findNextToken(node, node.parent, sourceFile); @@ -107392,7 +107553,7 @@ var ts; }; ChangeTracker.prototype.replacePropertyAssignment = function (sourceFile, oldNode, newNode) { var suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ("," + this.newLineCharacter); - return this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); + this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } @@ -107641,11 +107802,11 @@ var ts; if (containingList === void 0) { containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); } if (!containingList) { ts.Debug.fail("node is not a list element"); - return this; + return; } var index = ts.indexOfNode(containingList, after); if (index < 0) { - return this; + return; } var end = after.getEnd(); if (index !== containingList.length - 1) { @@ -107743,7 +107904,6 @@ var ts; this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " }); } } - return this; }; ChangeTracker.prototype.finishClassesWithNodesInsertedAtStart = function () { var _this = this; @@ -108440,6 +108600,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addNameToNamelessParameter"; + var errorCodes = [ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_parameter_name, fixId, ts.Diagnostics.Add_names_to_all_parameters_without_names)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, + }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos); + if (!ts.isIdentifier(token)) { + return ts.Debug.fail("add-name-to-nameless-parameter operates on identifiers, but got a " + ts.formatSyntaxKind(token.kind)); + } + var param = token.parent; + if (!ts.isParameter(param)) { + return ts.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts.formatSyntaxKind(token.kind)); + } + var i = param.parent.parameters.indexOf(param); + ts.Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); + ts.Debug.assert(i > -1, "Parameter not found in parent parameter list."); + var replacement = ts.createParameter( + /*decorators*/ undefined, param.modifiers, param.dotDotDotToken, "arg" + i, param.questionToken, ts.createTypeReferenceNode(token, /*typeArguments*/ undefined), param.initializer); + changeTracker.replaceNode(sourceFile, token, replacement); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -108960,9 +109154,8 @@ var ts; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } - var isConstructor = declaration.kind === 157 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []); + return declaration.parameters.map(function (parameter, parameterIndex) { var types = []; var isRest = ts.isRestParameter(parameter); var isOptional = false; @@ -108982,7 +109175,8 @@ var ts; } } if (ts.isIdentifier(parameter.name)) { - types.push.apply(types, inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken)); + var inferred = inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken); + types.push.apply(types, (isRest ? ts.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred)); } var type = unifyFromContext(types, checker); return { @@ -109054,8 +109248,7 @@ var ts; usageContext.isNumber = true; break; case 38 /* PlusToken */: - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; break; // case SyntaxKind.ExclamationToken: // no inferences here; @@ -109117,8 +109310,7 @@ var ts; usageContext.isString = true; } else { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; } break; // AssignmentOperators @@ -109183,8 +109375,7 @@ var ts; } function inferTypeFromPropertyElementExpressionContext(parent, node, checker, usageContext) { if (node === parent.argumentExpression) { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; return; } else { @@ -109199,18 +109390,48 @@ var ts; } } } + function removeLowPriorityInferences(inferences, priorities) { + var toRemove = []; + for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) { + var i = inferences_1[_i]; + for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) { + var _b = priorities_1[_a], high = _b.high, low = _b.low; + if (high(i)) { + ts.Debug.assert(!low(i)); + toRemove.push(low); + } + } + } + return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); }); + } function unifyFromContext(inferences, checker, fallback) { if (fallback === void 0) { fallback = checker.getAnyType(); } if (!inferences.length) return fallback; - var hasNonVacuousType = inferences.some(function (i) { return !(i.flags & (1 /* Any */ | 16384 /* Void */)); }); - var hasNonVacuousNonAnonymousType = inferences.some(function (i) { return !(i.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); - var anons = inferences.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); - var good = []; - if (!hasNonVacuousNonAnonymousType && anons.length) { + // 1. string or number individually override string | number + // 2. non-any, non-void overrides any or void + // 3. non-nullable, non-any, non-void, non-anonymous overrides anonymous types + var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + var priorities = [ + { + high: function (t) { return t === checker.getStringType() || t === checker.getNumberType(); }, + low: function (t) { return t === stringNumber; } + }, + { + high: function (t) { return !(t.flags & (1 /* Any */ | 16384 /* Void */)); }, + low: function (t) { return !!(t.flags & (1 /* Any */ | 16384 /* Void */)); } + }, + { + high: function (t) { return !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(t) & 16 /* Anonymous */); }, + low: function (t) { return !!(checker.getObjectFlags(t) & 16 /* Anonymous */); } + } + ]; + var good = removeLowPriorityInferences(inferences, priorities); + var anons = good.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); + if (anons.length) { + good = good.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); good.push(unifyAnonymousTypes(anons, checker)); } - good.push.apply(good, inferences.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */) && !(hasNonVacuousType && i.flags & (1 /* Any */ | 16384 /* Void */)); })); return checker.getWidenedType(checker.getUnionType(good)); } InferFromReference.unifyFromContext = unifyFromContext; @@ -109258,6 +109479,9 @@ var ts; if (usageContext.isString) { types.push(checker.getStringType()); } + if (usageContext.isNumberOrString) { + types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } types.push.apply(types, (usageContext.candidateTypes || []).map(function (t) { return checker.getBaseTypeOfLiteralType(t); })); if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); // TODO: GH#18217 @@ -109268,7 +109492,7 @@ var ts; types.push(checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker))); } if (usageContext.numberIndexContext) { - return [checker.createArrayType(recur(usageContext.numberIndexContext))]; + types.push(checker.createArrayType(recur(usageContext.numberIndexContext))); } else if (usageContext.properties || usageContext.callContexts || usageContext.constructContexts || usageContext.stringIndexContext) { var members_1 = ts.createUnderscoreEscapedMap(); @@ -111432,6 +111656,40 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "addMissingNewOperator"; + var errorCodes = [ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingNewOperator(t, sourceFile, span); }); + return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_missing_new_operator_to_call, fixId, ts.Diagnostics.Add_missing_new_operator_to_all_calls)]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return addMissingNewOperator(changes, context.sourceFile, diag); + }); }, + }); + function addMissingNewOperator(changes, sourceFile, span) { + var call = ts.cast(findAncestorMatchingSpan(sourceFile, span), ts.isCallExpression); + var newExpression = ts.createNew(call.expression, call.typeArguments, call.arguments); + changes.replaceNode(sourceFile, call, newExpression); + } + function findAncestorMatchingSpan(sourceFile, span) { + var token = ts.getTokenAtPosition(sourceFile, span.start); + var end = ts.textSpanEnd(span); + while (token.end < end) { + token = token.parent; + } + return token; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -115010,7 +115268,7 @@ var ts; // readonly modifier only existed in classLikeDeclaration var constructor = ts.getFirstConstructorWithBody(container); if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName); + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); } } else { @@ -115063,7 +115321,7 @@ var ts; isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), container: declaration.kind === 151 /* Parameter */ ? declaration.parent.parent : declaration.parent, - originalName: declaration.name, + originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, accessorName: accessorName, @@ -115114,22 +115372,23 @@ var ts; ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); } - function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName) { + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { if (!constructor.body) return; - var file = context.file, program = context.program, cancellationToken = context.cancellationToken; - var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) { - return (entry.kind !== 0 /* Span */ && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined; - }); - ts.forEach(referenceEntries, function (entry) { - var parent = entry.parent; - var accessorName = ts.createIdentifier(fieldName.text); - var node = ts.isBinaryExpression(parent) - ? ts.updateBinary(parent, accessorName, parent.right, parent.operatorToken) - : ts.isPropertyAccessExpression(parent) - ? ts.updatePropertyAccess(parent, parent.expression, accessorName) - : ts.Debug.fail("Unexpected write access token"); - changeTracker.replaceNode(file, parent, node); + constructor.body.forEachChild(function recur(node) { + if (ts.isElementAccessExpression(node) && + node.expression.kind === 100 /* ThisKeyword */ && + ts.isStringLiteral(node.argumentExpression) && + node.argumentExpression.text === originalName && + ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, ts.createStringLiteral(fieldName)); + } + if (ts.isPropertyAccessExpression(node) && node.expression.kind === 100 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, ts.createIdentifier(fieldName)); + } + if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { + node.forEachChild(recur); + } }); } })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {})); @@ -117071,7 +117330,7 @@ var ts; function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 72 /* Identifier */: - return !ts.isLabelName(node); + return !ts.isLabelName(node) && !ts.isTagName(node); case 189 /* PropertyAccessExpression */: case 148 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` @@ -117653,7 +117912,7 @@ var ts; function initializeNameTable(sourceFile) { var nameTable = sourceFile.nameTable = ts.createUnderscoreEscapedMap(); sourceFile.forEachChild(function walk(node) { - if (ts.isIdentifier(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { + if (ts.isIdentifier(node) && !ts.isTagName(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { var text = ts.getEscapedTextOfIdentifierOrLiteral(node); nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); } @@ -118567,9 +118826,15 @@ var ts; if ("directoryExists" in this.shimHost) { this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; } + else { + this.directoryExists = undefined; // TODO: GH#18217 + } if ("realpath" in this.shimHost) { this.realpath = function (path) { return _this.shimHost.realpath(path); }; // TODO: GH#18217 } + else { + this.realpath = undefined; // TODO: GH#18217 + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) { var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217 @@ -119864,6 +120129,9 @@ var ts; this.host = host; this.fileName = fileName; this.info = info; + this.isOpen = false; + this.ownFileText = false; + this.pendingReloadFromDisk = false; this.version = initialVersion || { svc: 0, text: 0 }; } TextStorage.prototype.getVersion = function () { @@ -119881,6 +120149,7 @@ var ts; this.svc = undefined; this.text = newText; this.lineMap = undefined; + this.fileSize = undefined; this.version.text++; }; TextStorage.prototype.edit = function (start, end, newText) { @@ -119888,6 +120157,7 @@ var ts; this.ownFileText = false; this.text = undefined; this.lineMap = undefined; + this.fileSize = undefined; }; TextStorage.prototype.reload = function (newText) { ts.Debug.assert(newText !== undefined); @@ -119897,9 +120167,12 @@ var ts; this.ownFileText = false; return true; } + return false; }; TextStorage.prototype.reloadWithFileText = function (tempFileName) { - var reloaded = this.reload(this.getFileText(tempFileName)); + var _a = this.getFileTextAndSize(tempFileName), newText = _a.text, fileSize = _a.fileSize; + var reloaded = this.reload(newText); + this.fileSize = fileSize; this.ownFileText = !tempFileName || tempFileName === this.fileName; return reloaded; }; @@ -119912,6 +120185,15 @@ var ts; TextStorage.prototype.delayReloadFromFileIntoText = function () { this.pendingReloadFromDisk = true; }; + TextStorage.prototype.getTelemetryFileSize = function () { + return !!this.fileSize + ? this.fileSize + : !!this.text + ? this.text.length + : !!this.svc + ? this.svc.getSnapshot().getLength() + : this.getSnapshot().getLength(); + }; TextStorage.prototype.getSnapshot = function () { return this.useScriptVersionCacheIfValidOrOpen() ? this.svc.getSnapshot() @@ -119942,7 +120224,7 @@ var ts; } return this.svc.positionToLineOffset(position); }; - TextStorage.prototype.getFileText = function (tempFileName) { + TextStorage.prototype.getFileTextAndSize = function (tempFileName) { var _this = this; var text; var fileName = tempFileName || this.fileName; @@ -119954,10 +120236,10 @@ var ts; var service = this.info.containingProjects[0].projectService; service.logger.info("Skipped loading contents of large file " + fileName + " for info " + this.info.fileName + ": fileSize: " + fileSize); this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize); - return ""; + return { text: "", fileSize: fileSize }; } } - return getText(); + return { text: getText() }; }; TextStorage.prototype.switchToScriptVersionCache = function () { if (!this.svc || this.pendingReloadFromDisk) { @@ -120014,6 +120296,9 @@ var ts; ScriptInfo.prototype.getVersion = function () { return this.textStorage.version; }; + ScriptInfo.prototype.getTelemetryFileSize = function () { + return this.textStorage.getTelemetryFileSize(); + }; ScriptInfo.prototype.isDynamicOrHasMixedContent = function () { return this.hasMixedContent || this.isDynamic; }; @@ -120345,27 +120630,45 @@ var ts; ProjectKind[ProjectKind["Configured"] = 1] = "Configured"; ProjectKind[ProjectKind["External"] = 2] = "External"; })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); - function countEachFileTypes(infos) { - var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0, deferred: 0 }; + function countEachFileTypes(infos, includeSizes) { + if (includeSizes === void 0) { includeSizes = false; } + var result = { + js: 0, jsSize: 0, + jsx: 0, jsxSize: 0, + ts: 0, tsSize: 0, + tsx: 0, tsxSize: 0, + dts: 0, dtsSize: 0, + deferred: 0, deferredSize: 0, + }; for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { var info = infos_1[_i]; + var fileSize = includeSizes ? info.getTelemetryFileSize() : 0; switch (info.scriptKind) { case 1: result.js += 1; + result.jsSize += fileSize; break; case 2: result.jsx += 1; + result.jsxSize += fileSize; break; case 3: - ts.fileExtensionIs(info.fileName, ".d.ts") - ? result.dts += 1 - : result.ts += 1; + if (ts.fileExtensionIs(info.fileName, ".d.ts")) { + result.dts += 1; + result.dtsSize += fileSize; + } + else { + result.ts += 1; + result.tsSize += fileSize; + } break; case 4: result.tsx += 1; + result.tsxSize += fileSize; break; case 7: result.deferred += 1; + result.deferredSize += fileSize; break; } } @@ -120839,7 +121142,7 @@ var ts; return false; }; Project.prototype.containsScriptInfo = function (info) { - return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); + return this.isRoot(info) || (!!this.program && this.program.getSourceFileByPath(info.path) !== undefined); }; Project.prototype.containsFile = function (filename, requireOpen) { var info = this.projectService.getScriptInfoForNormalizedPath(filename); @@ -120996,7 +121299,7 @@ var ts; return fileWatcher; }; Project.prototype.isWatchedMissingFile = function (path) { - return this.missingFilesMap && this.missingFilesMap.has(path); + return !!this.missingFilesMap && this.missingFilesMap.has(path); }; Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { var scriptInfo = this.projectService.getScriptInfoForPath(this.toPath(fileName)); @@ -121284,6 +121587,7 @@ var ts; __extends(ConfiguredProject, _super); function ConfiguredProject(configFileName, projectService, documentRegistry, cachedDirectoryStructureHost) { var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, false, undefined, {}, false, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; + _this.canConfigFileJsonReportNoInputFiles = false; _this.externalProjectRefCount = 0; _this.isInitialLoadPending = ts.returnTrue; _this.sendLoadingProjectFinish = false; @@ -121642,6 +121946,7 @@ var ts; this.safelist = defaultTypeSafeList; this.legacySafelist = ts.createMap(); this.pendingProjectUpdates = ts.createMap(); + this.pendingEnsureProjectForOpenFiles = false; this.seenProjects = ts.createMap(); this.seenSurveyProjects = ts.createMap(); this.host = opts.host; @@ -122402,7 +122707,7 @@ var ts; setProjectOptionsUsed(project); var data = { projectId: this.host.createSHA256Hash(project.projectName), - fileStats: server.countEachFileTypes(project.getScriptInfos()), + fileStats: server.countEachFileTypes(project.getScriptInfos(), true), compilerOptions: ts.convertCompilerOptionsForTelemetry(project.getCompilationSettings()), typeAcquisition: convertTypeAcquisition(project.getTypeAcquisition()), extends: projectOptions && projectOptions.configHasExtendsProperty, @@ -125132,7 +125437,7 @@ var ts; Session.prototype.isLocation = function (locationOrSpan) { return locationOrSpan.line !== undefined; }; - Session.prototype.extractPositionAndRange = function (args, scriptInfo) { + Session.prototype.extractPositionOrRange = function (args, scriptInfo) { var position; var textRange; if (this.isLocation(args)) { @@ -125142,7 +125447,7 @@ var ts; var _a = this.getStartAndEndPosition(args, scriptInfo), startPosition = _a.startPosition, endPosition = _a.endPosition; textRange = { pos: startPosition, end: endPosition }; } - return { position: position, textRange: textRange }; + return ts.Debug.assertDefined(position === undefined ? textRange : position); function getPosition(loc) { return loc.position !== undefined ? loc.position : scriptInfo.lineOffsetToPosition(loc.line, loc.offset); } @@ -125150,14 +125455,12 @@ var ts; Session.prototype.getApplicableRefactors = function (args) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; - return project.getLanguageService().getApplicableRefactors(file, position || textRange, this.getPreferences(file)); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); }; Session.prototype.getEditsForRefactor = function (args, simplifiedResult) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; - var result = project.getLanguageService().getEditsForRefactor(file, this.getFormatOptions(file), position || textRange, args.refactor, args.action, this.getPreferences(file)); + var result = project.getLanguageService().getEditsForRefactor(file, this.getFormatOptions(file), this.extractPositionOrRange(args, scriptInfo), args.refactor, args.action, this.getPreferences(file)); if (result === undefined) { return { edits: [] @@ -126345,6 +126648,8 @@ var ts; this.activeRequestCount = 0; this.requestQueue = []; this.requestMap = ts.createMap(); // Maps operation ID to newest requestQueue entry with that ID + /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */ + this.requestedRegistry = false; } NodeTypingsInstaller.prototype.isKnownTypesPackageName = function (name) { // We want to avoid looking this up in the registry as that is expensive. So first check that it's actually an NPM package. diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index ac36533a094..2b78178587e 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } @@ -1976,7 +1976,8 @@ declare namespace ts { AllowEmptyTuple = 524288, AllowUniqueESSymbolType = 1048576, AllowEmptyIndexInfoType = 2097152, - IgnoreErrors = 3112960, + AllowNodeModulesRelativePaths = 67108864, + IgnoreErrors = 70221824, InObjectTypeLiteral = 4194304, InTypeAlias = 8388608, InInitialEntityName = 16777216, @@ -3131,7 +3132,6 @@ declare namespace ts { function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } -/** Non-internal stuff goes here */ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): SortedReadonlyArray; @@ -3478,6 +3478,7 @@ declare namespace ts { type TemplateLiteralToken = NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail; function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; + function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; function isModifier(node: Node): node is Modifier; function isEntityName(node: Node): node is EntityName; @@ -4867,7 +4868,7 @@ declare namespace ts { message: string; position: number; } - class TextChange { + interface TextChange { span: TextSpan; newText: string; } @@ -8435,11 +8436,17 @@ declare namespace ts.server { } interface FileStats { readonly js: number; + readonly jsSize?: number; readonly jsx: number; + readonly jsxSize?: number; readonly ts: number; + readonly tsSize?: number; readonly tsx: number; + readonly tsxSize?: number; readonly dts: number; + readonly dtsSize?: number; readonly deferred: number; + readonly deferredSize?: number; } interface OpenFileInfo { readonly checkJs: boolean; @@ -8893,7 +8900,7 @@ declare namespace ts.server { private getFullNavigateToItems; private getSupportedCodeFixes; private isLocation; - private extractPositionAndRange; + private extractPositionOrRange; private getApplicableRefactors; private getEditsForRefactor; private organizeImports; diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index 0767cfedaad..d89c5621ef6 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -82,7 +82,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); @@ -3060,13 +3060,15 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + // Errors (cont.) + NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 70221824] = "IgnoreErrors"; // State NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; - /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 67108864] = "DoNotIncludeSymbolChain"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -5258,7 +5260,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -5365,7 +5367,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -5448,7 +5450,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -5479,7 +5481,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -5524,6 +5526,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5623,6 +5626,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -6018,6 +6022,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6113,6 +6118,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -6181,6 +6187,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -6410,11 +6419,28 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + /* @internal */ + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -8066,7 +8092,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/** Non-internal stuff goes here */ var ts; (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -12351,6 +12376,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) + || kind === 120 /* AnyKeyword */ + || kind === 143 /* UnknownKeyword */ + || kind === 135 /* NumberKeyword */ + || kind === 146 /* BigIntKeyword */ + || kind === 136 /* ObjectKeyword */ + || kind === 123 /* BooleanKeyword */ + || kind === 138 /* StringKeyword */ + || kind === 139 /* SymbolKeyword */ + || kind === 100 /* ThisKeyword */ + || kind === 106 /* VoidKeyword */ + || kind === 141 /* UndefinedKeyword */ + || kind === 96 /* NullKeyword */ + || kind === 132 /* NeverKeyword */ + || kind === 211 /* ExpressionWithTypeArguments */ + || kind === 284 /* JSDocAllType */ + || kind === 285 /* JSDocUnknownType */ + || kind === 286 /* JSDocNullableType */ + || kind === 287 /* JSDocNonNullableType */ + || kind === 288 /* JSDocOptionalType */ + || kind === 289 /* JSDocFunctionType */ + || kind === 290 /* JSDocVariadicType */; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -13819,6 +13869,10 @@ var ts; || kind === 17 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } @@ -13987,37 +14041,13 @@ var ts; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type - function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 284 /* JSDocAllType */ - || kind === 285 /* JSDocUnknownType */ - || kind === 286 /* JSDocNullableType */ - || kind === 287 /* JSDocNonNullableType */ - || kind === 288 /* JSDocOptionalType */ - || kind === 289 /* JSDocFunctionType */ - || kind === 290 /* JSDocVariadicType */; - } /** * Node test that determines whether a node is a valid type node. * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* * of a TypeNode. */ function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -16538,53 +16568,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299 /* JSDocParameterTag */: case 305 /* JSDocPropertyTag */: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 302 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295 /* JSDocAugmentsTag */: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303 /* JSDocTemplateTag */: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304 /* JSDocTypedefTag */: - if (node.typeExpression && - node.typeExpression.kind === 283 /* JSDocTypeExpression */) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 /* JSDocTypeExpression */ + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297 /* JSDocCallbackTag */: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300 /* JSDocReturnTag */: + case 302 /* JSDocTypeTag */: case 301 /* JSDocThisTag */: - return visitNode(cbNode, node.typeExpression); case 298 /* JSDocEnumTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293 /* JSDocSignature */: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292 /* JSDocTypeLiteral */: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294 /* JSDocTag */: + case 296 /* JSDocClassTag */: + return visitNode(cbNode, node.tagName); case 308 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } @@ -23287,6 +23310,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23750,18 +23785,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -28232,6 +28255,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -29345,7 +29369,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -30917,17 +30941,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -30957,6 +30971,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -31506,7 +31521,11 @@ var ts; (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432 /* Transient */)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { @@ -32070,7 +32089,7 @@ var ts; // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -32765,8 +32784,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -32794,7 +32813,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations @@ -33065,6 +33084,50 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + // Try to make an import using an import already in the enclosing file, if possible + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached) + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } /** * Attempts to find the symbol corresponding to the container a symbol is in - usually this * is just its' `.parent`, but for locals, this value is `undefined` @@ -33073,10 +33136,12 @@ var ts; var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) { - return ts.concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); // This order expresses a preference for the real container if it is in scope } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -33515,7 +33580,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } - var nodeFlags = 3112960 /* IgnoreErrors */; + var nodeFlags = 70221824 /* IgnoreErrors */; if (flags & 2 /* UseOnlyExternalAliasing */) { nodeFlags |= 128 /* UseOnlyExternalAliasing */; } @@ -33526,7 +33591,7 @@ var ts; nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (flags & 16 /* DoNotIncludeSymbolChain */) { - nodeFlags |= 67108864 /* DoNotIncludeSymbolChain */; + nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */; } var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -33549,7 +33614,7 @@ var ts; else { sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); // TODO: GH#18217 @@ -33560,7 +33625,7 @@ var ts; if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -33611,7 +33676,7 @@ var ts; enclosingDeclaration: enclosingDeclaration, flags: flags || 0 /* None */, // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 /* DoNotIncludeSymbolChain */ ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -33864,11 +33929,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832 /* Type */); } else { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } } else { @@ -33882,11 +33943,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -34071,10 +34128,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048 /* ReverseMapped */) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -34105,8 +34167,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1 /* NoTruncation */)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); + } + return ts.createKeywordTypeNode(120 /* AnyKeyword */); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -34136,8 +34206,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; if (modifiers) { @@ -34323,7 +34399,7 @@ var ts; // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 67108864 /* DoNotIncludeSymbolChain */)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true)); ts.Debug.assert(chain && chain.length > 0); } @@ -34334,13 +34410,22 @@ var ts; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -34363,6 +34448,24 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + // Both relative or both non-relative, sort by number of parts + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + // A is non-relative, B is relative: prefer A + return -1; + } + // A is relative, B is non-relative: prefer B + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -34451,6 +34554,14 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error + // since declaration files with these kinds of references are liable to fail when published :( + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -34587,7 +34698,7 @@ var ts; if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); @@ -36012,7 +36123,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -36068,7 +36179,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -39368,7 +39479,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -42769,12 +42880,8 @@ var ts; return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -42880,6 +42987,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -43252,6 +43362,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151 /* Parameter */: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -45653,7 +45773,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3 /* Variable */) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -47138,6 +47263,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking @@ -47605,16 +47741,31 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4 /* String */) { + return [anySignature]; + } + else if (elementType.flags & 128 /* StringLiteral */) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); // Resolve the signatures, preferring constructor - var signatures = getSignaturesOfType(elementType, 1 /* Construct */); + var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); if (signatures.length === 0) { // No construct signatures, try call signatures - signatures = getSignaturesOfType(elementType, 0 /* Call */); + signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); } - if (signatures.length === 0 && elementType.flags & 1048576 /* Union */) { + if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { // If each member has some combination of new/call signatures; make a union signature list for those - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -47987,7 +48138,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -48186,7 +48337,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { @@ -49555,20 +49706,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128 /* StringLiteral */) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 /* String */ || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -51193,8 +51332,17 @@ var ts; leftType; case 59 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288 /* Object */) || + declKind !== 2 /* ModuleExports */ && + declKind !== 6 /* Prototype */ && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1 /* Class */)) { + // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -51209,10 +51357,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2 /* ModuleExports */) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32 /* Class */) { @@ -53277,7 +53424,7 @@ var ts; } function registerForUnusedIdentifiersCheck(node) { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304 /* Ambient */)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -53298,9 +53445,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279 /* SourceFile */: case 244 /* ModuleDeclaration */: case 218 /* Block */: @@ -53317,7 +53461,7 @@ var ts; case 156 /* MethodDeclaration */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -53328,9 +53472,12 @@ var ts; case 165 /* FunctionType */: case 166 /* ConstructorType */: case 242 /* TypeAliasDeclaration */: - case 176 /* InferType */: + case 241 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176 /* InferType */: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -53345,77 +53492,73 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304 /* Ambient */)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - // Already would have reported an error on the getter. - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156 /* MethodDeclaration */: + case 154 /* PropertyDeclaration */: + case 158 /* GetAccessor */: + case 159 /* SetAccessor */: + if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. break; - case 157 /* Constructor */: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { - addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157 /* Constructor */: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { + addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: - // Can't be private - break; - default: - ts.Debug.fail(); - } + } + break; + case 162 /* IndexSignature */: + case 217 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + } + } function checkUnusedTypeParameters(node, addDiagnostic) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & 4194304 /* Ambient */ || node.kind !== 176 /* InferType */ && ts.last(getSymbolOfNode(node).declarations) !== node) + if (ts.last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === 176 /* InferType */) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + // Whole @template tag + ? ts.rangeOfNode(parent) + // Include the `<>` in the error message + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - // Whole @template tag - ? ts.rangeOfNode(parent) - // Include the `<>` in the error message - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } @@ -53836,9 +53979,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); } } } @@ -54896,7 +55039,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -56502,7 +56645,10 @@ var ts; } if (isDeclarationNameOrImportPropertyName(node)) { // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -64710,7 +64856,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -64719,7 +64865,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -79709,6 +79855,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -79797,6 +79944,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -82784,7 +82936,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -83522,7 +83674,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -85976,6 +86128,7 @@ var ts; // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2 /* Completely */) { @@ -87334,15 +87487,20 @@ var ts; * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -89705,6 +89863,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -91447,6 +91606,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); @@ -91496,11 +91658,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } @@ -92209,12 +92377,6 @@ var ts; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); /* @internal */ ts.emptyOptions = {}; - var TextChange = /** @class */ (function () { - function TextChange() { - } - return TextChange; - }()); - ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -92678,6 +92840,10 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; + function isTagName(node) { + return ts.isJSDocTag(node.parent) && node.parent.tagName === node; + } + ts.isTagName = isTagName; function isRightSideOfQualifiedName(node) { return node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node; } @@ -93568,6 +93734,7 @@ var ts; ts.createTextChange = createTextChange; ts.typeKeywords = [ 120 /* AnyKeyword */, + 146 /* BigIntKeyword */, 123 /* BooleanKeyword */, 87 /* FalseKeyword */, 129 /* KeyOfKeyword */, @@ -94001,9 +94168,7 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { - return !!location.parent && - (location.parent.kind === 253 /* ImportSpecifier */ || location.parent.kind === 257 /* ExportSpecifier */) && - location.parent.propertyName === location; + return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; /** @@ -95425,26 +95590,21 @@ var ts; * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option */ - function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { // Make all paths absolute/normalized if they are not already rootDirs = rootDirs.map(function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); // Determine the path to the directory containing the script relative to the root directory it is contained within var relativeDirectory = ts.firstDefined(rootDirs, function (rootDirectory) { - return ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase) ? scriptPath.substr(rootDirectory.length) : undefined; + return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined; }); // TODO: GH#18217 // Now find a path for each potential directory that is to be merged with the one containing the script - return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); + return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensionOptions, compilerOptions, host, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - var result = []; - for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { - var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude, result); - } - return result; + var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return ts.flatMap(baseDirectories, function (baseDirectory) { return getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude); }); } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. @@ -96675,7 +96835,8 @@ var ts; position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; isInSnippetScope = isSnippetScope(scopeNode); - var symbolMeanings = 67897832 /* Type */ | 67220415 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + var isTypeOnly = isTypeOnlyCompletion(); + var symbolMeanings = (isTypeOnly ? 0 /* None */ : 67220415 /* Value */) | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 279 /* SourceFile */) { @@ -96724,9 +96885,9 @@ var ts; } } function filterGlobalCompletion(symbols) { - var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - if (isTypeOnlyCompletion) + var isTypeOnly = isTypeOnlyCompletion(); + var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + if (isTypeOnly) keywordFilters = 6 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -96742,7 +96903,7 @@ var ts; if (allowTypes) { // Its a type, but you can reach it by namespace.type as well var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); - if (symbolAllowedAsType || isTypeOnlyCompletion) { + if (symbolAllowedAsType || isTypeOnly) { return symbolAllowedAsType; } } @@ -96751,6 +96912,9 @@ var ts; return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */); }); } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 104 /* TypeOfKeyword */ && @@ -97136,6 +97300,7 @@ var ts; if (contextToken) { var parent = contextToken.parent; switch (contextToken.kind) { + case 30 /* GreaterThanToken */: // End of a type argument list case 29 /* LessThanSlashToken */: case 42 /* SlashToken */: case 72 /* Identifier */: @@ -97144,6 +97309,11 @@ var ts; case 267 /* JsxAttribute */: case 269 /* JsxSpreadAttribute */: if (parent && (parent.kind === 261 /* JsxSelfClosingElement */ || parent.kind === 262 /* JsxOpeningElement */)) { + if (contextToken.kind === 30 /* GreaterThanToken */) { + var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); + if (!parent.typeArguments || (precedingToken && precedingToken.kind === 42 /* SlashToken */)) + break; + } return parent; } else if (parent.kind === 267 /* JsxAttribute */) { @@ -98562,7 +98732,7 @@ var ts; return undefined; } var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); - return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + return { kind: 0 /* Import */, symbol: lhsSymbol }; } else { return exportInfo(symbol, getExportKindForDeclaration(exportNode)); @@ -98632,7 +98802,7 @@ var ts; // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = ts.symbolEscapedNameNoDefault(importedSymbol); if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { - return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + return { kind: 0 /* Import */, symbol: importedSymbol }; } } function exportInfo(symbol, kind) { @@ -98677,18 +98847,16 @@ var ts; var parent = node.parent; switch (parent.kind) { case 248 /* ImportEqualsDeclaration */: - return parent.name === node && isExternalModuleImportEquals(parent) - ? { isNamedImport: false } - : undefined; + return parent.name === node && isExternalModuleImportEquals(parent); case 253 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. - return parent.propertyName ? undefined : { isNamedImport: true }; + return !parent.propertyName; case 250 /* ImportClause */: case 251 /* NamespaceImport */: ts.Debug.assert(parent.name === node); - return { isNamedImport: false }; + return true; default: - return undefined; + return false; } } function getExportInfo(exportSymbol, exportKind, checker) { @@ -98806,7 +98974,7 @@ var ts; } } function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { - return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node); }); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node, program.getTypeChecker()); }); } FindAllReferences.findReferenceOrRenameEntries = findReferenceOrRenameEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { @@ -98860,8 +99028,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode)); + function toRenameLocation(entry, originalNode, checker) { + return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98890,25 +99058,27 @@ var ts; return { textSpan: getTextSpan(entry.node, sourceFile), fileName: sourceFile.fileName }; } } - function getPrefixAndSuffixText(entry, originalNode) { + function getPrefixAndSuffixText(entry, originalNode, checker) { if (entry.kind !== 0 /* Span */ && ts.isIdentifier(originalNode)) { var node = entry.node, kind = entry.kind; var name = originalNode.text; var isShorthandAssignment = ts.isShorthandPropertyAssignment(node.parent); if (isShorthandAssignment || ts.isObjectBindingElementWithoutPropertyName(node.parent)) { - if (kind === 3 /* SearchedLocalFoundProperty */) { - return { prefixText: name + ": " }; - } - else if (kind === 4 /* SearchedPropertyFoundLocal */) { - return { suffixText: ": " + name }; - } - else { - return isShorthandAssignment + var prefixColon = { prefixText: name + ": " }; + var suffixColon = { suffixText: ": " + name }; + return kind === 3 /* SearchedLocalFoundProperty */ ? prefixColon + : kind === 4 /* SearchedPropertyFoundLocal */ ? suffixColon // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol. - ? { suffixText: ": " + name } // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol. - : { prefixText: name + ": " }; - } + : isShorthandAssignment ? suffixColon : prefixColon; + } + else if (ts.isImportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + // If the original symbol was using this alias, just rename the alias. + var originalSymbol = ts.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return ts.contains(originalSymbol.declarations, entry.node.parent) ? { prefixText: name + " as " } : ts.emptyOptions; + } + else if (ts.isExportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + return originalNode === entry.node ? { prefixText: name + " as " } : { suffixText: " as " + name }; } } return ts.emptyOptions; @@ -99163,13 +99333,18 @@ var ts; return undefined; } /** Core find-all-references algorithm for a normal symbol. */ - function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - symbol = node && skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - if (node && node.kind === 80 /* DefaultKeyword */) { + var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + if (exportSpecifier) { + // When renaming at an export specifier, rename the export and not the thing being exported. + getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); + } + else if (node && node.kind === 80 /* DefaultKeyword */) { addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } @@ -99207,15 +99382,11 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { var parent = node.parent; - if (ts.isExportSpecifier(parent)) { + if (ts.isExportSpecifier(parent) && !isForRename) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } - if (ts.isImportSpecifier(parent) && parent.propertyName === node) { - // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. - return checker.getImmediateAliasedSymbol(symbol); - } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { @@ -99378,7 +99549,8 @@ var ts; var indirectUser = indirectUsers_2[_b]; for (var _c = 0, _d = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName); _c < _d.length; _c++) { var node = _d[_c]; - if (ts.isIdentifier(node) && checker.getSymbolAtLocation(node) === exportSymbol) { + // Import specifiers should be handled by importSearches + if (ts.isIdentifier(node) && !ts.isImportOrExportSpecifier(node.parent) && checker.getSymbolAtLocation(node) === exportSymbol) { cb(node); } } @@ -99394,7 +99566,7 @@ var ts; if (!ts.isIdentifier(singleRef)) return false; // At `default` in `import { default as x }` or `export { default as x }`, do add a reference, but do not rename. - return !((ts.isExportSpecifier(singleRef.parent) || ts.isImportSpecifier(singleRef.parent)) && singleRef.escapedText === "default" /* Default */); + return !(ts.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default" /* Default */); } // Go to the symbol we imported from and find references for it. function searchForImportedSymbol(symbol, state) { @@ -99673,16 +99845,16 @@ var ts; } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } - function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere) { + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); - if (!search.includes(localSymbol)) { + if (!alwaysGetReferences && !search.includes(localSymbol)) { return; } if (!propertyName) { // Don't rename at `export { default } from "m";`. (but do continue to search for imports of the re-export) - if (!(state.options.isForRename && name.escapedText === "default" /* Default */)) { + if (!(state.options.isForRename && (name.escapedText === "default" /* Default */))) { addRef(); } } @@ -99693,7 +99865,7 @@ var ts; addRef(); } if (addReferencesHere && !state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, state); + addReference(name, ts.Debug.assertDefined(exportSpecifier.symbol), state); } } else { @@ -99702,15 +99874,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!(referenceLocation === propertyName && state.options.isForRename)) { + if (!state.options.isForRename || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; - var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); - if (!exportInfo) - return ts.Debug.fail(); - searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); + var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99742,12 +99913,11 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename || importOrExport.isNamedImport) { + if (!state.options.isForRename) { searchForImportedSymbol(symbol, state); } } else { - // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); } } @@ -103745,7 +103915,7 @@ var ts; function getEnclosingDeclarationFromInvocation(invocation) { return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node; } - var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; function createSignatureHelpItems(candidates, resolvedSignature, _a, sourceFile, typeChecker) { var isTypeParameterList = _a.isTypeParameterList, argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex; var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); @@ -104911,16 +105081,11 @@ var ts; this.options = options; } FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - ts.Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; + this.currentTokenSpan = ts.Debug.assertDefined(currentRange); + this.currentTokenParent = ts.Debug.assertDefined(currentTokenParent); + this.nextTokenSpan = ts.Debug.assertDefined(nextRange); + this.nextTokenParent = ts.Debug.assertDefined(nextTokenParent); + this.contextNode = ts.Debug.assertDefined(commonParent); // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; @@ -107646,7 +107811,6 @@ var ts; }; ChangeTracker.prototype.deleteRange = function (sourceFile, range) { this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); - return this; }; ChangeTracker.prototype.delete = function (sourceFile, node) { this.deletedNodes.push({ sourceFile: sourceFile, node: node }); @@ -107659,7 +107823,6 @@ var ts; var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - return this; }; ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) { if (options === void 0) { options = {}; } @@ -107670,11 +107833,10 @@ var ts; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); - return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } @@ -107683,18 +107845,17 @@ var ts; ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); - return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); }; ChangeTracker.prototype.replaceNodeWithText = function (sourceFile, oldNode, text) { this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, textChanges_3.useNonAdjustedPositions), text); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); }; ChangeTracker.prototype.nextCommaToken = function (sourceFile, node) { var next = ts.findNextToken(node, node.parent, sourceFile); @@ -107702,7 +107863,7 @@ var ts; }; ChangeTracker.prototype.replacePropertyAssignment = function (sourceFile, oldNode, newNode) { var suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ("," + this.newLineCharacter); - return this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); + this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } @@ -107951,11 +108112,11 @@ var ts; if (containingList === void 0) { containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); } if (!containingList) { ts.Debug.fail("node is not a list element"); - return this; + return; } var index = ts.indexOfNode(containingList, after); if (index < 0) { - return this; + return; } var end = after.getEnd(); if (index !== containingList.length - 1) { @@ -108053,7 +108214,6 @@ var ts; this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " }); } } - return this; }; ChangeTracker.prototype.finishClassesWithNodesInsertedAtStart = function () { var _this = this; @@ -109270,9 +109430,8 @@ var ts; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } - var isConstructor = declaration.kind === 157 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []); + return declaration.parameters.map(function (parameter, parameterIndex) { var types = []; var isRest = ts.isRestParameter(parameter); var isOptional = false; @@ -109292,7 +109451,8 @@ var ts; } } if (ts.isIdentifier(parameter.name)) { - types.push.apply(types, inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken)); + var inferred = inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken); + types.push.apply(types, (isRest ? ts.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred)); } var type = unifyFromContext(types, checker); return { @@ -109364,8 +109524,7 @@ var ts; usageContext.isNumber = true; break; case 38 /* PlusToken */: - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; break; // case SyntaxKind.ExclamationToken: // no inferences here; @@ -109427,8 +109586,7 @@ var ts; usageContext.isString = true; } else { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; } break; // AssignmentOperators @@ -109493,8 +109651,7 @@ var ts; } function inferTypeFromPropertyElementExpressionContext(parent, node, checker, usageContext) { if (node === parent.argumentExpression) { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; return; } else { @@ -109509,18 +109666,48 @@ var ts; } } } + function removeLowPriorityInferences(inferences, priorities) { + var toRemove = []; + for (var _i = 0, inferences_2 = inferences; _i < inferences_2.length; _i++) { + var i = inferences_2[_i]; + for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) { + var _b = priorities_1[_a], high = _b.high, low = _b.low; + if (high(i)) { + ts.Debug.assert(!low(i)); + toRemove.push(low); + } + } + } + return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); }); + } function unifyFromContext(inferences, checker, fallback) { if (fallback === void 0) { fallback = checker.getAnyType(); } if (!inferences.length) return fallback; - var hasNonVacuousType = inferences.some(function (i) { return !(i.flags & (1 /* Any */ | 16384 /* Void */)); }); - var hasNonVacuousNonAnonymousType = inferences.some(function (i) { return !(i.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); - var anons = inferences.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); - var good = []; - if (!hasNonVacuousNonAnonymousType && anons.length) { + // 1. string or number individually override string | number + // 2. non-any, non-void overrides any or void + // 3. non-nullable, non-any, non-void, non-anonymous overrides anonymous types + var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + var priorities = [ + { + high: function (t) { return t === checker.getStringType() || t === checker.getNumberType(); }, + low: function (t) { return t === stringNumber; } + }, + { + high: function (t) { return !(t.flags & (1 /* Any */ | 16384 /* Void */)); }, + low: function (t) { return !!(t.flags & (1 /* Any */ | 16384 /* Void */)); } + }, + { + high: function (t) { return !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(t) & 16 /* Anonymous */); }, + low: function (t) { return !!(checker.getObjectFlags(t) & 16 /* Anonymous */); } + } + ]; + var good = removeLowPriorityInferences(inferences, priorities); + var anons = good.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); + if (anons.length) { + good = good.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); good.push(unifyAnonymousTypes(anons, checker)); } - good.push.apply(good, inferences.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */) && !(hasNonVacuousType && i.flags & (1 /* Any */ | 16384 /* Void */)); })); return checker.getWidenedType(checker.getUnionType(good)); } InferFromReference.unifyFromContext = unifyFromContext; @@ -109568,6 +109755,9 @@ var ts; if (usageContext.isString) { types.push(checker.getStringType()); } + if (usageContext.isNumberOrString) { + types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } types.push.apply(types, (usageContext.candidateTypes || []).map(function (t) { return checker.getBaseTypeOfLiteralType(t); })); if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); // TODO: GH#18217 @@ -109578,7 +109768,7 @@ var ts; types.push(checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker))); } if (usageContext.numberIndexContext) { - return [checker.createArrayType(recur(usageContext.numberIndexContext))]; + types.push(checker.createArrayType(recur(usageContext.numberIndexContext))); } else if (usageContext.properties || usageContext.callContexts || usageContext.constructContexts || usageContext.stringIndexContext) { var members_6 = ts.createUnderscoreEscapedMap(); @@ -115320,7 +115510,7 @@ var ts; // readonly modifier only existed in classLikeDeclaration var constructor = ts.getFirstConstructorWithBody(container); if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName); + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); } } else { @@ -115373,7 +115563,7 @@ var ts; isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), container: declaration.kind === 151 /* Parameter */ ? declaration.parent.parent : declaration.parent, - originalName: declaration.name, + originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, accessorName: accessorName, @@ -115424,22 +115614,23 @@ var ts; ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); } - function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName) { + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { if (!constructor.body) return; - var file = context.file, program = context.program, cancellationToken = context.cancellationToken; - var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) { - return (entry.kind !== 0 /* Span */ && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined; - }); - ts.forEach(referenceEntries, function (entry) { - var parent = entry.parent; - var accessorName = ts.createIdentifier(fieldName.text); - var node = ts.isBinaryExpression(parent) - ? ts.updateBinary(parent, accessorName, parent.right, parent.operatorToken) - : ts.isPropertyAccessExpression(parent) - ? ts.updatePropertyAccess(parent, parent.expression, accessorName) - : ts.Debug.fail("Unexpected write access token"); - changeTracker.replaceNode(file, parent, node); + constructor.body.forEachChild(function recur(node) { + if (ts.isElementAccessExpression(node) && + node.expression.kind === 100 /* ThisKeyword */ && + ts.isStringLiteral(node.argumentExpression) && + node.argumentExpression.text === originalName && + ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, ts.createStringLiteral(fieldName)); + } + if (ts.isPropertyAccessExpression(node) && node.expression.kind === 100 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, ts.createIdentifier(fieldName)); + } + if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { + node.forEachChild(recur); + } }); } })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {})); @@ -117381,7 +117572,7 @@ var ts; function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 72 /* Identifier */: - return !ts.isLabelName(node); + return !ts.isLabelName(node) && !ts.isTagName(node); case 189 /* PropertyAccessExpression */: case 148 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` @@ -117963,7 +118154,7 @@ var ts; function initializeNameTable(sourceFile) { var nameTable = sourceFile.nameTable = ts.createUnderscoreEscapedMap(); sourceFile.forEachChild(function walk(node) { - if (ts.isIdentifier(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { + if (ts.isIdentifier(node) && !ts.isTagName(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { var text = ts.getEscapedTextOfIdentifierOrLiteral(node); nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); } @@ -118877,9 +119068,15 @@ var ts; if ("directoryExists" in this.shimHost) { this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; } + else { + this.directoryExists = undefined; // TODO: GH#18217 + } if ("realpath" in this.shimHost) { this.realpath = function (path) { return _this.shimHost.realpath(path); }; // TODO: GH#18217 } + else { + this.realpath = undefined; // TODO: GH#18217 + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) { var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217 @@ -119850,6 +120047,18 @@ var ts; this.host = host; this.fileName = fileName; this.info = info; + /** + * True if the text is for the file thats open in the editor + */ + this.isOpen = false; + /** + * True if the text present is the text from the file on the disk + */ + this.ownFileText = false; + /** + * True when reloading contents of file from the disk is pending + */ + this.pendingReloadFromDisk = false; this.version = initialVersion || { svc: 0, text: 0 }; } TextStorage.prototype.getVersion = function () { @@ -119863,10 +120072,12 @@ var ts; TextStorage.prototype.useScriptVersionCache_TestOnly = function () { this.switchToScriptVersionCache(); }; + /** Public for testing */ TextStorage.prototype.useText = function (newText) { this.svc = undefined; this.text = newText; this.lineMap = undefined; + this.fileSize = undefined; this.version.text++; }; TextStorage.prototype.edit = function (start, end, newText) { @@ -119874,6 +120085,7 @@ var ts; this.ownFileText = false; this.text = undefined; this.lineMap = undefined; + this.fileSize = undefined; }; /** * Set the contents as newText @@ -119894,13 +120106,16 @@ var ts; this.ownFileText = false; return true; } + return false; }; /** * Reads the contents from tempFile(if supplied) or own file and sets it as contents * returns true if text changed */ TextStorage.prototype.reloadWithFileText = function (tempFileName) { - var reloaded = this.reload(this.getFileText(tempFileName)); + var _a = this.getFileTextAndSize(tempFileName), newText = _a.text, fileSize = _a.fileSize; + var reloaded = this.reload(newText); + this.fileSize = fileSize; // NB: after reload since reload clears it this.ownFileText = !tempFileName || tempFileName === this.fileName; return reloaded; }; @@ -119917,6 +120132,22 @@ var ts; TextStorage.prototype.delayReloadFromFileIntoText = function () { this.pendingReloadFromDisk = true; }; + /** + * For telemetry purposes, we would like to be able to report the size of the file. + * However, we do not want telemetry to require extra file I/O so we report a size + * that may be stale (e.g. may not reflect change made on disk since the last reload). + * NB: Will read from disk if the file contents have never been loaded because + * telemetry falsely indicating size 0 would be counter-productive. + */ + TextStorage.prototype.getTelemetryFileSize = function () { + return !!this.fileSize + ? this.fileSize + : !!this.text // Check text before svc because its length is cheaper + ? this.text.length // Could be wrong if this.pendingReloadFromDisk + : !!this.svc + ? this.svc.getSnapshot().getLength() // Could be wrong if this.pendingReloadFromDisk + : this.getSnapshot().getLength(); // Should be strictly correct + }; TextStorage.prototype.getSnapshot = function () { return this.useScriptVersionCacheIfValidOrOpen() ? this.svc.getSnapshot() @@ -119955,7 +120186,7 @@ var ts; } return this.svc.positionToLineOffset(position); }; - TextStorage.prototype.getFileText = function (tempFileName) { + TextStorage.prototype.getFileTextAndSize = function (tempFileName) { var _this = this; var text; var fileName = tempFileName || this.fileName; @@ -119968,10 +120199,10 @@ var ts; var service = this.info.containingProjects[0].projectService; service.logger.info("Skipped loading contents of large file " + fileName + " for info " + this.info.fileName + ": fileSize: " + fileSize); this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize); - return ""; + return { text: "", fileSize: fileSize }; } } - return getText(); + return { text: getText() }; }; TextStorage.prototype.switchToScriptVersionCache = function () { if (!this.svc || this.pendingReloadFromDisk) { @@ -120037,6 +120268,10 @@ var ts; return this.textStorage.version; }; /*@internal*/ + ScriptInfo.prototype.getTelemetryFileSize = function () { + return this.textStorage.getTelemetryFileSize(); + }; + /*@internal*/ ScriptInfo.prototype.isDynamicOrHasMixedContent = function () { return this.hasMixedContent || this.isDynamic; }; @@ -120396,27 +120631,45 @@ var ts; ProjectKind[ProjectKind["External"] = 2] = "External"; })(ProjectKind = server.ProjectKind || (server.ProjectKind = {})); /* @internal */ - function countEachFileTypes(infos) { - var result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0, deferred: 0 }; + function countEachFileTypes(infos, includeSizes) { + if (includeSizes === void 0) { includeSizes = false; } + var result = { + js: 0, jsSize: 0, + jsx: 0, jsxSize: 0, + ts: 0, tsSize: 0, + tsx: 0, tsxSize: 0, + dts: 0, dtsSize: 0, + deferred: 0, deferredSize: 0, + }; for (var _i = 0, infos_2 = infos; _i < infos_2.length; _i++) { var info = infos_2[_i]; + var fileSize = includeSizes ? info.getTelemetryFileSize() : 0; switch (info.scriptKind) { case 1 /* JS */: result.js += 1; + result.jsSize += fileSize; break; case 2 /* JSX */: result.jsx += 1; + result.jsxSize += fileSize; break; case 3 /* TS */: - ts.fileExtensionIs(info.fileName, ".d.ts" /* Dts */) - ? result.dts += 1 - : result.ts += 1; + if (ts.fileExtensionIs(info.fileName, ".d.ts" /* Dts */)) { + result.dts += 1; + result.dtsSize += fileSize; + } + else { + result.ts += 1; + result.tsSize += fileSize; + } break; case 4 /* TSX */: result.tsx += 1; + result.tsxSize += fileSize; break; case 7 /* Deferred */: result.deferred += 1; + result.deferredSize += fileSize; break; } } @@ -120957,7 +121210,7 @@ var ts; return false; }; Project.prototype.containsScriptInfo = function (info) { - return this.isRoot(info) || (this.program && this.program.getSourceFileByPath(info.path) !== undefined); + return this.isRoot(info) || (!!this.program && this.program.getSourceFileByPath(info.path) !== undefined); }; Project.prototype.containsFile = function (filename, requireOpen) { var info = this.projectService.getScriptInfoForNormalizedPath(filename); @@ -121149,7 +121402,7 @@ var ts; return fileWatcher; }; Project.prototype.isWatchedMissingFile = function (path) { - return this.missingFilesMap && this.missingFilesMap.has(path); + return !!this.missingFilesMap && this.missingFilesMap.has(path); }; Project.prototype.getScriptInfoForNormalizedPath = function (fileName) { var scriptInfo = this.projectService.getScriptInfoForPath(this.toPath(fileName)); @@ -121480,6 +121733,8 @@ var ts; /*lastFileExceededProgramSize*/ undefined, /*compilerOptions*/ {}, /*compileOnSaveEnabled*/ false, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; + /*@internal*/ + _this.canConfigFileJsonReportNoInputFiles = false; /** Ref count to the project when opened from external project */ _this.externalProjectRefCount = 0; _this.isInitialLoadPending = ts.returnTrue; @@ -121944,6 +122199,8 @@ var ts; this.safelist = defaultTypeSafeList; this.legacySafelist = ts.createMap(); this.pendingProjectUpdates = ts.createMap(); + /* @internal */ + this.pendingEnsureProjectForOpenFiles = false; /** Tracks projects that we have already sent telemetry for. */ this.seenProjects = ts.createMap(); /** Tracks projects that we have already sent survey events for. */ @@ -122889,7 +123146,7 @@ var ts; setProjectOptionsUsed(project); var data = { projectId: this.host.createSHA256Hash(project.projectName), - fileStats: server.countEachFileTypes(project.getScriptInfos()), + fileStats: server.countEachFileTypes(project.getScriptInfos(), /*includeSizes*/ true), compilerOptions: ts.convertCompilerOptionsForTelemetry(project.getCompilationSettings()), typeAcquisition: convertTypeAcquisition(project.getTypeAcquisition()), extends: projectOptions && projectOptions.configHasExtendsProperty, @@ -123170,7 +123427,7 @@ var ts; return this.createInferredProject(currentDirectory); }; ProjectService.prototype.createInferredProject = function (currentDirectory, isSingleInferredProject, projectRootPath) { - var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; // TODO: GH#18217 var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath, currentDirectory, this.currentPluginConfigOverrides); if (isSingleInferredProject) { this.inferredProjects.unshift(project); @@ -125900,7 +126157,7 @@ var ts; Session.prototype.isLocation = function (locationOrSpan) { return locationOrSpan.line !== undefined; }; - Session.prototype.extractPositionAndRange = function (args, scriptInfo) { + Session.prototype.extractPositionOrRange = function (args, scriptInfo) { var position; var textRange; if (this.isLocation(args)) { @@ -125910,7 +126167,7 @@ var ts; var _a = this.getStartAndEndPosition(args, scriptInfo), startPosition = _a.startPosition, endPosition = _a.endPosition; textRange = { pos: startPosition, end: endPosition }; } - return { position: position, textRange: textRange }; // TODO: GH#18217 + return ts.Debug.assertDefined(position === undefined ? textRange : position); function getPosition(loc) { return loc.position !== undefined ? loc.position : scriptInfo.lineOffsetToPosition(loc.line, loc.offset); } @@ -125918,14 +126175,12 @@ var ts; Session.prototype.getApplicableRefactors = function (args) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; - return project.getLanguageService().getApplicableRefactors(file, position || textRange, this.getPreferences(file)); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); }; Session.prototype.getEditsForRefactor = function (args, simplifiedResult) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); - var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; - var result = project.getLanguageService().getEditsForRefactor(file, this.getFormatOptions(file), position || textRange, args.refactor, args.action, this.getPreferences(file)); + var result = project.getLanguageService().getEditsForRefactor(file, this.getFormatOptions(file), this.extractPositionOrRange(args, scriptInfo), args.refactor, args.action, this.getPreferences(file)); if (result === undefined) { return { edits: [] diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 83a5cab6a59..0e693f698f2 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } @@ -1976,7 +1976,8 @@ declare namespace ts { AllowEmptyTuple = 524288, AllowUniqueESSymbolType = 1048576, AllowEmptyIndexInfoType = 2097152, - IgnoreErrors = 3112960, + AllowNodeModulesRelativePaths = 67108864, + IgnoreErrors = 70221824, InObjectTypeLiteral = 4194304, InTypeAlias = 8388608, InInitialEntityName = 16777216, @@ -3131,7 +3132,6 @@ declare namespace ts { function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } -/** Non-internal stuff goes here */ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): SortedReadonlyArray; @@ -3478,6 +3478,7 @@ declare namespace ts { type TemplateLiteralToken = NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail; function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; + function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; function isModifier(node: Node): node is Modifier; function isEntityName(node: Node): node is EntityName; @@ -4867,7 +4868,7 @@ declare namespace ts { message: string; position: number; } - class TextChange { + interface TextChange { span: TextSpan; newText: string; } diff --git a/lib/typescript.js b/lib/typescript.js index 9b296e619a2..25e193cff42 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -73,7 +73,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); @@ -3051,13 +3051,15 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + // Errors (cont.) + NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 70221824] = "IgnoreErrors"; // State NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; - /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 67108864] = "DoNotIncludeSymbolChain"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -5249,7 +5251,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -5356,7 +5358,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -5439,7 +5441,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -5470,7 +5472,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -5515,6 +5517,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5614,6 +5617,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -6009,6 +6013,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6104,6 +6109,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -6172,6 +6178,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -6401,11 +6410,28 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + /* @internal */ + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -8057,7 +8083,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/** Non-internal stuff goes here */ var ts; (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -12342,6 +12367,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) + || kind === 120 /* AnyKeyword */ + || kind === 143 /* UnknownKeyword */ + || kind === 135 /* NumberKeyword */ + || kind === 146 /* BigIntKeyword */ + || kind === 136 /* ObjectKeyword */ + || kind === 123 /* BooleanKeyword */ + || kind === 138 /* StringKeyword */ + || kind === 139 /* SymbolKeyword */ + || kind === 100 /* ThisKeyword */ + || kind === 106 /* VoidKeyword */ + || kind === 141 /* UndefinedKeyword */ + || kind === 96 /* NullKeyword */ + || kind === 132 /* NeverKeyword */ + || kind === 211 /* ExpressionWithTypeArguments */ + || kind === 284 /* JSDocAllType */ + || kind === 285 /* JSDocUnknownType */ + || kind === 286 /* JSDocNullableType */ + || kind === 287 /* JSDocNonNullableType */ + || kind === 288 /* JSDocOptionalType */ + || kind === 289 /* JSDocFunctionType */ + || kind === 290 /* JSDocVariadicType */; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -13810,6 +13860,10 @@ var ts; || kind === 17 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } @@ -13978,37 +14032,13 @@ var ts; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type - function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 284 /* JSDocAllType */ - || kind === 285 /* JSDocUnknownType */ - || kind === 286 /* JSDocNullableType */ - || kind === 287 /* JSDocNonNullableType */ - || kind === 288 /* JSDocOptionalType */ - || kind === 289 /* JSDocFunctionType */ - || kind === 290 /* JSDocVariadicType */; - } /** * Node test that determines whether a node is a valid type node. * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* * of a TypeNode. */ function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -16529,53 +16559,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299 /* JSDocParameterTag */: case 305 /* JSDocPropertyTag */: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 302 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295 /* JSDocAugmentsTag */: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303 /* JSDocTemplateTag */: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304 /* JSDocTypedefTag */: - if (node.typeExpression && - node.typeExpression.kind === 283 /* JSDocTypeExpression */) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 /* JSDocTypeExpression */ + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297 /* JSDocCallbackTag */: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300 /* JSDocReturnTag */: + case 302 /* JSDocTypeTag */: case 301 /* JSDocThisTag */: - return visitNode(cbNode, node.typeExpression); case 298 /* JSDocEnumTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293 /* JSDocSignature */: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292 /* JSDocTypeLiteral */: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294 /* JSDocTag */: + case 296 /* JSDocClassTag */: + return visitNode(cbNode, node.tagName); case 308 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } @@ -23278,6 +23301,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23741,18 +23776,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -28223,6 +28246,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -29336,7 +29360,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -30908,17 +30932,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -30948,6 +30962,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -31497,7 +31512,11 @@ var ts; (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432 /* Transient */)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { @@ -32061,7 +32080,7 @@ var ts; // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -32756,8 +32775,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -32785,7 +32804,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations @@ -33056,6 +33075,50 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + // Try to make an import using an import already in the enclosing file, if possible + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached) + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } /** * Attempts to find the symbol corresponding to the container a symbol is in - usually this * is just its' `.parent`, but for locals, this value is `undefined` @@ -33064,10 +33127,12 @@ var ts; var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) { - return ts.concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); // This order expresses a preference for the real container if it is in scope } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -33506,7 +33571,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } - var nodeFlags = 3112960 /* IgnoreErrors */; + var nodeFlags = 70221824 /* IgnoreErrors */; if (flags & 2 /* UseOnlyExternalAliasing */) { nodeFlags |= 128 /* UseOnlyExternalAliasing */; } @@ -33517,7 +33582,7 @@ var ts; nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (flags & 16 /* DoNotIncludeSymbolChain */) { - nodeFlags |= 67108864 /* DoNotIncludeSymbolChain */; + nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */; } var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -33540,7 +33605,7 @@ var ts; else { sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); // TODO: GH#18217 @@ -33551,7 +33616,7 @@ var ts; if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -33602,7 +33667,7 @@ var ts; enclosingDeclaration: enclosingDeclaration, flags: flags || 0 /* None */, // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 /* DoNotIncludeSymbolChain */ ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -33855,11 +33920,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832 /* Type */); } else { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } } else { @@ -33873,11 +33934,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -34062,10 +34119,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048 /* ReverseMapped */) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -34096,8 +34158,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1 /* NoTruncation */)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); + } + return ts.createKeywordTypeNode(120 /* AnyKeyword */); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -34127,8 +34197,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; if (modifiers) { @@ -34314,7 +34390,7 @@ var ts; // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 67108864 /* DoNotIncludeSymbolChain */)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true)); ts.Debug.assert(chain && chain.length > 0); } @@ -34325,13 +34401,22 @@ var ts; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -34354,6 +34439,24 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + // Both relative or both non-relative, sort by number of parts + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + // A is non-relative, B is relative: prefer A + return -1; + } + // A is relative, B is non-relative: prefer B + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -34442,6 +34545,14 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error + // since declaration files with these kinds of references are liable to fail when published :( + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -34578,7 +34689,7 @@ var ts; if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); @@ -36003,7 +36114,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -36059,7 +36170,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -39359,7 +39470,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -42760,12 +42871,8 @@ var ts; return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -42871,6 +42978,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -43243,6 +43353,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151 /* Parameter */: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -45644,7 +45764,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3 /* Variable */) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -47129,6 +47254,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking @@ -47596,16 +47732,31 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4 /* String */) { + return [anySignature]; + } + else if (elementType.flags & 128 /* StringLiteral */) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); // Resolve the signatures, preferring constructor - var signatures = getSignaturesOfType(elementType, 1 /* Construct */); + var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); if (signatures.length === 0) { // No construct signatures, try call signatures - signatures = getSignaturesOfType(elementType, 0 /* Call */); + signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); } - if (signatures.length === 0 && elementType.flags & 1048576 /* Union */) { + if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { // If each member has some combination of new/call signatures; make a union signature list for those - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -47978,7 +48129,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -48177,7 +48328,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { @@ -49546,20 +49697,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128 /* StringLiteral */) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 /* String */ || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -51184,8 +51323,17 @@ var ts; leftType; case 59 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288 /* Object */) || + declKind !== 2 /* ModuleExports */ && + declKind !== 6 /* Prototype */ && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1 /* Class */)) { + // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -51200,10 +51348,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2 /* ModuleExports */) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32 /* Class */) { @@ -53268,7 +53415,7 @@ var ts; } function registerForUnusedIdentifiersCheck(node) { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304 /* Ambient */)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -53289,9 +53436,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279 /* SourceFile */: case 244 /* ModuleDeclaration */: case 218 /* Block */: @@ -53308,7 +53452,7 @@ var ts; case 156 /* MethodDeclaration */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -53319,9 +53463,12 @@ var ts; case 165 /* FunctionType */: case 166 /* ConstructorType */: case 242 /* TypeAliasDeclaration */: - case 176 /* InferType */: + case 241 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176 /* InferType */: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -53336,77 +53483,73 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304 /* Ambient */)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - // Already would have reported an error on the getter. - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156 /* MethodDeclaration */: + case 154 /* PropertyDeclaration */: + case 158 /* GetAccessor */: + case 159 /* SetAccessor */: + if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. break; - case 157 /* Constructor */: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { - addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157 /* Constructor */: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { + addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: - // Can't be private - break; - default: - ts.Debug.fail(); - } + } + break; + case 162 /* IndexSignature */: + case 217 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + } + } function checkUnusedTypeParameters(node, addDiagnostic) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & 4194304 /* Ambient */ || node.kind !== 176 /* InferType */ && ts.last(getSymbolOfNode(node).declarations) !== node) + if (ts.last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === 176 /* InferType */) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + // Whole @template tag + ? ts.rangeOfNode(parent) + // Include the `<>` in the error message + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - // Whole @template tag - ? ts.rangeOfNode(parent) - // Include the `<>` in the error message - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } @@ -53827,9 +53970,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); } } } @@ -54887,7 +55030,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -56493,7 +56636,10 @@ var ts; } if (isDeclarationNameOrImportPropertyName(node)) { // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -64701,7 +64847,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -64710,7 +64856,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -79700,6 +79846,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -79788,6 +79935,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -82775,7 +82927,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -83513,7 +83665,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -85967,6 +86119,7 @@ var ts; // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2 /* Completely */) { @@ -87325,15 +87478,20 @@ var ts; * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -89696,6 +89854,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -91438,6 +91597,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); @@ -91487,11 +91649,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } @@ -92200,12 +92368,6 @@ var ts; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); /* @internal */ ts.emptyOptions = {}; - var TextChange = /** @class */ (function () { - function TextChange() { - } - return TextChange; - }()); - ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -92669,6 +92831,10 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; + function isTagName(node) { + return ts.isJSDocTag(node.parent) && node.parent.tagName === node; + } + ts.isTagName = isTagName; function isRightSideOfQualifiedName(node) { return node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node; } @@ -93559,6 +93725,7 @@ var ts; ts.createTextChange = createTextChange; ts.typeKeywords = [ 120 /* AnyKeyword */, + 146 /* BigIntKeyword */, 123 /* BooleanKeyword */, 87 /* FalseKeyword */, 129 /* KeyOfKeyword */, @@ -93992,9 +94159,7 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { - return !!location.parent && - (location.parent.kind === 253 /* ImportSpecifier */ || location.parent.kind === 257 /* ExportSpecifier */) && - location.parent.propertyName === location; + return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; /** @@ -95416,26 +95581,21 @@ var ts; * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option */ - function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { // Make all paths absolute/normalized if they are not already rootDirs = rootDirs.map(function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); // Determine the path to the directory containing the script relative to the root directory it is contained within var relativeDirectory = ts.firstDefined(rootDirs, function (rootDirectory) { - return ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase) ? scriptPath.substr(rootDirectory.length) : undefined; + return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined; }); // TODO: GH#18217 // Now find a path for each potential directory that is to be merged with the one containing the script - return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); + return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensionOptions, compilerOptions, host, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - var result = []; - for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { - var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude, result); - } - return result; + var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return ts.flatMap(baseDirectories, function (baseDirectory) { return getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude); }); } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. @@ -96666,7 +96826,8 @@ var ts; position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; isInSnippetScope = isSnippetScope(scopeNode); - var symbolMeanings = 67897832 /* Type */ | 67220415 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + var isTypeOnly = isTypeOnlyCompletion(); + var symbolMeanings = (isTypeOnly ? 0 /* None */ : 67220415 /* Value */) | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 279 /* SourceFile */) { @@ -96715,9 +96876,9 @@ var ts; } } function filterGlobalCompletion(symbols) { - var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - if (isTypeOnlyCompletion) + var isTypeOnly = isTypeOnlyCompletion(); + var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + if (isTypeOnly) keywordFilters = 6 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -96733,7 +96894,7 @@ var ts; if (allowTypes) { // Its a type, but you can reach it by namespace.type as well var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); - if (symbolAllowedAsType || isTypeOnlyCompletion) { + if (symbolAllowedAsType || isTypeOnly) { return symbolAllowedAsType; } } @@ -96742,6 +96903,9 @@ var ts; return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */); }); } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 104 /* TypeOfKeyword */ && @@ -97127,6 +97291,7 @@ var ts; if (contextToken) { var parent = contextToken.parent; switch (contextToken.kind) { + case 30 /* GreaterThanToken */: // End of a type argument list case 29 /* LessThanSlashToken */: case 42 /* SlashToken */: case 72 /* Identifier */: @@ -97135,6 +97300,11 @@ var ts; case 267 /* JsxAttribute */: case 269 /* JsxSpreadAttribute */: if (parent && (parent.kind === 261 /* JsxSelfClosingElement */ || parent.kind === 262 /* JsxOpeningElement */)) { + if (contextToken.kind === 30 /* GreaterThanToken */) { + var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); + if (!parent.typeArguments || (precedingToken && precedingToken.kind === 42 /* SlashToken */)) + break; + } return parent; } else if (parent.kind === 267 /* JsxAttribute */) { @@ -98553,7 +98723,7 @@ var ts; return undefined; } var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); - return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + return { kind: 0 /* Import */, symbol: lhsSymbol }; } else { return exportInfo(symbol, getExportKindForDeclaration(exportNode)); @@ -98623,7 +98793,7 @@ var ts; // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = ts.symbolEscapedNameNoDefault(importedSymbol); if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { - return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + return { kind: 0 /* Import */, symbol: importedSymbol }; } } function exportInfo(symbol, kind) { @@ -98668,18 +98838,16 @@ var ts; var parent = node.parent; switch (parent.kind) { case 248 /* ImportEqualsDeclaration */: - return parent.name === node && isExternalModuleImportEquals(parent) - ? { isNamedImport: false } - : undefined; + return parent.name === node && isExternalModuleImportEquals(parent); case 253 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. - return parent.propertyName ? undefined : { isNamedImport: true }; + return !parent.propertyName; case 250 /* ImportClause */: case 251 /* NamespaceImport */: ts.Debug.assert(parent.name === node); - return { isNamedImport: false }; + return true; default: - return undefined; + return false; } } function getExportInfo(exportSymbol, exportKind, checker) { @@ -98797,7 +98965,7 @@ var ts; } } function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { - return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node); }); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node, program.getTypeChecker()); }); } FindAllReferences.findReferenceOrRenameEntries = findReferenceOrRenameEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { @@ -98851,8 +99019,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode)); + function toRenameLocation(entry, originalNode, checker) { + return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98881,25 +99049,27 @@ var ts; return { textSpan: getTextSpan(entry.node, sourceFile), fileName: sourceFile.fileName }; } } - function getPrefixAndSuffixText(entry, originalNode) { + function getPrefixAndSuffixText(entry, originalNode, checker) { if (entry.kind !== 0 /* Span */ && ts.isIdentifier(originalNode)) { var node = entry.node, kind = entry.kind; var name = originalNode.text; var isShorthandAssignment = ts.isShorthandPropertyAssignment(node.parent); if (isShorthandAssignment || ts.isObjectBindingElementWithoutPropertyName(node.parent)) { - if (kind === 3 /* SearchedLocalFoundProperty */) { - return { prefixText: name + ": " }; - } - else if (kind === 4 /* SearchedPropertyFoundLocal */) { - return { suffixText: ": " + name }; - } - else { - return isShorthandAssignment + var prefixColon = { prefixText: name + ": " }; + var suffixColon = { suffixText: ": " + name }; + return kind === 3 /* SearchedLocalFoundProperty */ ? prefixColon + : kind === 4 /* SearchedPropertyFoundLocal */ ? suffixColon // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol. - ? { suffixText: ": " + name } // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol. - : { prefixText: name + ": " }; - } + : isShorthandAssignment ? suffixColon : prefixColon; + } + else if (ts.isImportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + // If the original symbol was using this alias, just rename the alias. + var originalSymbol = ts.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return ts.contains(originalSymbol.declarations, entry.node.parent) ? { prefixText: name + " as " } : ts.emptyOptions; + } + else if (ts.isExportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + return originalNode === entry.node ? { prefixText: name + " as " } : { suffixText: " as " + name }; } } return ts.emptyOptions; @@ -99154,13 +99324,18 @@ var ts; return undefined; } /** Core find-all-references algorithm for a normal symbol. */ - function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - symbol = node && skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - if (node && node.kind === 80 /* DefaultKeyword */) { + var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + if (exportSpecifier) { + // When renaming at an export specifier, rename the export and not the thing being exported. + getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); + } + else if (node && node.kind === 80 /* DefaultKeyword */) { addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } @@ -99198,15 +99373,11 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { var parent = node.parent; - if (ts.isExportSpecifier(parent)) { + if (ts.isExportSpecifier(parent) && !isForRename) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } - if (ts.isImportSpecifier(parent) && parent.propertyName === node) { - // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. - return checker.getImmediateAliasedSymbol(symbol); - } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { @@ -99369,7 +99540,8 @@ var ts; var indirectUser = indirectUsers_2[_b]; for (var _c = 0, _d = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName); _c < _d.length; _c++) { var node = _d[_c]; - if (ts.isIdentifier(node) && checker.getSymbolAtLocation(node) === exportSymbol) { + // Import specifiers should be handled by importSearches + if (ts.isIdentifier(node) && !ts.isImportOrExportSpecifier(node.parent) && checker.getSymbolAtLocation(node) === exportSymbol) { cb(node); } } @@ -99385,7 +99557,7 @@ var ts; if (!ts.isIdentifier(singleRef)) return false; // At `default` in `import { default as x }` or `export { default as x }`, do add a reference, but do not rename. - return !((ts.isExportSpecifier(singleRef.parent) || ts.isImportSpecifier(singleRef.parent)) && singleRef.escapedText === "default" /* Default */); + return !(ts.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default" /* Default */); } // Go to the symbol we imported from and find references for it. function searchForImportedSymbol(symbol, state) { @@ -99664,16 +99836,16 @@ var ts; } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } - function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere) { + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); - if (!search.includes(localSymbol)) { + if (!alwaysGetReferences && !search.includes(localSymbol)) { return; } if (!propertyName) { // Don't rename at `export { default } from "m";`. (but do continue to search for imports of the re-export) - if (!(state.options.isForRename && name.escapedText === "default" /* Default */)) { + if (!(state.options.isForRename && (name.escapedText === "default" /* Default */))) { addRef(); } } @@ -99684,7 +99856,7 @@ var ts; addRef(); } if (addReferencesHere && !state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, state); + addReference(name, ts.Debug.assertDefined(exportSpecifier.symbol), state); } } else { @@ -99693,15 +99865,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!(referenceLocation === propertyName && state.options.isForRename)) { + if (!state.options.isForRename || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; - var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); - if (!exportInfo) - return ts.Debug.fail(); - searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); + var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99733,12 +99904,11 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename || importOrExport.isNamedImport) { + if (!state.options.isForRename) { searchForImportedSymbol(symbol, state); } } else { - // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); } } @@ -103736,7 +103906,7 @@ var ts; function getEnclosingDeclarationFromInvocation(invocation) { return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node; } - var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; function createSignatureHelpItems(candidates, resolvedSignature, _a, sourceFile, typeChecker) { var isTypeParameterList = _a.isTypeParameterList, argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex; var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); @@ -104902,16 +105072,11 @@ var ts; this.options = options; } FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - ts.Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; + this.currentTokenSpan = ts.Debug.assertDefined(currentRange); + this.currentTokenParent = ts.Debug.assertDefined(currentTokenParent); + this.nextTokenSpan = ts.Debug.assertDefined(nextRange); + this.nextTokenParent = ts.Debug.assertDefined(nextTokenParent); + this.contextNode = ts.Debug.assertDefined(commonParent); // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; @@ -107637,7 +107802,6 @@ var ts; }; ChangeTracker.prototype.deleteRange = function (sourceFile, range) { this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); - return this; }; ChangeTracker.prototype.delete = function (sourceFile, node) { this.deletedNodes.push({ sourceFile: sourceFile, node: node }); @@ -107650,7 +107814,6 @@ var ts; var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - return this; }; ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) { if (options === void 0) { options = {}; } @@ -107661,11 +107824,10 @@ var ts; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); - return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } @@ -107674,18 +107836,17 @@ var ts; ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); - return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); }; ChangeTracker.prototype.replaceNodeWithText = function (sourceFile, oldNode, text) { this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, textChanges_3.useNonAdjustedPositions), text); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); }; ChangeTracker.prototype.nextCommaToken = function (sourceFile, node) { var next = ts.findNextToken(node, node.parent, sourceFile); @@ -107693,7 +107854,7 @@ var ts; }; ChangeTracker.prototype.replacePropertyAssignment = function (sourceFile, oldNode, newNode) { var suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ("," + this.newLineCharacter); - return this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); + this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } @@ -107942,11 +108103,11 @@ var ts; if (containingList === void 0) { containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); } if (!containingList) { ts.Debug.fail("node is not a list element"); - return this; + return; } var index = ts.indexOfNode(containingList, after); if (index < 0) { - return this; + return; } var end = after.getEnd(); if (index !== containingList.length - 1) { @@ -108044,7 +108205,6 @@ var ts; this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " }); } } - return this; }; ChangeTracker.prototype.finishClassesWithNodesInsertedAtStart = function () { var _this = this; @@ -109261,9 +109421,8 @@ var ts; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } - var isConstructor = declaration.kind === 157 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []); + return declaration.parameters.map(function (parameter, parameterIndex) { var types = []; var isRest = ts.isRestParameter(parameter); var isOptional = false; @@ -109283,7 +109442,8 @@ var ts; } } if (ts.isIdentifier(parameter.name)) { - types.push.apply(types, inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken)); + var inferred = inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken); + types.push.apply(types, (isRest ? ts.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred)); } var type = unifyFromContext(types, checker); return { @@ -109355,8 +109515,7 @@ var ts; usageContext.isNumber = true; break; case 38 /* PlusToken */: - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; break; // case SyntaxKind.ExclamationToken: // no inferences here; @@ -109418,8 +109577,7 @@ var ts; usageContext.isString = true; } else { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; } break; // AssignmentOperators @@ -109484,8 +109642,7 @@ var ts; } function inferTypeFromPropertyElementExpressionContext(parent, node, checker, usageContext) { if (node === parent.argumentExpression) { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; return; } else { @@ -109500,18 +109657,48 @@ var ts; } } } + function removeLowPriorityInferences(inferences, priorities) { + var toRemove = []; + for (var _i = 0, inferences_2 = inferences; _i < inferences_2.length; _i++) { + var i = inferences_2[_i]; + for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) { + var _b = priorities_1[_a], high = _b.high, low = _b.low; + if (high(i)) { + ts.Debug.assert(!low(i)); + toRemove.push(low); + } + } + } + return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); }); + } function unifyFromContext(inferences, checker, fallback) { if (fallback === void 0) { fallback = checker.getAnyType(); } if (!inferences.length) return fallback; - var hasNonVacuousType = inferences.some(function (i) { return !(i.flags & (1 /* Any */ | 16384 /* Void */)); }); - var hasNonVacuousNonAnonymousType = inferences.some(function (i) { return !(i.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); - var anons = inferences.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); - var good = []; - if (!hasNonVacuousNonAnonymousType && anons.length) { + // 1. string or number individually override string | number + // 2. non-any, non-void overrides any or void + // 3. non-nullable, non-any, non-void, non-anonymous overrides anonymous types + var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + var priorities = [ + { + high: function (t) { return t === checker.getStringType() || t === checker.getNumberType(); }, + low: function (t) { return t === stringNumber; } + }, + { + high: function (t) { return !(t.flags & (1 /* Any */ | 16384 /* Void */)); }, + low: function (t) { return !!(t.flags & (1 /* Any */ | 16384 /* Void */)); } + }, + { + high: function (t) { return !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(t) & 16 /* Anonymous */); }, + low: function (t) { return !!(checker.getObjectFlags(t) & 16 /* Anonymous */); } + } + ]; + var good = removeLowPriorityInferences(inferences, priorities); + var anons = good.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); + if (anons.length) { + good = good.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); good.push(unifyAnonymousTypes(anons, checker)); } - good.push.apply(good, inferences.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */) && !(hasNonVacuousType && i.flags & (1 /* Any */ | 16384 /* Void */)); })); return checker.getWidenedType(checker.getUnionType(good)); } InferFromReference.unifyFromContext = unifyFromContext; @@ -109559,6 +109746,9 @@ var ts; if (usageContext.isString) { types.push(checker.getStringType()); } + if (usageContext.isNumberOrString) { + types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } types.push.apply(types, (usageContext.candidateTypes || []).map(function (t) { return checker.getBaseTypeOfLiteralType(t); })); if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); // TODO: GH#18217 @@ -109569,7 +109759,7 @@ var ts; types.push(checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker))); } if (usageContext.numberIndexContext) { - return [checker.createArrayType(recur(usageContext.numberIndexContext))]; + types.push(checker.createArrayType(recur(usageContext.numberIndexContext))); } else if (usageContext.properties || usageContext.callContexts || usageContext.constructContexts || usageContext.stringIndexContext) { var members_6 = ts.createUnderscoreEscapedMap(); @@ -115311,7 +115501,7 @@ var ts; // readonly modifier only existed in classLikeDeclaration var constructor = ts.getFirstConstructorWithBody(container); if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName); + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); } } else { @@ -115364,7 +115554,7 @@ var ts; isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), container: declaration.kind === 151 /* Parameter */ ? declaration.parent.parent : declaration.parent, - originalName: declaration.name, + originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, accessorName: accessorName, @@ -115415,22 +115605,23 @@ var ts; ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); } - function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName) { + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { if (!constructor.body) return; - var file = context.file, program = context.program, cancellationToken = context.cancellationToken; - var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) { - return (entry.kind !== 0 /* Span */ && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined; - }); - ts.forEach(referenceEntries, function (entry) { - var parent = entry.parent; - var accessorName = ts.createIdentifier(fieldName.text); - var node = ts.isBinaryExpression(parent) - ? ts.updateBinary(parent, accessorName, parent.right, parent.operatorToken) - : ts.isPropertyAccessExpression(parent) - ? ts.updatePropertyAccess(parent, parent.expression, accessorName) - : ts.Debug.fail("Unexpected write access token"); - changeTracker.replaceNode(file, parent, node); + constructor.body.forEachChild(function recur(node) { + if (ts.isElementAccessExpression(node) && + node.expression.kind === 100 /* ThisKeyword */ && + ts.isStringLiteral(node.argumentExpression) && + node.argumentExpression.text === originalName && + ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, ts.createStringLiteral(fieldName)); + } + if (ts.isPropertyAccessExpression(node) && node.expression.kind === 100 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, ts.createIdentifier(fieldName)); + } + if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { + node.forEachChild(recur); + } }); } })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {})); @@ -117372,7 +117563,7 @@ var ts; function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 72 /* Identifier */: - return !ts.isLabelName(node); + return !ts.isLabelName(node) && !ts.isTagName(node); case 189 /* PropertyAccessExpression */: case 148 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` @@ -117954,7 +118145,7 @@ var ts; function initializeNameTable(sourceFile) { var nameTable = sourceFile.nameTable = ts.createUnderscoreEscapedMap(); sourceFile.forEachChild(function walk(node) { - if (ts.isIdentifier(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { + if (ts.isIdentifier(node) && !ts.isTagName(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { var text = ts.getEscapedTextOfIdentifierOrLiteral(node); nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); } @@ -118868,9 +119059,15 @@ var ts; if ("directoryExists" in this.shimHost) { this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; } + else { + this.directoryExists = undefined; // TODO: GH#18217 + } if ("realpath" in this.shimHost) { this.realpath = function (path) { return _this.shimHost.realpath(path); }; // TODO: GH#18217 } + else { + this.realpath = undefined; // TODO: GH#18217 + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) { var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217 diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 8cf2dcddc09..cad17f4992f 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.2"; + const versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ const version: string; } @@ -1976,7 +1976,8 @@ declare namespace ts { AllowEmptyTuple = 524288, AllowUniqueESSymbolType = 1048576, AllowEmptyIndexInfoType = 2097152, - IgnoreErrors = 3112960, + AllowNodeModulesRelativePaths = 67108864, + IgnoreErrors = 70221824, InObjectTypeLiteral = 4194304, InTypeAlias = 8388608, InInitialEntityName = 16777216, @@ -3131,7 +3132,6 @@ declare namespace ts { function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } -/** Non-internal stuff goes here */ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): SortedReadonlyArray; @@ -3478,6 +3478,7 @@ declare namespace ts { type TemplateLiteralToken = NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail; function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; + function isImportOrExportSpecifier(node: Node): node is ImportSpecifier | ExportSpecifier; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; function isModifier(node: Node): node is Modifier; function isEntityName(node: Node): node is EntityName; @@ -4867,7 +4868,7 @@ declare namespace ts { message: string; position: number; } - class TextChange { + interface TextChange { span: TextSpan; newText: string; } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 9b296e619a2..25e193cff42 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -73,7 +73,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); @@ -3051,13 +3051,15 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + // Errors (cont.) + NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 70221824] = "IgnoreErrors"; // State NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; - /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 67108864] = "DoNotIncludeSymbolChain"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -5249,7 +5251,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -5356,7 +5358,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -5439,7 +5441,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -5470,7 +5472,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -5515,6 +5517,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5614,6 +5617,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -6009,6 +6013,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6104,6 +6109,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -6172,6 +6178,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -6401,11 +6410,28 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + /* @internal */ + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -8057,7 +8083,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/** Non-internal stuff goes here */ var ts; (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -12342,6 +12367,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) + || kind === 120 /* AnyKeyword */ + || kind === 143 /* UnknownKeyword */ + || kind === 135 /* NumberKeyword */ + || kind === 146 /* BigIntKeyword */ + || kind === 136 /* ObjectKeyword */ + || kind === 123 /* BooleanKeyword */ + || kind === 138 /* StringKeyword */ + || kind === 139 /* SymbolKeyword */ + || kind === 100 /* ThisKeyword */ + || kind === 106 /* VoidKeyword */ + || kind === 141 /* UndefinedKeyword */ + || kind === 96 /* NullKeyword */ + || kind === 132 /* NeverKeyword */ + || kind === 211 /* ExpressionWithTypeArguments */ + || kind === 284 /* JSDocAllType */ + || kind === 285 /* JSDocUnknownType */ + || kind === 286 /* JSDocNullableType */ + || kind === 287 /* JSDocNonNullableType */ + || kind === 288 /* JSDocOptionalType */ + || kind === 289 /* JSDocFunctionType */ + || kind === 290 /* JSDocVariadicType */; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -13810,6 +13860,10 @@ var ts; || kind === 17 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } @@ -13978,37 +14032,13 @@ var ts; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type - function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 284 /* JSDocAllType */ - || kind === 285 /* JSDocUnknownType */ - || kind === 286 /* JSDocNullableType */ - || kind === 287 /* JSDocNonNullableType */ - || kind === 288 /* JSDocOptionalType */ - || kind === 289 /* JSDocFunctionType */ - || kind === 290 /* JSDocVariadicType */; - } /** * Node test that determines whether a node is a valid type node. * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* * of a TypeNode. */ function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -16529,53 +16559,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299 /* JSDocParameterTag */: case 305 /* JSDocPropertyTag */: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 302 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295 /* JSDocAugmentsTag */: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303 /* JSDocTemplateTag */: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304 /* JSDocTypedefTag */: - if (node.typeExpression && - node.typeExpression.kind === 283 /* JSDocTypeExpression */) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 /* JSDocTypeExpression */ + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297 /* JSDocCallbackTag */: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300 /* JSDocReturnTag */: + case 302 /* JSDocTypeTag */: case 301 /* JSDocThisTag */: - return visitNode(cbNode, node.typeExpression); case 298 /* JSDocEnumTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293 /* JSDocSignature */: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292 /* JSDocTypeLiteral */: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294 /* JSDocTag */: + case 296 /* JSDocClassTag */: + return visitNode(cbNode, node.tagName); case 308 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } @@ -23278,6 +23301,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23741,18 +23776,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -28223,6 +28246,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -29336,7 +29360,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -30908,17 +30932,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -30948,6 +30962,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -31497,7 +31512,11 @@ var ts; (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432 /* Transient */)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { @@ -32061,7 +32080,7 @@ var ts; // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -32756,8 +32775,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -32785,7 +32804,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations @@ -33056,6 +33075,50 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + // Try to make an import using an import already in the enclosing file, if possible + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached) + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } /** * Attempts to find the symbol corresponding to the container a symbol is in - usually this * is just its' `.parent`, but for locals, this value is `undefined` @@ -33064,10 +33127,12 @@ var ts; var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) { - return ts.concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); // This order expresses a preference for the real container if it is in scope } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -33506,7 +33571,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } - var nodeFlags = 3112960 /* IgnoreErrors */; + var nodeFlags = 70221824 /* IgnoreErrors */; if (flags & 2 /* UseOnlyExternalAliasing */) { nodeFlags |= 128 /* UseOnlyExternalAliasing */; } @@ -33517,7 +33582,7 @@ var ts; nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (flags & 16 /* DoNotIncludeSymbolChain */) { - nodeFlags |= 67108864 /* DoNotIncludeSymbolChain */; + nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */; } var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -33540,7 +33605,7 @@ var ts; else { sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); // TODO: GH#18217 @@ -33551,7 +33616,7 @@ var ts; if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -33602,7 +33667,7 @@ var ts; enclosingDeclaration: enclosingDeclaration, flags: flags || 0 /* None */, // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 /* DoNotIncludeSymbolChain */ ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -33855,11 +33920,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832 /* Type */); } else { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } } else { @@ -33873,11 +33934,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -34062,10 +34119,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048 /* ReverseMapped */) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -34096,8 +34158,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1 /* NoTruncation */)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); + } + return ts.createKeywordTypeNode(120 /* AnyKeyword */); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -34127,8 +34197,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; if (modifiers) { @@ -34314,7 +34390,7 @@ var ts; // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 67108864 /* DoNotIncludeSymbolChain */)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true)); ts.Debug.assert(chain && chain.length > 0); } @@ -34325,13 +34401,22 @@ var ts; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -34354,6 +34439,24 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + // Both relative or both non-relative, sort by number of parts + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + // A is non-relative, B is relative: prefer A + return -1; + } + // A is relative, B is non-relative: prefer B + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -34442,6 +34545,14 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error + // since declaration files with these kinds of references are liable to fail when published :( + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -34578,7 +34689,7 @@ var ts; if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); @@ -36003,7 +36114,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -36059,7 +36170,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -39359,7 +39470,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -42760,12 +42871,8 @@ var ts; return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -42871,6 +42978,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -43243,6 +43353,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151 /* Parameter */: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -45644,7 +45764,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3 /* Variable */) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -47129,6 +47254,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking @@ -47596,16 +47732,31 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4 /* String */) { + return [anySignature]; + } + else if (elementType.flags & 128 /* StringLiteral */) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); // Resolve the signatures, preferring constructor - var signatures = getSignaturesOfType(elementType, 1 /* Construct */); + var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); if (signatures.length === 0) { // No construct signatures, try call signatures - signatures = getSignaturesOfType(elementType, 0 /* Call */); + signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); } - if (signatures.length === 0 && elementType.flags & 1048576 /* Union */) { + if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { // If each member has some combination of new/call signatures; make a union signature list for those - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -47978,7 +48129,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -48177,7 +48328,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { @@ -49546,20 +49697,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128 /* StringLiteral */) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 /* String */ || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -51184,8 +51323,17 @@ var ts; leftType; case 59 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288 /* Object */) || + declKind !== 2 /* ModuleExports */ && + declKind !== 6 /* Prototype */ && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1 /* Class */)) { + // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -51200,10 +51348,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2 /* ModuleExports */) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32 /* Class */) { @@ -53268,7 +53415,7 @@ var ts; } function registerForUnusedIdentifiersCheck(node) { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304 /* Ambient */)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -53289,9 +53436,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279 /* SourceFile */: case 244 /* ModuleDeclaration */: case 218 /* Block */: @@ -53308,7 +53452,7 @@ var ts; case 156 /* MethodDeclaration */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -53319,9 +53463,12 @@ var ts; case 165 /* FunctionType */: case 166 /* ConstructorType */: case 242 /* TypeAliasDeclaration */: - case 176 /* InferType */: + case 241 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176 /* InferType */: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -53336,77 +53483,73 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304 /* Ambient */)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - // Already would have reported an error on the getter. - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156 /* MethodDeclaration */: + case 154 /* PropertyDeclaration */: + case 158 /* GetAccessor */: + case 159 /* SetAccessor */: + if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. break; - case 157 /* Constructor */: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { - addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157 /* Constructor */: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { + addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: - // Can't be private - break; - default: - ts.Debug.fail(); - } + } + break; + case 162 /* IndexSignature */: + case 217 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + } + } function checkUnusedTypeParameters(node, addDiagnostic) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & 4194304 /* Ambient */ || node.kind !== 176 /* InferType */ && ts.last(getSymbolOfNode(node).declarations) !== node) + if (ts.last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === 176 /* InferType */) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + // Whole @template tag + ? ts.rangeOfNode(parent) + // Include the `<>` in the error message + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - // Whole @template tag - ? ts.rangeOfNode(parent) - // Include the `<>` in the error message - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } @@ -53827,9 +53970,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); } } } @@ -54887,7 +55030,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -56493,7 +56636,10 @@ var ts; } if (isDeclarationNameOrImportPropertyName(node)) { // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -64701,7 +64847,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -64710,7 +64856,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -79700,6 +79846,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -79788,6 +79935,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -82775,7 +82927,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -83513,7 +83665,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -85967,6 +86119,7 @@ var ts; // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2 /* Completely */) { @@ -87325,15 +87478,20 @@ var ts; * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -89696,6 +89854,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -91438,6 +91597,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); @@ -91487,11 +91649,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } @@ -92200,12 +92368,6 @@ var ts; })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); /* @internal */ ts.emptyOptions = {}; - var TextChange = /** @class */ (function () { - function TextChange() { - } - return TextChange; - }()); - ts.TextChange = TextChange; var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -92669,6 +92831,10 @@ var ts; return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; + function isTagName(node) { + return ts.isJSDocTag(node.parent) && node.parent.tagName === node; + } + ts.isTagName = isTagName; function isRightSideOfQualifiedName(node) { return node.parent.kind === 148 /* QualifiedName */ && node.parent.right === node; } @@ -93559,6 +93725,7 @@ var ts; ts.createTextChange = createTextChange; ts.typeKeywords = [ 120 /* AnyKeyword */, + 146 /* BigIntKeyword */, 123 /* BooleanKeyword */, 87 /* FalseKeyword */, 129 /* KeyOfKeyword */, @@ -93992,9 +94159,7 @@ var ts; } ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { - return !!location.parent && - (location.parent.kind === 253 /* ImportSpecifier */ || location.parent.kind === 257 /* ExportSpecifier */) && - location.parent.propertyName === location; + return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; /** @@ -95416,26 +95581,21 @@ var ts; * Takes a script path and returns paths for all potential folders that could be merged with its * containing folder via the "rootDirs" compiler option */ - function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) { + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { // Make all paths absolute/normalized if they are not already rootDirs = rootDirs.map(function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); }); // Determine the path to the directory containing the script relative to the root directory it is contained within var relativeDirectory = ts.firstDefined(rootDirs, function (rootDirectory) { - return ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase) ? scriptPath.substr(rootDirectory.length) : undefined; + return ts.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : undefined; }); // TODO: GH#18217 // Now find a path for each potential directory that is to be merged with the one containing the script - return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); + return ts.deduplicate(rootDirs.map(function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }).concat([scriptDirectory]), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); } - function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptPath, extensionOptions, compilerOptions, host, exclude) { + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { var basePath = compilerOptions.project || host.getCurrentDirectory(); var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase); - var result = []; - for (var _i = 0, baseDirectories_1 = baseDirectories; _i < baseDirectories_1.length; _i++) { - var baseDirectory = baseDirectories_1[_i]; - getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude, result); - } - return result; + var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return ts.flatMap(baseDirectories, function (baseDirectory) { return getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude); }); } /** * Given a path ending at a directory, gets the completions for the path, and filters for those entries containing the basename. @@ -96666,7 +96826,8 @@ var ts; position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; isInSnippetScope = isSnippetScope(scopeNode); - var symbolMeanings = 67897832 /* Type */ | 67220415 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + var isTypeOnly = isTypeOnlyCompletion(); + var symbolMeanings = (isTypeOnly ? 0 /* None */ : 67220415 /* Value */) | 67897832 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */; symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 279 /* SourceFile */) { @@ -96715,9 +96876,9 @@ var ts; } } function filterGlobalCompletion(symbols) { - var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); - if (isTypeOnlyCompletion) + var isTypeOnly = isTypeOnlyCompletion(); + var allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + if (isTypeOnly) keywordFilters = 6 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -96733,7 +96894,7 @@ var ts; if (allowTypes) { // Its a type, but you can reach it by namespace.type as well var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); - if (symbolAllowedAsType || isTypeOnlyCompletion) { + if (symbolAllowedAsType || isTypeOnly) { return symbolAllowedAsType; } } @@ -96742,6 +96903,9 @@ var ts; return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67220415 /* Value */); }); } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 104 /* TypeOfKeyword */ && @@ -97127,6 +97291,7 @@ var ts; if (contextToken) { var parent = contextToken.parent; switch (contextToken.kind) { + case 30 /* GreaterThanToken */: // End of a type argument list case 29 /* LessThanSlashToken */: case 42 /* SlashToken */: case 72 /* Identifier */: @@ -97135,6 +97300,11 @@ var ts; case 267 /* JsxAttribute */: case 269 /* JsxSpreadAttribute */: if (parent && (parent.kind === 261 /* JsxSelfClosingElement */ || parent.kind === 262 /* JsxOpeningElement */)) { + if (contextToken.kind === 30 /* GreaterThanToken */) { + var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); + if (!parent.typeArguments || (precedingToken && precedingToken.kind === 42 /* SlashToken */)) + break; + } return parent; } else if (parent.kind === 267 /* JsxAttribute */) { @@ -98553,7 +98723,7 @@ var ts; return undefined; } var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); - return { kind: 0 /* Import */, symbol: lhsSymbol, isNamedImport: false }; + return { kind: 0 /* Import */, symbol: lhsSymbol }; } else { return exportInfo(symbol, getExportKindForDeclaration(exportNode)); @@ -98623,7 +98793,7 @@ var ts; // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = ts.symbolEscapedNameNoDefault(importedSymbol); if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { - return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); + return { kind: 0 /* Import */, symbol: importedSymbol }; } } function exportInfo(symbol, kind) { @@ -98668,18 +98838,16 @@ var ts; var parent = node.parent; switch (parent.kind) { case 248 /* ImportEqualsDeclaration */: - return parent.name === node && isExternalModuleImportEquals(parent) - ? { isNamedImport: false } - : undefined; + return parent.name === node && isExternalModuleImportEquals(parent); case 253 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. - return parent.propertyName ? undefined : { isNamedImport: true }; + return !parent.propertyName; case 250 /* ImportClause */: case 251 /* NamespaceImport */: ts.Debug.assert(parent.name === node); - return { isNamedImport: false }; + return true; default: - return undefined; + return false; } } function getExportInfo(exportSymbol, exportKind, checker) { @@ -98797,7 +98965,7 @@ var ts; } } function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { - return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node); }); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function (entry) { return convertEntry(entry, node, program.getTypeChecker()); }); } FindAllReferences.findReferenceOrRenameEntries = findReferenceOrRenameEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { @@ -98851,8 +99019,8 @@ var ts; var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } - function toRenameLocation(entry, originalNode) { - return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode)); + function toRenameLocation(entry, originalNode, checker) { + return __assign({}, entryToDocumentSpan(entry), getPrefixAndSuffixText(entry, originalNode, checker)); } FindAllReferences.toRenameLocation = toRenameLocation; function toReferenceEntry(entry) { @@ -98881,25 +99049,27 @@ var ts; return { textSpan: getTextSpan(entry.node, sourceFile), fileName: sourceFile.fileName }; } } - function getPrefixAndSuffixText(entry, originalNode) { + function getPrefixAndSuffixText(entry, originalNode, checker) { if (entry.kind !== 0 /* Span */ && ts.isIdentifier(originalNode)) { var node = entry.node, kind = entry.kind; var name = originalNode.text; var isShorthandAssignment = ts.isShorthandPropertyAssignment(node.parent); if (isShorthandAssignment || ts.isObjectBindingElementWithoutPropertyName(node.parent)) { - if (kind === 3 /* SearchedLocalFoundProperty */) { - return { prefixText: name + ": " }; - } - else if (kind === 4 /* SearchedPropertyFoundLocal */) { - return { suffixText: ": " + name }; - } - else { - return isShorthandAssignment + var prefixColon = { prefixText: name + ": " }; + var suffixColon = { suffixText: ": " + name }; + return kind === 3 /* SearchedLocalFoundProperty */ ? prefixColon + : kind === 4 /* SearchedPropertyFoundLocal */ ? suffixColon // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol. - ? { suffixText: ": " + name } // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol. - : { prefixText: name + ": " }; - } + : isShorthandAssignment ? suffixColon : prefixColon; + } + else if (ts.isImportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + // If the original symbol was using this alias, just rename the alias. + var originalSymbol = ts.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return ts.contains(originalSymbol.declarations, entry.node.parent) ? { prefixText: name + " as " } : ts.emptyOptions; + } + else if (ts.isExportSpecifier(entry.node.parent) && !entry.node.parent.propertyName) { + return originalNode === entry.node ? { prefixText: name + " as " } : { suffixText: " as " + name }; } } return ts.emptyOptions; @@ -99154,13 +99324,18 @@ var ts; return undefined; } /** Core find-all-references algorithm for a normal symbol. */ - function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { - symbol = node && skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + var symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, !!options.isForRename) || originalSymbol; // Compute the meaning from the location and the symbol it references var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7 /* All */; var result = []; var state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0 /* None */, checker, cancellationToken, searchMeaning, options, result); - if (node && node.kind === 80 /* DefaultKeyword */) { + var exportSpecifier = !options.isForRename ? undefined : ts.find(symbol.declarations, ts.isExportSpecifier); + if (exportSpecifier) { + // When renaming at an export specifier, rename the export and not the thing being exported. + getReferencesAtExportSpecifier(exportSpecifier.name, symbol, exportSpecifier, state.createSearch(node, originalSymbol, /*comingFrom*/ undefined), state, /*addReferencesHere*/ true, /*alwaysGetReferences*/ true); + } + else if (node && node.kind === 80 /* DefaultKeyword */) { addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } @@ -99198,15 +99373,11 @@ var ts; } } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, isForRename) { var parent = node.parent; - if (ts.isExportSpecifier(parent)) { + if (ts.isExportSpecifier(parent) && !isForRename) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); } - if (ts.isImportSpecifier(parent) && parent.propertyName === node) { - // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. - return checker.getImmediateAliasedSymbol(symbol); - } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { if (!decl.parent) { @@ -99369,7 +99540,8 @@ var ts; var indirectUser = indirectUsers_2[_b]; for (var _c = 0, _d = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName); _c < _d.length; _c++) { var node = _d[_c]; - if (ts.isIdentifier(node) && checker.getSymbolAtLocation(node) === exportSymbol) { + // Import specifiers should be handled by importSearches + if (ts.isIdentifier(node) && !ts.isImportOrExportSpecifier(node.parent) && checker.getSymbolAtLocation(node) === exportSymbol) { cb(node); } } @@ -99385,7 +99557,7 @@ var ts; if (!ts.isIdentifier(singleRef)) return false; // At `default` in `import { default as x }` or `export { default as x }`, do add a reference, but do not rename. - return !((ts.isExportSpecifier(singleRef.parent) || ts.isImportSpecifier(singleRef.parent)) && singleRef.escapedText === "default" /* Default */); + return !(ts.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default" /* Default */); } // Go to the symbol we imported from and find references for it. function searchForImportedSymbol(symbol, state) { @@ -99664,16 +99836,16 @@ var ts; } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } - function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere) { + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; var exportDeclaration = parent.parent; var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); - if (!search.includes(localSymbol)) { + if (!alwaysGetReferences && !search.includes(localSymbol)) { return; } if (!propertyName) { // Don't rename at `export { default } from "m";`. (but do continue to search for imports of the re-export) - if (!(state.options.isForRename && name.escapedText === "default" /* Default */)) { + if (!(state.options.isForRename && (name.escapedText === "default" /* Default */))) { addRef(); } } @@ -99684,7 +99856,7 @@ var ts; addRef(); } if (addReferencesHere && !state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, state); + addReference(name, ts.Debug.assertDefined(exportSpecifier.symbol), state); } } else { @@ -99693,15 +99865,14 @@ var ts; } } // For `export { foo as bar }`, rename `foo`, but not `bar`. - if (!(referenceLocation === propertyName && state.options.isForRename)) { + if (!state.options.isForRename || alwaysGetReferences) { var exportKind = referenceLocation.originalKeywordKind === 80 /* DefaultKeyword */ ? 1 /* Default */ : 0 /* Named */; - var exportInfo = FindAllReferences.getExportInfo(referenceSymbol, exportKind, state.checker); - if (!exportInfo) - return ts.Debug.fail(); - searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); + var exportSymbol = ts.Debug.assertDefined(exportSpecifier.symbol); + var exportInfo = ts.Debug.assertDefined(FindAllReferences.getExportInfo(exportSymbol, exportKind, state.checker)); + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. - if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { + if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName && !state.options.isForRename) { var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (imported) searchForImportedSymbol(imported, state); @@ -99733,12 +99904,11 @@ var ts; return; var symbol = importOrExport.symbol; if (importOrExport.kind === 0 /* Import */) { - if (!state.options.isForRename || importOrExport.isNamedImport) { + if (!state.options.isForRename) { searchForImportedSymbol(symbol, state); } } else { - // We don't check for `state.isForRename`, even for default exports, because importers that previously matched the export name should be updated to continue matching. searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); } } @@ -103736,7 +103906,7 @@ var ts; function getEnclosingDeclarationFromInvocation(invocation) { return invocation.kind === 0 /* Call */ ? invocation.node : invocation.kind === 1 /* TypeArgs */ ? invocation.called : invocation.node; } - var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 70221824 /* IgnoreErrors */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; function createSignatureHelpItems(candidates, resolvedSignature, _a, sourceFile, typeChecker) { var isTypeParameterList = _a.isTypeParameterList, argumentCount = _a.argumentCount, applicableSpan = _a.argumentsSpan, invocation = _a.invocation, argumentIndex = _a.argumentIndex; var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); @@ -104902,16 +105072,11 @@ var ts; this.options = options; } FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - ts.Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; + this.currentTokenSpan = ts.Debug.assertDefined(currentRange); + this.currentTokenParent = ts.Debug.assertDefined(currentTokenParent); + this.nextTokenSpan = ts.Debug.assertDefined(nextRange); + this.nextTokenParent = ts.Debug.assertDefined(nextTokenParent); + this.contextNode = ts.Debug.assertDefined(commonParent); // drop cached results this.contextNodeAllOnSameLine = undefined; this.nextNodeAllOnSameLine = undefined; @@ -107637,7 +107802,6 @@ var ts; }; ChangeTracker.prototype.deleteRange = function (sourceFile, range) { this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); - return this; }; ChangeTracker.prototype.delete = function (sourceFile, node) { this.deletedNodes.push({ sourceFile: sourceFile, node: node }); @@ -107650,7 +107814,6 @@ var ts; var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); - return this; }; ChangeTracker.prototype.deleteNodeRangeExcludingEnd = function (sourceFile, startNode, afterEndNode, options) { if (options === void 0) { options = {}; } @@ -107661,11 +107824,10 @@ var ts; ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); - return this; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } @@ -107674,18 +107836,17 @@ var ts; ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); - return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); }; ChangeTracker.prototype.replaceNodeWithText = function (sourceFile, oldNode, text) { this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, textChanges_3.useNonAdjustedPositions), text); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { if (options === void 0) { options = textChanges_3.useNonAdjustedPositions; } - return this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); }; ChangeTracker.prototype.nextCommaToken = function (sourceFile, node) { var next = ts.findNextToken(node, node.parent, sourceFile); @@ -107693,7 +107854,7 @@ var ts; }; ChangeTracker.prototype.replacePropertyAssignment = function (sourceFile, oldNode, newNode) { var suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : ("," + this.newLineCharacter); - return this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); + this.replaceNode(sourceFile, oldNode, newNode, { suffix: suffix }); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } @@ -107942,11 +108103,11 @@ var ts; if (containingList === void 0) { containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); } if (!containingList) { ts.Debug.fail("node is not a list element"); - return this; + return; } var index = ts.indexOfNode(containingList, after); if (index < 0) { - return this; + return; } var end = after.getEnd(); if (index !== containingList.length - 1) { @@ -108044,7 +108205,6 @@ var ts; this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " }); } } - return this; }; ChangeTracker.prototype.finishClassesWithNodesInsertedAtStart = function () { var _this = this; @@ -109261,9 +109421,8 @@ var ts; cancellationToken.throwIfCancellationRequested(); inferTypeFromContext(reference, checker, usageContext); } - var isConstructor = declaration.kind === 157 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var callContexts = (usageContext.constructContexts || []).concat(usageContext.callContexts || []); + return declaration.parameters.map(function (parameter, parameterIndex) { var types = []; var isRest = ts.isRestParameter(parameter); var isOptional = false; @@ -109283,7 +109442,8 @@ var ts; } } if (ts.isIdentifier(parameter.name)) { - types.push.apply(types, inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken)); + var inferred = inferTypesFromReferences(getReferences(parameter.name, program, cancellationToken), checker, cancellationToken); + types.push.apply(types, (isRest ? ts.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred)); } var type = unifyFromContext(types, checker); return { @@ -109355,8 +109515,7 @@ var ts; usageContext.isNumber = true; break; case 38 /* PlusToken */: - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; break; // case SyntaxKind.ExclamationToken: // no inferences here; @@ -109418,8 +109577,7 @@ var ts; usageContext.isString = true; } else { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; } break; // AssignmentOperators @@ -109484,8 +109642,7 @@ var ts; } function inferTypeFromPropertyElementExpressionContext(parent, node, checker, usageContext) { if (node === parent.argumentExpression) { - usageContext.isNumber = true; - usageContext.isString = true; + usageContext.isNumberOrString = true; return; } else { @@ -109500,18 +109657,48 @@ var ts; } } } + function removeLowPriorityInferences(inferences, priorities) { + var toRemove = []; + for (var _i = 0, inferences_2 = inferences; _i < inferences_2.length; _i++) { + var i = inferences_2[_i]; + for (var _a = 0, priorities_1 = priorities; _a < priorities_1.length; _a++) { + var _b = priorities_1[_a], high = _b.high, low = _b.low; + if (high(i)) { + ts.Debug.assert(!low(i)); + toRemove.push(low); + } + } + } + return inferences.filter(function (i) { return toRemove.every(function (f) { return !f(i); }); }); + } function unifyFromContext(inferences, checker, fallback) { if (fallback === void 0) { fallback = checker.getAnyType(); } if (!inferences.length) return fallback; - var hasNonVacuousType = inferences.some(function (i) { return !(i.flags & (1 /* Any */ | 16384 /* Void */)); }); - var hasNonVacuousNonAnonymousType = inferences.some(function (i) { return !(i.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); - var anons = inferences.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); - var good = []; - if (!hasNonVacuousNonAnonymousType && anons.length) { + // 1. string or number individually override string | number + // 2. non-any, non-void overrides any or void + // 3. non-nullable, non-any, non-void, non-anonymous overrides anonymous types + var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + var priorities = [ + { + high: function (t) { return t === checker.getStringType() || t === checker.getNumberType(); }, + low: function (t) { return t === stringNumber; } + }, + { + high: function (t) { return !(t.flags & (1 /* Any */ | 16384 /* Void */)); }, + low: function (t) { return !!(t.flags & (1 /* Any */ | 16384 /* Void */)); } + }, + { + high: function (t) { return !(t.flags & (98304 /* Nullable */ | 1 /* Any */ | 16384 /* Void */)) && !(checker.getObjectFlags(t) & 16 /* Anonymous */); }, + low: function (t) { return !!(checker.getObjectFlags(t) & 16 /* Anonymous */); } + } + ]; + var good = removeLowPriorityInferences(inferences, priorities); + var anons = good.filter(function (i) { return checker.getObjectFlags(i) & 16 /* Anonymous */; }); + if (anons.length) { + good = good.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */); }); good.push(unifyAnonymousTypes(anons, checker)); } - good.push.apply(good, inferences.filter(function (i) { return !(checker.getObjectFlags(i) & 16 /* Anonymous */) && !(hasNonVacuousType && i.flags & (1 /* Any */ | 16384 /* Void */)); })); return checker.getWidenedType(checker.getUnionType(good)); } InferFromReference.unifyFromContext = unifyFromContext; @@ -109559,6 +109746,9 @@ var ts; if (usageContext.isString) { types.push(checker.getStringType()); } + if (usageContext.isNumberOrString) { + types.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } types.push.apply(types, (usageContext.candidateTypes || []).map(function (t) { return checker.getBaseTypeOfLiteralType(t); })); if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); // TODO: GH#18217 @@ -109569,7 +109759,7 @@ var ts; types.push(checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker))); } if (usageContext.numberIndexContext) { - return [checker.createArrayType(recur(usageContext.numberIndexContext))]; + types.push(checker.createArrayType(recur(usageContext.numberIndexContext))); } else if (usageContext.properties || usageContext.callContexts || usageContext.constructContexts || usageContext.stringIndexContext) { var members_6 = ts.createUnderscoreEscapedMap(); @@ -115311,7 +115501,7 @@ var ts; // readonly modifier only existed in classLikeDeclaration var constructor = ts.getFirstConstructorWithBody(container); if (constructor) { - updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName); + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); } } else { @@ -115364,7 +115554,7 @@ var ts; isReadonly: ts.hasReadonlyModifier(declaration), type: ts.getTypeAnnotationNode(declaration), container: declaration.kind === 151 /* Parameter */ ? declaration.parent.parent : declaration.parent, - originalName: declaration.name, + originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, accessorName: accessorName, @@ -115415,22 +115605,23 @@ var ts; ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); } - function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, context, constructor, fieldName, originalName) { + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { if (!constructor.body) return; - var file = context.file, program = context.program, cancellationToken = context.cancellationToken; - var referenceEntries = ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken), function (entry) { - return (entry.kind !== 0 /* Span */ && ts.rangeContainsRange(constructor, entry.node) && ts.isIdentifier(entry.node) && ts.isWriteAccess(entry.node)) ? entry.node : undefined; - }); - ts.forEach(referenceEntries, function (entry) { - var parent = entry.parent; - var accessorName = ts.createIdentifier(fieldName.text); - var node = ts.isBinaryExpression(parent) - ? ts.updateBinary(parent, accessorName, parent.right, parent.operatorToken) - : ts.isPropertyAccessExpression(parent) - ? ts.updatePropertyAccess(parent, parent.expression, accessorName) - : ts.Debug.fail("Unexpected write access token"); - changeTracker.replaceNode(file, parent, node); + constructor.body.forEachChild(function recur(node) { + if (ts.isElementAccessExpression(node) && + node.expression.kind === 100 /* ThisKeyword */ && + ts.isStringLiteral(node.argumentExpression) && + node.argumentExpression.text === originalName && + ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, ts.createStringLiteral(fieldName)); + } + if (ts.isPropertyAccessExpression(node) && node.expression.kind === 100 /* ThisKeyword */ && node.name.text === originalName && ts.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, ts.createIdentifier(fieldName)); + } + if (!ts.isFunctionLike(node) && !ts.isClassLike(node)) { + node.forEachChild(recur); + } }); } })(generateGetAccessorAndSetAccessor = refactor.generateGetAccessorAndSetAccessor || (refactor.generateGetAccessorAndSetAccessor = {})); @@ -117372,7 +117563,7 @@ var ts; function shouldGetType(sourceFile, node, position) { switch (node.kind) { case 72 /* Identifier */: - return !ts.isLabelName(node); + return !ts.isLabelName(node) && !ts.isTagName(node); case 189 /* PropertyAccessExpression */: case 148 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` @@ -117954,7 +118145,7 @@ var ts; function initializeNameTable(sourceFile) { var nameTable = sourceFile.nameTable = ts.createUnderscoreEscapedMap(); sourceFile.forEachChild(function walk(node) { - if (ts.isIdentifier(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { + if (ts.isIdentifier(node) && !ts.isTagName(node) && node.escapedText || ts.isStringOrNumericLiteralLike(node) && literalIsName(node)) { var text = ts.getEscapedTextOfIdentifierOrLiteral(node); nameTable.set(text, nameTable.get(text) === undefined ? node.pos : -1); } @@ -118868,9 +119059,15 @@ var ts; if ("directoryExists" in this.shimHost) { this.directoryExists = function (directoryName) { return _this.shimHost.directoryExists(directoryName); }; } + else { + this.directoryExists = undefined; // TODO: GH#18217 + } if ("realpath" in this.shimHost) { this.realpath = function (path) { return _this.shimHost.realpath(path); }; // TODO: GH#18217 } + else { + this.realpath = undefined; // TODO: GH#18217 + } } CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extensions, exclude, include, depth) { var pattern = ts.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); // TODO: GH#18217 diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index f29014039b1..f3a4bfc0f58 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -86,7 +86,7 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "3.2"; + ts.versionMajorMinor = "3.3"; /** The version of the TypeScript compiler release */ ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); @@ -3064,13 +3064,15 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + // Errors (cont.) + NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 70221824] = "IgnoreErrors"; // State NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; - /* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 67108864] = "DoNotIncludeSymbolChain"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -5262,7 +5264,7 @@ var ts; An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), A_class_may_only_extend_another_class: diag(2311, ts.DiagnosticCategory.Error, "A_class_may_only_extend_another_class_2311", "A class may only extend another class."), - An_interface_may_only_extend_a_class_or_another_interface: diag(2312, ts.DiagnosticCategory.Error, "An_interface_may_only_extend_a_class_or_another_interface_2312", "An interface may only extend a class or another interface."), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), Type_0_is_not_generic: diag(2315, ts.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), @@ -5369,7 +5371,7 @@ var ts; Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), - A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2424, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property."), Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), @@ -5452,7 +5454,7 @@ var ts; _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), Type_0_is_not_a_constructor_function_type: diag(2507, ts.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), - Base_constructor_return_type_0_is_not_a_class_or_interface_type: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_a_class_or_interface_type_2509", "Base constructor return type '{0}' is not a class or interface type."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), Base_constructors_must_all_have_the_same_return_type: diag(2510, ts.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), @@ -5483,7 +5485,7 @@ var ts; Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), Type_0_cannot_be_used_as_an_index_type: diag(2538, ts.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property_2540", "Cannot assign to '{0}' because it is a constant or a read-only property."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), The_target_of_an_assignment_must_be_a_variable_or_a_property_access: diag(2541, ts.DiagnosticCategory.Error, "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541", "The target of an assignment must be a variable or a property access."), Index_signature_in_type_0_only_permits_reading: diag(2542, ts.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), @@ -5528,6 +5530,7 @@ var ts; _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), JSDoc_type_0_circularly_references_itself: diag(2587, ts.DiagnosticCategory.Error, "JSDoc_type_0_circularly_references_itself_2587", "JSDoc type '{0}' circularly references itself."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5627,6 +5630,7 @@ var ts; Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -6022,6 +6026,7 @@ var ts; Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -6117,6 +6122,7 @@ var ts; Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""), Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""), + Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), @@ -6185,6 +6191,9 @@ var ts; Generate_types_for_all_packages_without_types: diag(95068, ts.DiagnosticCategory.Message, "Generate_types_for_all_packages_without_types_95068", "Generate types for all packages without types"), Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), }; })(ts || (ts = {})); var ts; @@ -6414,11 +6423,28 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { + function getPositionOfLineAndCharacterWithEdits(sourceFile, line, character) { + return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + } + ts.getPositionOfLineAndCharacterWithEdits = getPositionOfLineAndCharacterWithEdits; + /* @internal */ + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { if (line < 0 || line >= lineStarts.length) { - ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + if (allowEdits) { + // Clamp line to nearest allowable value + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } + else { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } } var res = lineStarts[line] + character; + if (allowEdits) { + // Clamp to nearest allowable values to allow the underlying to be edited without crashing (accuracy is lost, instead) + // TODO: Somehow track edits between file as it was during the creation of sourcemap we have and the current file and + // apply them to the computed position to improve accuracy + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); } @@ -8070,7 +8096,6 @@ var ts; } ts.createScanner = createScanner; })(ts || (ts = {})); -/** Non-internal stuff goes here */ var ts; (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -12355,6 +12380,31 @@ var ts; return ts.isClassLike(node) || ts.isInterfaceDeclaration(node) || ts.isTypeLiteralNode(node); } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) + || kind === 120 /* AnyKeyword */ + || kind === 143 /* UnknownKeyword */ + || kind === 135 /* NumberKeyword */ + || kind === 146 /* BigIntKeyword */ + || kind === 136 /* ObjectKeyword */ + || kind === 123 /* BooleanKeyword */ + || kind === 138 /* StringKeyword */ + || kind === 139 /* SymbolKeyword */ + || kind === 100 /* ThisKeyword */ + || kind === 106 /* VoidKeyword */ + || kind === 141 /* UndefinedKeyword */ + || kind === 96 /* NullKeyword */ + || kind === 132 /* NeverKeyword */ + || kind === 211 /* ExpressionWithTypeArguments */ + || kind === 284 /* JSDocAllType */ + || kind === 285 /* JSDocUnknownType */ + || kind === 286 /* JSDocNullableType */ + || kind === 287 /* JSDocNonNullableType */ + || kind === 288 /* JSDocOptionalType */ + || kind === 289 /* JSDocFunctionType */ + || kind === 290 /* JSDocVariadicType */; + } + ts.isTypeNodeKind = isTypeNodeKind; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -13823,6 +13873,10 @@ var ts; || kind === 17 /* TemplateTail */; } ts.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts.isImportSpecifier(node) || ts.isExportSpecifier(node); + } + ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isStringTextContainingNode(node) { return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind); } @@ -13991,37 +14045,13 @@ var ts; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type - function isTypeNodeKind(kind) { - return (kind >= 163 /* FirstTypeNode */ && kind <= 183 /* LastTypeNode */) - || kind === 120 /* AnyKeyword */ - || kind === 143 /* UnknownKeyword */ - || kind === 135 /* NumberKeyword */ - || kind === 146 /* BigIntKeyword */ - || kind === 136 /* ObjectKeyword */ - || kind === 123 /* BooleanKeyword */ - || kind === 138 /* StringKeyword */ - || kind === 139 /* SymbolKeyword */ - || kind === 100 /* ThisKeyword */ - || kind === 106 /* VoidKeyword */ - || kind === 141 /* UndefinedKeyword */ - || kind === 96 /* NullKeyword */ - || kind === 132 /* NeverKeyword */ - || kind === 211 /* ExpressionWithTypeArguments */ - || kind === 284 /* JSDocAllType */ - || kind === 285 /* JSDocUnknownType */ - || kind === 286 /* JSDocNullableType */ - || kind === 287 /* JSDocNonNullableType */ - || kind === 288 /* JSDocOptionalType */ - || kind === 289 /* JSDocFunctionType */ - || kind === 290 /* JSDocVariadicType */; - } /** * Node test that determines whether a node is a valid type node. * This differs from the `isPartOfTypeNode` function which determines whether a node is *part* * of a TypeNode. */ function isTypeNode(node) { - return isTypeNodeKind(node.kind); + return ts.isTypeNodeKind(node.kind); } ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { @@ -16542,53 +16572,46 @@ var ts; return visitNodes(cbNode, cbNodes, node.tags); case 299 /* JSDocParameterTag */: case 305 /* JSDocPropertyTag */: - if (node.isNameFirst) { - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.typeExpression); - } - else { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.name); - } - case 300 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 302 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + (node.isNameFirst + ? visitNode(cbNode, node.name) || + visitNode(cbNode, node.typeExpression) + : visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.name)); case 295 /* JSDocAugmentsTag */: - return visitNode(cbNode, node.class); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.class); case 303 /* JSDocTemplateTag */: - return visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.constraint) || + visitNodes(cbNode, cbNodes, node.typeParameters); case 304 /* JSDocTypedefTag */: - if (node.typeExpression && - node.typeExpression.kind === 283 /* JSDocTypeExpression */) { - return visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.fullName); - } - else { - return visitNode(cbNode, node.fullName) || - visitNode(cbNode, node.typeExpression); - } + return visitNode(cbNode, node.tagName) || + (node.typeExpression && + node.typeExpression.kind === 283 /* JSDocTypeExpression */ + ? visitNode(cbNode, node.typeExpression) || + visitNode(cbNode, node.fullName) + : visitNode(cbNode, node.fullName) || + visitNode(cbNode, node.typeExpression)); case 297 /* JSDocCallbackTag */: - return visitNode(cbNode, node.fullName) || + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); + case 300 /* JSDocReturnTag */: + case 302 /* JSDocTypeTag */: case 301 /* JSDocThisTag */: - return visitNode(cbNode, node.typeExpression); case 298 /* JSDocEnumTag */: - return visitNode(cbNode, node.typeExpression); + return visitNode(cbNode, node.tagName) || + visitNode(cbNode, node.typeExpression); case 293 /* JSDocSignature */: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - ts.forEach(node.typeParameters, cbNode) || + return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); case 292 /* JSDocTypeLiteral */: - if (node.jsDocPropertyTags) { - for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { - var tag = _a[_i]; - visitNode(cbNode, tag); - } - } - return; + return ts.forEach(node.jsDocPropertyTags, cbNode); + case 294 /* JSDocTag */: + case 296 /* JSDocClassTag */: + return visitNode(cbNode, node.tagName); case 308 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } @@ -23291,6 +23314,18 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Enable_tracing_of_the_name_resolution_process }, + { + name: "diagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_diagnostic_information + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Show_verbose_diagnostic_information + }, ]; /* @internal */ ts.optionDeclarations = ts.commonOptionsWithBuild.concat([ @@ -23754,18 +23789,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, - { - name: "diagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_diagnostic_information - }, - { - name: "extendedDiagnostics", - type: "boolean", - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Show_verbose_diagnostic_information - }, { name: "resolveJsonModule", type: "boolean", @@ -28236,6 +28259,7 @@ var ts; } } function bindJSDocTypeAlias(node) { + node.tagName.parent = node; if (node.fullName) { setParentPointers(node, node.fullName); } @@ -29349,7 +29373,7 @@ var ts; return true; } var node = symbol.valueDeclaration; - if (ts.isCallExpression(node)) { + if (node && ts.isCallExpression(node)) { return !!ts.getAssignedExpandoInitializer(node); } var init = !node ? undefined : @@ -30921,17 +30945,7 @@ var ts; var parsed = ts.getParseTreeNode(node, ts.isFunctionLike); return parsed ? isImplementationOfOverload(parsed) : undefined; }, - getImmediateAliasedSymbol: function (symbol) { - ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.immediateTarget) { - var node = getDeclarationOfAliasSymbol(symbol); - if (!node) - return ts.Debug.fail(); - links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); - } - return links.immediateTarget; - }, + getImmediateAliasedSymbol: getImmediateAliasedSymbol, getAliasedSymbol: resolveAlias, getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, @@ -30961,6 +30975,7 @@ var ts; getNumberType: function () { return numberType; }, createPromiseType: createPromiseType, createArrayType: createArrayType, + getElementTypeOfArrayType: getElementTypeOfArrayType, getBooleanType: function () { return booleanType; }, getFalseType: function (fresh) { return fresh ? falseType : regularFalseType; }, getTrueType: function (fresh) { return fresh ? trueType : regularTrueType; }, @@ -31510,7 +31525,11 @@ var ts; (source.flags | target.flags) & 67108864 /* Assignment */) { ts.Debug.assert(source !== target); if (!(target.flags & 33554432 /* Transient */)) { - target = cloneSymbol(resolveSymbol(target)); + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol(resolvedTarget); } // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { @@ -32074,7 +32093,7 @@ var ts; // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation)) { result.isReferenced |= meaning; } if (!result) { @@ -32769,8 +32788,8 @@ var ts; undefined; return initializer || decl; } - function resolveExternalModuleName(location, moduleReferenceExpression) { - return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ts.Diagnostics.Cannot_find_module_0); + function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) { + return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? undefined : ts.Diagnostics.Cannot_find_module_0); } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -32798,7 +32817,7 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { - if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTS(resolvedModule.extension)) { + if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } // merged symbol is module declaration symbol combined with all augmentations @@ -33069,6 +33088,50 @@ var ts; function getParentOfSymbol(symbol) { return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts.getSourceFileOfNode(enclosingDeclaration); + var id = "" + getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + // Try to make an import using an import already in the enclosing file, if possible + for (var _i = 0, _a = containingFile.imports; _i < _a.length; _i++) { + var importRef = _a[_i]; + if (ts.nodeIsSynthesized(importRef)) + continue; // Synthetic names can't be resolved by `resolveExternalModuleName` - they'll cause a debug assert if they error + var resolvedModule = resolveExternalModuleName(enclosingDeclaration, importRef, /*ignoreErrors*/ true); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts.append(results, resolvedModule); + } + if (ts.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = ts.createMap())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + // No results from files already being imported by this file - expand search (expensive, but not location-specific, so cached) + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts.append(results, sym); + } + return links.extendedContainers = results || ts.emptyArray; + } /** * Attempts to find the symbol corresponding to the container a symbol is in - usually this * is just its' `.parent`, but for locals, this value is `undefined` @@ -33077,10 +33140,12 @@ var ts; var container = getParentOfSymbol(symbol); if (container) { var additionalContainers = ts.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); if (enclosingDeclaration && getAccessibleSymbolChain(container, enclosingDeclaration, 1920 /* Namespace */, /*externalOnly*/ false)) { - return ts.concatenate([container], additionalContainers); // This order expresses a preference for the real container if it is in scope + return ts.concatenate(ts.concatenate([container], additionalContainers), reexportContainers); // This order expresses a preference for the real container if it is in scope } - return ts.append(additionalContainers, container); + var res = ts.append(additionalContainers, container); + return ts.concatenate(res, reexportContainers); } var candidates = ts.mapDefined(symbol.declarations, function (d) { return !ts.isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent) ? getSymbolOfNode(d.parent) : undefined; }); if (!ts.length(candidates)) { @@ -33519,7 +33584,7 @@ var ts; } function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } - var nodeFlags = 3112960 /* IgnoreErrors */; + var nodeFlags = 70221824 /* IgnoreErrors */; if (flags & 2 /* UseOnlyExternalAliasing */) { nodeFlags |= 128 /* UseOnlyExternalAliasing */; } @@ -33530,7 +33595,7 @@ var ts; nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (flags & 16 /* DoNotIncludeSymbolChain */) { - nodeFlags |= 67108864 /* DoNotIncludeSymbolChain */; + nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */; } var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); @@ -33553,7 +33618,7 @@ var ts; else { sigOutput = kind === 1 /* Construct */ ? 161 /* ConstructSignature */ : 160 /* CallSignature */; } - var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, ts.getTrailingSemicolonOmittingWriter(writer)); // TODO: GH#18217 @@ -33564,7 +33629,7 @@ var ts; if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */; - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0), writer); if (typeNode === undefined) return ts.Debug.fail("should always get typenode"); var options = { removeComments: true }; @@ -33615,7 +33680,7 @@ var ts; enclosingDeclaration: enclosingDeclaration, flags: flags || 0 /* None */, // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost - tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 67108864 /* DoNotIncludeSymbolChain */ ? { + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop, moduleResolverHost: flags & 134217728 /* DoNotIncludeSymbolChain */ ? { getCommonSourceDirectory: host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; }, getSourceFiles: function () { return host.getSourceFiles(); }, getCurrentDirectory: host.getCurrentDirectory && (function () { return host.getCurrentDirectory(); }) @@ -33868,11 +33933,7 @@ var ts; return symbolToTypeNode(typeAlias, context, 67897832 /* Type */); } else { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } } else { @@ -33886,11 +33947,7 @@ var ts; } var depth = context.symbolDepth.get(id) || 0; if (depth > 10) { - context.approximateLength += 3; - if (!(context.flags & 1 /* NoTruncation */)) { - return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); - } - return ts.createKeywordTypeNode(120 /* AnyKeyword */); + return createElidedInformationPlaceholder(context); } context.symbolDepth.set(id, depth + 1); context.visitedTypes.set(typeId, true); @@ -34075,10 +34132,15 @@ var ts; typeElements.push(signatureToSignatureDeclarationHelper(signature, 161 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? - createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : - resolvedType.stringIndexInfo; - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); + var indexSignature = void 0; + if (resolvedType.objectFlags & 2048 /* ReverseMapped */) { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration), 0 /* String */, context); + indexSignature.type = createElidedInformationPlaceholder(context); + } + else { + indexSignature = indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context); + } + typeElements.push(indexSignature); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -34109,8 +34171,16 @@ var ts; return typeElements.length ? typeElements : undefined; } } + function createElidedInformationPlaceholder(context) { + context.approximateLength += 3; + if (!(context.flags & 1 /* NoTruncation */)) { + return ts.createTypeReferenceNode(ts.createIdentifier("..."), /*typeArguments*/ undefined); + } + return ts.createKeywordTypeNode(120 /* AnyKeyword */); + } function addPropertyToElementList(propertySymbol, context, typeElements) { - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + var propertyIsReverseMapped = !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */); + var propertyType = propertyIsReverseMapped && context.flags & 33554432 /* InReverseMappedType */ ? anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; @@ -34140,8 +34210,14 @@ var ts; } else { var savedFlags = context.flags; - context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; - var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + context.flags |= propertyIsReverseMapped ? 33554432 /* InReverseMappedType */ : 0; + var propertyTypeNode = void 0; + if (propertyIsReverseMapped && !!(savedFlags & 33554432 /* InReverseMappedType */)) { + propertyTypeNode = createElidedInformationPlaceholder(context); + } + else { + propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(120 /* AnyKeyword */); + } context.flags = savedFlags; var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(133 /* ReadonlyKeyword */)] : undefined; if (modifiers) { @@ -34327,7 +34403,7 @@ var ts; // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 67108864 /* DoNotIncludeSymbolChain */)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */) && !(context.flags & 134217728 /* DoNotIncludeSymbolChain */)) { chain = ts.Debug.assertDefined(getSymbolChain(symbol, meaning, /*endOfChain*/ true)); ts.Debug.assert(chain && chain.length > 0); } @@ -34338,13 +34414,22 @@ var ts; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); + var parentSpecifiers; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { // Go up and add our parent. - var parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); - if (ts.length(parents)) { - for (var _i = 0, _a = parents; _i < _a.length; _i++) { - var parent = _a[_i]; + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol, context.enclosingDeclaration); + if (ts.length(parents_1)) { + parentSpecifiers = parents_1.map(function (symbol) { + return ts.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol) + ? getSpecifierForModuleSymbol(symbol, context) + : undefined; + }); + var indices = parents_1.map(function (_, i) { return i; }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function (i) { return parents_1[i]; }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent = sortedParents_1[_i]; var parentChain = getSymbolChain(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); if (parentChain) { accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent, symbol) || symbol]); @@ -34367,6 +34452,24 @@ var ts; } return [symbol]; } + function sortByBestName(a, b) { + var specifierA = parentSpecifiers[a]; + var specifierB = parentSpecifiers[b]; + if (specifierA && specifierB) { + var isBRelative = ts.pathIsRelative(specifierB); + if (ts.pathIsRelative(specifierA) === isBRelative) { + // Both relative or both non-relative, sort by number of parts + return ts.moduleSpecifiers.countPathComponents(specifierA) - ts.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + // A is non-relative, B is relative: prefer A + return -1; + } + // A is relative, B is non-relative: prefer B + return 1; + } + return 0; + } } } function typeParametersToTypeParameterDeclarations(symbol, context) { @@ -34455,6 +34558,14 @@ var ts; var nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); var specifier = getSpecifierForModuleSymbol(chain[0], context); + if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs && specifier.indexOf("/node_modules/") >= 0) { + // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error + // since declaration files with these kinds of references are liable to fail when published :( + context.encounteredError = true; + if (context.tracker.reportLikelyUnsafeImportRequiredError) { + context.tracker.reportLikelyUnsafeImportRequiredError(specifier); + } + } var lit = ts.createLiteralTypeNode(ts.createLiteral(specifier)); if (context.tracker.trackExternalModuleSymbolOfImportTypeNode) context.tracker.trackExternalModuleSymbolOfImportTypeNode(chain[0]); @@ -34591,7 +34702,7 @@ var ts; if (flags === void 0) { flags = 16384 /* UseAliasDefinedOutsideCurrentScope */; } return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); function typePredicateToStringWorker(writer) { - var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); var printer = ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); @@ -36016,7 +36127,7 @@ var ts; return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { - error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); + error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(baseType)); return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { @@ -36072,7 +36183,7 @@ var ts; } } else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); + error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -39372,7 +39483,7 @@ var ts; if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 100 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -42773,12 +42884,8 @@ var ts; return true; } // A source signature partially matches a target signature if the target signature has no fewer required - // parameters and no more overall parameters than the source signature (where a signature with a rest - // parameter is always considered to have more overall parameters than one without). - var sourceRestCount = sourceHasRestParameter ? 1 : 0; - var targetRestCount = targetHasRestParameter ? 1 : 0; - if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount && (sourceRestCount > targetRestCount || - sourceRestCount === targetRestCount && sourceParameterCount >= targetParameterCount)) { + // parameters + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { return true; } return false; @@ -42884,6 +42991,9 @@ var ts; function isReadonlyArrayType(type) { return !!(ts.getObjectFlags(type) & 4 /* Reference */) && type.target === globalReadonlyArrayType; } + function getElementTypeOfArrayType(type) { + return isArrayType(type) && type.typeArguments ? type.typeArguments[0] : undefined; + } function isArrayLikeType(type) { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -43256,6 +43366,16 @@ var ts; diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; case 151 /* Parameter */: + var param = declaration; + if (ts.isIdentifier(param.name) && + (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && + param.parent.parameters.indexOf(param) > -1 && + (resolveName(param, param.name.escapedText, 67897832 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) || + param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, ts.declarationNameToString(param.name)); + return; + } diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; @@ -45657,7 +45777,12 @@ var ts; return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & 3 /* Variable */) { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); + } return errorType; } } @@ -47142,6 +47267,17 @@ var ts; var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } + function getImmediateAliasedSymbol(symbol) { + ts.Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true); + } + return links.immediateTarget; + } function checkObjectLiteral(node, checkMode) { var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking @@ -47609,16 +47745,31 @@ var ts; function getJsxElementChildrenPropertyName(jsxNamespace) { return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } - function getUninstantiatedJsxSignaturesOfType(elementType) { + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4 /* String */) { + return [anySignature]; + } + else if (elementType.flags & 128 /* StringLiteral */) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error(caller, ts.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts.emptyArray; + } + else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); // Resolve the signatures, preferring constructor - var signatures = getSignaturesOfType(elementType, 1 /* Construct */); + var signatures = getSignaturesOfType(apparentElemType, 1 /* Construct */); if (signatures.length === 0) { // No construct signatures, try call signatures - signatures = getSignaturesOfType(elementType, 0 /* Call */); + signatures = getSignaturesOfType(apparentElemType, 0 /* Call */); } - if (signatures.length === 0 && elementType.flags & 1048576 /* Union */) { + if (signatures.length === 0 && apparentElemType.flags & 1048576 /* Union */) { // If each member has some combination of new/call signatures; make a union signature list for those - signatures = getUnionSignatures(ts.map(elementType.types, getUninstantiatedJsxSignaturesOfType)); + signatures = getUnionSignatures(ts.map(apparentElemType.types, function (t) { return getUninstantiatedJsxSignaturesOfType(t, caller); })); } return signatures; } @@ -47991,7 +48142,7 @@ var ts; checkPropertyAccessibility(node, left.kind === 98 /* SuperKeyword */, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, ts.idText(right)); + error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right)); return errorType; } } @@ -48190,7 +48341,7 @@ var ts; } } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (!prop || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { return; } if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { @@ -49559,20 +49710,8 @@ var ts; if (apparentType === errorType) { return resolveErrorCall(node); } - if (exprTypes.flags & 128 /* StringLiteral */) { - var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(exprTypes, node); - if (!intrinsicType) { - error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, exprTypes.value, "JSX." + JsxNames.IntrinsicElements); - return resolveUntypedCall(node); - } - else { - var fakeSignature = createSignatureForJSXIntrinsic(node, intrinsicType); - checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined), intrinsicType, node.tagName, node.attributes); - return fakeSignature; - } - } - var signatures = getUninstantiatedJsxSignaturesOfType(apparentType); - if (exprTypes.flags & 4 /* String */ || isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall(exprTypes, apparentType, signatures.length, /*constructSignatures*/ 0)) { return resolveUntypedCall(node); } if (signatures.length === 0) { @@ -51197,8 +51336,17 @@ var ts; leftType; case 59 /* EqualsToken */: var declKind = ts.isBinaryExpression(left.parent) ? ts.getAssignmentDeclarationKind(left.parent) : 0 /* None */; - checkAssignmentDeclaration(declKind, right); + checkAssignmentDeclaration(declKind, rightType); if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288 /* Object */) || + declKind !== 2 /* ModuleExports */ && + declKind !== 6 /* Prototype */ && + !isEmptyObjectType(rightType) && + !isFunctionObjectType(rightType) && + !(ts.getObjectFlags(rightType) & 1 /* Class */)) { + // don't check assignability of module.exports=, C.prototype=, or expando types because they will necessarily be incomplete + checkAssignmentOperator(rightType); + } return leftType; } else { @@ -51213,10 +51361,9 @@ var ts; default: return ts.Debug.fail(); } - function checkAssignmentDeclaration(kind, right) { + function checkAssignmentDeclaration(kind, rightType) { if (kind === 2 /* ModuleExports */) { - var rightType_1 = checkExpression(right, checkMode); - for (var _i = 0, _a = getPropertiesOfObjectType(rightType_1); _i < _a.length; _i++) { + for (var _i = 0, _a = getPropertiesOfObjectType(rightType); _i < _a.length; _i++) { var prop = _a[_i]; var propType = getTypeOfSymbol(prop); if (propType.symbol && propType.symbol.flags & 32 /* Class */) { @@ -53281,7 +53428,7 @@ var ts; } function registerForUnusedIdentifiersCheck(node) { // May be in a call such as getTypeOfNode that happened to call this. But potentiallyUnusedIdentifiers is only defined in the scope of `checkSourceFile`. - if (produceDiagnostics) { + if (produceDiagnostics && !(node.flags & 4194304 /* Ambient */)) { var sourceFile = ts.getSourceFileOfNode(node); var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); if (!potentiallyUnusedIdentifiers) { @@ -53302,9 +53449,6 @@ var ts; checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 241 /* InterfaceDeclaration */: - checkUnusedTypeParameters(node, addDiagnostic); - break; case 279 /* SourceFile */: case 244 /* ModuleDeclaration */: case 218 /* Block */: @@ -53321,7 +53465,7 @@ var ts; case 156 /* MethodDeclaration */: case 158 /* GetAccessor */: case 159 /* SetAccessor */: - if (node.body) { + if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); @@ -53332,9 +53476,12 @@ var ts; case 165 /* FunctionType */: case 166 /* ConstructorType */: case 242 /* TypeAliasDeclaration */: - case 176 /* InferType */: + case 241 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; + case 176 /* InferType */: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; default: ts.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); } @@ -53349,77 +53496,73 @@ var ts; return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node, addDiagnostic) { - if (!(node.flags & 4194304 /* Ambient */)) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - switch (member.kind) { - case 156 /* MethodDeclaration */: - case 154 /* PropertyDeclaration */: - case 158 /* GetAccessor */: - case 159 /* SetAccessor */: - if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { - // Already would have reported an error on the getter. - break; - } - var symbol = getSymbolOfNode(member); - if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); - } + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 156 /* MethodDeclaration */: + case 154 /* PropertyDeclaration */: + case 158 /* GetAccessor */: + case 159 /* SetAccessor */: + if (member.kind === 159 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. break; - case 157 /* Constructor */: - for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { - var parameter = _c[_b]; - if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { - addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); - } + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); + } + break; + case 157 /* Constructor */: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { + addDiagnostic(parameter, 0 /* Local */, ts.createDiagnosticForNode(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol))); } - break; - case 162 /* IndexSignature */: - case 217 /* SemicolonClassElement */: - // Can't be private - break; - default: - ts.Debug.fail(); - } + } + break; + case 162 /* IndexSignature */: + case 217 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + } + } function checkUnusedTypeParameters(node, addDiagnostic) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - if (node.flags & 4194304 /* Ambient */ || node.kind !== 176 /* InferType */ && ts.last(getSymbolOfNode(node).declarations) !== node) + if (ts.last(getSymbolOfNode(node).declarations) !== node) return; - if (node.kind === 176 /* InferType */) { - var typeParameter = node.typeParameter; - if (isTypeParameterUnused(typeParameter)) { - addDiagnostic(node, 1 /* Parameter */, ts.createDiagnosticForNode(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(typeParameter.name))); + var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts.NodeSet(); + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var typeParameter = typeParameters_2[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name = ts.idText(typeParameter.name); + var parent = typeParameter.parent; + if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + var range = ts.isJSDocTemplateTag(parent) + // Whole @template tag + ? ts.rangeOfNode(parent) + // Include the `<>` in the error message + : ts.rangeOfTypeParameters(parent.typeParameters); + var only = typeParameters.length === 1; + var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name : undefined; + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } } - } - else { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - var seenParentsWithEveryUnused = new ts.NodeSet(); - for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { - var typeParameter = typeParameters_2[_i]; - if (!isTypeParameterUnused(typeParameter)) - continue; - var name = ts.idText(typeParameter.name); - var parent = typeParameter.parent; - if (parent.kind !== 176 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { - if (seenParentsWithEveryUnused.tryAdd(parent)) { - var range = ts.isJSDocTemplateTag(parent) - // Whole @template tag - ? ts.rangeOfNode(parent) - // Include the `<>` in the error message - : ts.rangeOfTypeParameters(parent.typeParameters); - var only = typeParameters.length === 1; - var message = only ? ts.Diagnostics._0_is_declared_but_its_value_is_never_read : ts.Diagnostics.All_type_parameters_are_unused; - var arg0 = only ? name : undefined; - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createFileDiagnostic(ts.getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); - } - } - else { - addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); - } + else { + addDiagnostic(typeParameter, 1 /* Parameter */, ts.createDiagnosticForNode(typeParameter, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } @@ -53840,9 +53983,9 @@ var ts; var nameText = ts.getTextOfPropertyName(name); if (nameText) { var property = getPropertyOfType(parentType, nameText); // TODO: GH#18217 - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); + if (property) { + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + checkPropertyAccessibility(parent, !!parent.initializer && parent.initializer.kind === 98 /* SuperKeyword */, parentType, property); } } } @@ -54900,7 +55043,7 @@ var ts; } } else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); + error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); } } } @@ -56506,7 +56649,10 @@ var ts; } if (isDeclarationNameOrImportPropertyName(node)) { // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(parent); + var parentSymbol = getSymbolOfNode(parent); + return ts.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node + ? getImmediateAliasedSymbol(parentSymbol) + : parentSymbol; } else if (ts.isLiteralComputedPropertyDeclarationName(node)) { return getSymbolOfNode(parent.parent); @@ -64714,7 +64860,7 @@ var ts; }; function processMapping(mapping) { var generatedPosition = generatedFile !== undefined - ? ts.getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) : -1; var source; var sourcePosition; @@ -64723,7 +64869,7 @@ var ts; var sourceFile = host.getSourceFileLike(sourceFilePath); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? ts.getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? ts.getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) : -1; } return { @@ -79713,6 +79859,7 @@ var ts; reportInaccessibleThisError: reportInaccessibleThisError, reportInaccessibleUniqueSymbolError: reportInaccessibleUniqueSymbolError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode @@ -79801,6 +79948,11 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), "this")); } } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode) { + context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); + } + } function transformRoot(node) { if (node.kind === 279 /* SourceFile */ && (node.isDeclarationFile || ts.isSourceFileJS(node))) { return node; @@ -82788,7 +82940,7 @@ var ts; emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } function emitClassExpression(node) { @@ -83526,7 +83678,7 @@ var ts; } function emitSpreadAssignment(node) { if (node.expression) { - writePunctuation("..."); + emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); emitExpression(node.expression); } } @@ -85980,6 +86132,7 @@ var ts; // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files var resolvedProjectReferences; var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); var structuralIsReused = tryReuseStructureFromOldProgram(); if (structuralIsReused !== 2 /* Completely */) { @@ -87338,15 +87491,20 @@ var ts; * Get the referenced project if the file is input file from that reference project */ function getResolvedProjectReferenceToRedirect(fileName) { - return forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { - // not input file from the referenced project, ignore - if (!referencedProject || - toPath(options.configFilePath) === referenceProjectPath || - !ts.contains(referencedProject.commandLine.fileNames, fileName, isSameFile)) { - return undefined; - } - return referencedProject; - }); + if (mapFromFileToProjectReferenceRedirects === undefined) { + mapFromFileToProjectReferenceRedirects = ts.createMap(); + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + // not input file from the referenced project, ignore + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { + referencedProject.commandLine.fileNames.forEach(function (f) { + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { @@ -89709,6 +89867,7 @@ var ts; } return count; } + moduleSpecifiers.countPathComponents = countPathComponents; function usesJsExtensionOnImports(_a) { var imports = _a.imports; return ts.firstDefined(imports, function (_a) { @@ -91451,6 +91610,9 @@ var ts; options: configFile.options, configFileParsingDiagnostics: configFile.errors }; + if (host.beforeCreateProgram) { + host.beforeCreateProgram(options); + } var program = ts.createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics var syntaxDiagnostics = program.getOptionsDiagnostics().concat(program.getConfigFileParsingDiagnostics(), program.getSyntacticDiagnostics()); @@ -91500,11 +91662,17 @@ var ts; }; diagnostics.removeKey(proj); projectStatus.setValue(proj, status); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; function buildErrors(diagnostics, errorFlags, errorType) { resultFlags |= errorFlags; reportAndStoreErrors(proj, diagnostics); projectStatus.setValue(proj, { type: UpToDateStatusType.Unbuildable, reason: errorType + " errors" }); + if (host.afterProgramEmitAndDiagnostics) { + host.afterProgramEmitAndDiagnostics(program); + } return resultFlags; } } From 94d7e3039341a812e18e64610f7ce1413241b66a Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Tue, 20 Nov 2018 22:01:34 +0100 Subject: [PATCH 051/322] MethodSignature doesn't have 'arguments' (#28625) Fixes: #28622 --- src/compiler/checker.ts | 1 - .../baselines/reference/arguments.errors.txt | 29 +++++++++++++++++++ tests/baselines/reference/arguments.js | 8 +++++ tests/baselines/reference/arguments.symbols | 22 ++++++++++++++ tests/baselines/reference/arguments.types | 25 ++++++++++++++++ tests/cases/compiler/arguments.ts | 8 +++++ 6 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/arguments.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6ef51bc401a..5e2c5d87690 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1420,7 +1420,6 @@ namespace ts { } break; case SyntaxKind.MethodDeclaration: - case SyntaxKind.MethodSignature: case SyntaxKind.Constructor: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: diff --git a/tests/baselines/reference/arguments.errors.txt b/tests/baselines/reference/arguments.errors.txt new file mode 100644 index 00000000000..de6aa35333f --- /dev/null +++ b/tests/baselines/reference/arguments.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/arguments.ts(6,25): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(7,23): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(8,19): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(9,23): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(10,34): error TS2304: Cannot find name 'arguments'. + + +==== tests/cases/compiler/arguments.ts (5 errors) ==== + function f() { + var x=arguments[12]; + } + + interface I { + method(args: typeof arguments): void; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + fn: (args: typeof arguments) => void; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + (args: typeof arguments): void; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + new (args: typeof arguments): void; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + construct: new (args: typeof arguments) => void; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + } \ No newline at end of file diff --git a/tests/baselines/reference/arguments.js b/tests/baselines/reference/arguments.js index b19821aa8f1..8622c084503 100644 --- a/tests/baselines/reference/arguments.js +++ b/tests/baselines/reference/arguments.js @@ -1,6 +1,14 @@ //// [arguments.ts] function f() { var x=arguments[12]; +} + +interface I { + method(args: typeof arguments): void; + fn: (args: typeof arguments) => void; + (args: typeof arguments): void; + new (args: typeof arguments): void; + construct: new (args: typeof arguments) => void; } //// [arguments.js] diff --git a/tests/baselines/reference/arguments.symbols b/tests/baselines/reference/arguments.symbols index 2825d792715..c8be643332c 100644 --- a/tests/baselines/reference/arguments.symbols +++ b/tests/baselines/reference/arguments.symbols @@ -6,3 +6,25 @@ function f() { >x : Symbol(x, Decl(arguments.ts, 1, 7)) >arguments : Symbol(arguments) } + +interface I { +>I : Symbol(I, Decl(arguments.ts, 2, 1)) + + method(args: typeof arguments): void; +>method : Symbol(I.method, Decl(arguments.ts, 4, 13)) +>args : Symbol(args, Decl(arguments.ts, 5, 11)) + + fn: (args: typeof arguments) => void; +>fn : Symbol(I.fn, Decl(arguments.ts, 5, 41)) +>args : Symbol(args, Decl(arguments.ts, 6, 9)) + + (args: typeof arguments): void; +>args : Symbol(args, Decl(arguments.ts, 7, 5)) + + new (args: typeof arguments): void; +>args : Symbol(args, Decl(arguments.ts, 8, 9)) + + construct: new (args: typeof arguments) => void; +>construct : Symbol(I.construct, Decl(arguments.ts, 8, 39)) +>args : Symbol(args, Decl(arguments.ts, 9, 20)) +} diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 97a23822b7a..655f6182c6f 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -8,3 +8,28 @@ function f() { >arguments : IArguments >12 : 12 } + +interface I { + method(args: typeof arguments): void; +>method : (args: any) => void +>args : any +>arguments : any + + fn: (args: typeof arguments) => void; +>fn : (args: any) => void +>args : any +>arguments : any + + (args: typeof arguments): void; +>args : any +>arguments : any + + new (args: typeof arguments): void; +>args : any +>arguments : any + + construct: new (args: typeof arguments) => void; +>construct : new (args: any) => void +>args : any +>arguments : any +} diff --git a/tests/cases/compiler/arguments.ts b/tests/cases/compiler/arguments.ts index 5caff25129a..b486d5eed95 100644 --- a/tests/cases/compiler/arguments.ts +++ b/tests/cases/compiler/arguments.ts @@ -1,3 +1,11 @@ function f() { var x=arguments[12]; +} + +interface I { + method(args: typeof arguments): void; + fn: (args: typeof arguments) => void; + (args: typeof arguments): void; + new (args: typeof arguments): void; + construct: new (args: typeof arguments) => void; } \ No newline at end of file From 6ff89f8868330945e0d9ae48c9865b56d52f6c27 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Tue, 20 Nov 2018 22:55:21 +0100 Subject: [PATCH 052/322] Update bug template to version 3.3 --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 6add1cccb58..5711c8f950d 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -16,7 +16,7 @@ Please fill in the *entire* template below. --> -**TypeScript Version:** 3.2.0-dev.201xxxxx +**TypeScript Version:** 3.3.0-dev.201xxxxx **Search Terms:** From 635780db073d1f411b4e746648631efe1dbd430a Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Tue, 20 Nov 2018 23:07:01 +0100 Subject: [PATCH 053/322] ArrowFunction has no own 'arguments' Fixes: #28621 --- src/compiler/checker.ts | 8 +++- .../baselines/reference/arguments.errors.txt | 18 ++++++--- tests/baselines/reference/arguments.js | 5 +++ tests/baselines/reference/arguments.symbols | 23 ++++++----- tests/baselines/reference/arguments.types | 12 ++++++ ...unctionWhenUsingArguments01_ES6.errors.txt | 40 +++++++++++++++++++ ...owFunctionWhenUsingArguments01_ES6.symbols | 2 - ...rrowFunctionWhenUsingArguments01_ES6.types | 4 +- ...unctionWhenUsingArguments02_ES6.errors.txt | 7 ++++ ...owFunctionWhenUsingArguments02_ES6.symbols | 1 - ...rrowFunctionWhenUsingArguments02_ES6.types | 6 +-- ...owFunctionWhenUsingArguments03_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments03_ES6.types | 6 +-- ...owFunctionWhenUsingArguments04_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments04_ES6.types | 6 +-- ...owFunctionWhenUsingArguments05_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments05_ES6.types | 6 +-- ...owFunctionWhenUsingArguments06_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments06_ES6.types | 8 ++-- ...owFunctionWhenUsingArguments07_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments07_ES6.types | 8 ++-- ...owFunctionWhenUsingArguments11_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments11_ES6.types | 8 ++-- ...owFunctionWhenUsingArguments12_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments12_ES6.types | 6 +-- ...owFunctionWhenUsingArguments14_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments14_ES6.types | 6 +-- ...owFunctionWhenUsingArguments15_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments15_ES6.types | 6 +-- ...owFunctionWhenUsingArguments16_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments16_ES6.types | 8 ++-- ...owFunctionWhenUsingArguments17_ES6.symbols | 2 +- ...rrowFunctionWhenUsingArguments17_ES6.types | 8 ++-- tests/cases/compiler/arguments.ts | 4 ++ 34 files changed, 155 insertions(+), 73 deletions(-) create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt create mode 100644 tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5e2c5d87690..9b7b099aa45 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1419,12 +1419,18 @@ namespace ts { } } break; + case SyntaxKind.ArrowFunction: + // when targeting ES6 or higher there is no 'arguments' in an arrow function + // for lower compile targets the resolved symbol is used to emit an error + if (compilerOptions.target! >= ScriptTarget.ES2015) { + break; + } + // falls through case SyntaxKind.MethodDeclaration: case SyntaxKind.Constructor: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ArrowFunction: if (meaning & SymbolFlags.Variable && name === "arguments") { result = argumentsSymbol; break loop; diff --git a/tests/baselines/reference/arguments.errors.txt b/tests/baselines/reference/arguments.errors.txt index de6aa35333f..882477aaac9 100644 --- a/tests/baselines/reference/arguments.errors.txt +++ b/tests/baselines/reference/arguments.errors.txt @@ -1,15 +1,21 @@ -tests/cases/compiler/arguments.ts(6,25): error TS2304: Cannot find name 'arguments'. -tests/cases/compiler/arguments.ts(7,23): error TS2304: Cannot find name 'arguments'. -tests/cases/compiler/arguments.ts(8,19): error TS2304: Cannot find name 'arguments'. -tests/cases/compiler/arguments.ts(9,23): error TS2304: Cannot find name 'arguments'. -tests/cases/compiler/arguments.ts(10,34): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(6,8): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(9,25): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(10,23): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(11,19): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(12,23): error TS2304: Cannot find name 'arguments'. +tests/cases/compiler/arguments.ts(13,34): error TS2304: Cannot find name 'arguments'. -==== tests/cases/compiler/arguments.ts (5 errors) ==== +==== tests/cases/compiler/arguments.ts (6 errors) ==== function f() { var x=arguments[12]; + (() => arguments)(); } + (() => arguments)(); + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + interface I { method(args: typeof arguments): void; ~~~~~~~~~ diff --git a/tests/baselines/reference/arguments.js b/tests/baselines/reference/arguments.js index 8622c084503..3dd362506c6 100644 --- a/tests/baselines/reference/arguments.js +++ b/tests/baselines/reference/arguments.js @@ -1,8 +1,11 @@ //// [arguments.ts] function f() { var x=arguments[12]; + (() => arguments)(); } +(() => arguments)(); + interface I { method(args: typeof arguments): void; fn: (args: typeof arguments) => void; @@ -14,4 +17,6 @@ interface I { //// [arguments.js] function f() { var x = arguments[12]; + (() => arguments)(); } +(() => arguments)(); diff --git a/tests/baselines/reference/arguments.symbols b/tests/baselines/reference/arguments.symbols index c8be643332c..770077a90b2 100644 --- a/tests/baselines/reference/arguments.symbols +++ b/tests/baselines/reference/arguments.symbols @@ -4,27 +4,32 @@ function f() { var x=arguments[12]; >x : Symbol(x, Decl(arguments.ts, 1, 7)) +>arguments : Symbol(arguments) + + (() => arguments)(); >arguments : Symbol(arguments) } +(() => arguments)(); + interface I { ->I : Symbol(I, Decl(arguments.ts, 2, 1)) +>I : Symbol(I, Decl(arguments.ts, 5, 20)) method(args: typeof arguments): void; ->method : Symbol(I.method, Decl(arguments.ts, 4, 13)) ->args : Symbol(args, Decl(arguments.ts, 5, 11)) +>method : Symbol(I.method, Decl(arguments.ts, 7, 13)) +>args : Symbol(args, Decl(arguments.ts, 8, 11)) fn: (args: typeof arguments) => void; ->fn : Symbol(I.fn, Decl(arguments.ts, 5, 41)) ->args : Symbol(args, Decl(arguments.ts, 6, 9)) +>fn : Symbol(I.fn, Decl(arguments.ts, 8, 41)) +>args : Symbol(args, Decl(arguments.ts, 9, 9)) (args: typeof arguments): void; ->args : Symbol(args, Decl(arguments.ts, 7, 5)) +>args : Symbol(args, Decl(arguments.ts, 10, 5)) new (args: typeof arguments): void; ->args : Symbol(args, Decl(arguments.ts, 8, 9)) +>args : Symbol(args, Decl(arguments.ts, 11, 9)) construct: new (args: typeof arguments) => void; ->construct : Symbol(I.construct, Decl(arguments.ts, 8, 39)) ->args : Symbol(args, Decl(arguments.ts, 9, 20)) +>construct : Symbol(I.construct, Decl(arguments.ts, 11, 39)) +>args : Symbol(args, Decl(arguments.ts, 12, 20)) } diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 655f6182c6f..a46f4b3015e 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -7,8 +7,20 @@ function f() { >arguments[12] : any >arguments : IArguments >12 : 12 + + (() => arguments)(); +>(() => arguments)() : IArguments +>(() => arguments) : () => IArguments +>() => arguments : () => IArguments +>arguments : IArguments } +(() => arguments)(); +>(() => arguments)() : any +>(() => arguments) : () => any +>() => arguments : () => any +>arguments : any + interface I { method(args: typeof arguments): void; >method : (args: any) => void diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt new file mode 100644 index 00000000000..5f1a0525fd8 --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.errors.txt @@ -0,0 +1,40 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(2,15): error TS2304: Cannot find name 'arguments'. +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts(19,15): error TS2304: Cannot find name 'arguments'. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts (2 errors) ==== + var a = () => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + } + + var b = function () { + var a = () => { + var arg = arguments[0]; // error + } + } + + function baz() { + () => { + var arg = arguments[0]; + } + } + + function foo(inputFunc: () => void) { } + foo(() => { + var arg = arguments[0]; // error + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. + }); + + function bar() { + var arg = arguments[0]; // no error + } + + + () => { + function foo() { + var arg = arguments[0]; // no error + } + } \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols index 698b32da7ad..9298998fb74 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.symbols @@ -4,7 +4,6 @@ var a = () => { var arg = arguments[0]; // error >arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7)) ->arguments : Symbol(arguments) } var b = function () { @@ -38,7 +37,6 @@ foo(() => { var arg = arguments[0]; // error >arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7)) ->arguments : Symbol(arguments) }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types index 6da6a224a6c..2e47d402986 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments01_ES6.types @@ -6,7 +6,7 @@ var a = () => { var arg = arguments[0]; // error >arg : any >arguments[0] : any ->arguments : IArguments +>arguments : any >0 : 0 } @@ -52,7 +52,7 @@ foo(() => { var arg = arguments[0]; // error >arg : any >arguments[0] : any ->arguments : IArguments +>arguments : any >0 : 0 }); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt new file mode 100644 index 00000000000..653ed55592e --- /dev/null +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts(1,15): error TS2304: Cannot find name 'arguments'. + + +==== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts (1 errors) ==== + var a = () => arguments; + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'arguments'. \ No newline at end of file diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols index 4843562aaec..87bafa16224 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.symbols @@ -1,5 +1,4 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === var a = () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 0, 3)) ->arguments : Symbol(arguments) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types index 40859c33cc3..541105ac689 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments02_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts === var a = () => arguments; ->a : () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => any +>() => arguments : () => any +>arguments : any diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols index 71518083b1f..22a6602c178 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.symbols @@ -4,5 +4,5 @@ var arguments; var a = () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 0, 3)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types index ad46bec71b6..f4dab85c46d 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments03_ES6.types @@ -3,7 +3,7 @@ var arguments; >arguments : any var a = () => arguments; ->a : () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => any +>() => arguments : () => any +>arguments : any diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols index d42db50fa3b..80848c3536a 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.symbols @@ -7,5 +7,5 @@ function f() { var a = () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 1, 7)) } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types index e371862ee4d..8eb25aa52cc 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments04_ES6.types @@ -6,7 +6,7 @@ function f() { >arguments : any var a = () => arguments; ->a : () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => any +>() => arguments : () => any +>arguments : any } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols index cfa539d1948..9b380c12aca 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.symbols @@ -5,5 +5,5 @@ function f(arguments) { var a = () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 7)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 11)) } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types index bcb452f0940..dc6b35bf6ab 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments05_ES6.types @@ -4,7 +4,7 @@ function f(arguments) { >arguments : any var a = () => arguments; ->a : () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => any +>() => arguments : () => any +>arguments : any } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols index 0aef2f06c45..6152d5f0bc0 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.symbols @@ -5,5 +5,5 @@ function f(arguments) { var a = () => () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 7)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 11)) } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types index f29eb52f32b..98370e538b1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments06_ES6.types @@ -4,8 +4,8 @@ function f(arguments) { >arguments : any var a = () => () => arguments; ->a : () => () => IArguments ->() => () => arguments : () => () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => () => any +>() => () => arguments : () => () => any +>() => arguments : () => any +>arguments : any } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols index 4fdce2cccb1..d5bd8c1afba 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.symbols @@ -6,5 +6,5 @@ function f(arguments) { var a = (arguments) => () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 7)) >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 13)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 13)) } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types index 168ffac3c5e..eb7f40e6a05 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments07_ES6.types @@ -4,9 +4,9 @@ function f(arguments) { >arguments : any var a = (arguments) => () => arguments; ->a : (arguments: any) => () => IArguments ->(arguments) => () => arguments : (arguments: any) => () => IArguments +>a : (arguments: any) => () => any +>(arguments) => () => arguments : (arguments: any) => () => any +>arguments : any +>() => arguments : () => any >arguments : any ->() => arguments : () => IArguments ->arguments : IArguments } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols index 1af084727be..d307681a7d2 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.symbols @@ -8,5 +8,5 @@ function f(arguments) { var a = () => () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 11)) } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types index fa19fe7b9b1..12ae41331db 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments11_ES6.types @@ -8,8 +8,8 @@ function f(arguments) { >10 : 10 var a = () => () => arguments; ->a : () => () => IArguments ->() => () => arguments : () => () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => () => any +>() => () => arguments : () => () => any +>() => arguments : () => any +>arguments : any } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.symbols index 4824a8fbbc3..62e950ecfe6 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.symbols @@ -8,6 +8,6 @@ class C { var a = () => arguments; >a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments12_ES6.ts, 2, 11)) ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments12_ES6.ts, 1, 6)) } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.types index b41dda95439..42bed2b7089 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments12_ES6.types @@ -7,8 +7,8 @@ class C { >arguments : any var a = () => arguments; ->a : () => IArguments ->() => arguments : () => IArguments ->arguments : IArguments +>a : () => any +>() => arguments : () => any +>arguments : any } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols index b984e697d02..fdb8e605cc6 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -11,6 +11,6 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 2, 11)) return () => arguments; ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 2, 11)) } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types index 19526febab3..e5a6188c449 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts === function f() { ->f : () => () => IArguments +>f : () => () => number if (Math.random()) { >Math.random() : number @@ -13,7 +13,7 @@ function f() { >100 : 100 return () => arguments; ->() => arguments : () => IArguments ->arguments : IArguments +>() => arguments : () => number +>arguments : number } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols index 95693995e7f..05c53206e5f 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -14,6 +14,6 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 3, 13)) return () => arguments; ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 3, 13)) } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types index 69b1e795071..adf53c18826 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts === function f() { ->f : () => () => IArguments +>f : () => () => number var arguments = "hello"; >arguments : string @@ -17,7 +17,7 @@ function f() { >100 : 100 return () => arguments; ->() => arguments : () => IArguments ->arguments : IArguments +>() => arguments : () => number +>arguments : 100 } } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols index accf6365cd4..356a3841ea1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -11,7 +11,7 @@ function f() { >random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) return () => arguments[0]; ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 1, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 5, 7)) } var arguments = "world"; >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 1, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 5, 7)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types index 50c619035ac..7c9495808ad 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts === function f() { ->f : () => () => any +>f : () => () => string var arguments = "hello"; >arguments : string @@ -13,9 +13,9 @@ function f() { >random : () => number return () => arguments[0]; ->() => arguments[0] : () => any ->arguments[0] : any ->arguments : IArguments +>() => arguments[0] : () => string +>arguments[0] : string +>arguments : string >0 : 0 } var arguments = "world"; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols index 7cfb86db049..c889a9ada61 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -12,7 +12,7 @@ function f() { >random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) return () => arguments[0]; ->arguments : Symbol(arguments) +>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 1, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 5, 7)) } var arguments = "world"; >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 1, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 5, 7)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types index e0ea34ba0fe..30facb027e4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts === function f() { ->f : () => () => any +>f : () => () => string var { arguments } = { arguments: "hello" }; >arguments : string @@ -15,9 +15,9 @@ function f() { >random : () => number return () => arguments[0]; ->() => arguments[0] : () => any ->arguments[0] : any ->arguments : IArguments +>() => arguments[0] : () => string +>arguments[0] : string +>arguments : string >0 : 0 } var arguments = "world"; diff --git a/tests/cases/compiler/arguments.ts b/tests/cases/compiler/arguments.ts index b486d5eed95..9e91e898776 100644 --- a/tests/cases/compiler/arguments.ts +++ b/tests/cases/compiler/arguments.ts @@ -1,7 +1,11 @@ +// @target: ES6 function f() { var x=arguments[12]; + (() => arguments)(); } +(() => arguments)(); + interface I { method(args: typeof arguments): void; fn: (args: typeof arguments) => void; From 6a37fd46fe23ce8bfeb7f5f5a598b4ea916197d7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 20 Nov 2018 13:26:14 -0800 Subject: [PATCH 054/322] Cache results for readFile, fileExists, directory exists, sourceFiles for .d.ts files across the build (only first time) --- src/compiler/program.ts | 17 ++++--- src/compiler/tsbuild.ts | 101 +++++++++++++++++++++++++++++++++++++++- src/compiler/types.ts | 3 ++ 3 files changed, 114 insertions(+), 7 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 968ad2d073e..24eeff36c6c 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -73,7 +73,6 @@ namespace ts { // TODO(shkamat): update this after reworking ts build API export function createCompilerHostWorker(options: CompilerOptions, setParentNodes?: boolean, system = sys): CompilerHost { const existingDirectories = createMap(); - function getCanonicalFileName(fileName: string): string { // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. // otherwise use toLowerCase as a canonical form. @@ -84,7 +83,7 @@ namespace ts { let text: string | undefined; try { performance.mark("beforeIORead"); - text = system.readFile(fileName, options.charset); + text = host.readFile(fileName); performance.mark("afterIORead"); performance.measure("I/O Read", "beforeIORead", "afterIORead"); } @@ -113,7 +112,12 @@ namespace ts { if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { const parentDirectory = getDirectoryPath(directoryPath); ensureDirectoriesExist(parentDirectory); - system.createDirectory(directoryPath); + if (host.createDirectory) { + host.createDirectory(directoryPath); + } + else { + system.createDirectory(directoryPath); + } } } @@ -177,8 +181,7 @@ namespace ts { const newLine = getNewLineCharacter(options, () => system.newLine); const realpath = system.realpath && ((path: string) => system.realpath!(path)); - - return { + const host: CompilerHost = { getSourceFile, getDefaultLibLocation, getDefaultLibFileName: options => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)), @@ -194,8 +197,10 @@ namespace ts { getEnvironmentVariable: name => system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : "", getDirectories: (path: string) => system.getDirectories(path), realpath, - readDirectory: (path, extensions, include, exclude, depth) => system.readDirectory(path, extensions, include, exclude, depth) + readDirectory: (path, extensions, include, exclude, depth) => system.readDirectory(path, extensions, include, exclude, depth), + createDirectory: d => system.createDirectory(d) }; + return host; } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray { diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index e17057b9140..cd3ed158995 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -433,6 +433,7 @@ namespace ts { const missingRoots = createMap(); let globalDependencyGraph: DependencyGraph | undefined; const writeFileName = (s: string) => host.trace && host.trace(s); + let readFileWithCache = (f: string) => host.readFile(f); // Watch state const diagnostics = createFileMap>(toPath); @@ -1072,7 +1073,7 @@ namespace ts { let priorChangeTime: Date | undefined; if (!anyDtsChanged && isDeclarationFile(fileName)) { // Check for unchanged .d.ts files - if (host.fileExists(fileName) && host.readFile(fileName) === content) { + if (host.fileExists(fileName) && readFileWithCache(fileName) === content) { priorChangeTime = host.getModifiedTime(fileName); } else { @@ -1182,6 +1183,97 @@ namespace ts { function buildAllProjects(): ExitStatus { if (options.watch) { reportWatchStatus(Diagnostics.Starting_compilation_in_watch_mode); } + const originalReadFile = host.readFile; + const originalFileExists = host.fileExists; + const originalDirectoryExists = host.directoryExists; + const originalCreateDirectory = host.createDirectory; + const originalWriteFile = host.writeFile; + const originalGetSourceFile = host.getSourceFile; + const readFileCache = createMap(); + const fileExistsCache = createMap(); + const directoryExistsCache = createMap(); + const sourceFileCache = createMap(); + const savedReadFileWithCache = readFileWithCache; + + // TODO:: In watch mode as well to use caches for incremental build once we can invalidate caches correctly and have right api + // Override readFile for json files and output .d.ts to cache the text + readFileWithCache = fileName => { + const key = toPath(fileName); + const value = readFileCache.get(key); + if (value !== undefined) return value || undefined; + return setReadFileCache(key, fileName); + }; + const setReadFileCache = (key: Path, fileName: string) => { + const newValue = originalReadFile.call(host, fileName); + readFileCache.set(key, newValue || false); + return newValue; + }; + host.readFile = fileName => { + const key = toPath(fileName); + const value = readFileCache.get(key); + if (value !== undefined) return value; // could be .d.ts from output + if (!fileExtensionIs(fileName, Extension.Json)) { + return originalReadFile.call(host, fileName); + } + + return setReadFileCache(key, fileName); + }; + host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => { + const key = toPath(fileName); + const value = sourceFileCache.get(key); + if (value) return value; + + const sourceFile = originalGetSourceFile.call(host, fileName, languageVersion, onError, shouldCreateNewSourceFile); + if (sourceFile && (isDeclarationFileName(fileName) || fileExtensionIs(fileName, Extension.Json))) { + sourceFileCache.set(key, sourceFile); + } + return sourceFile; + }; + + // fileExits for any kind of extension + host.fileExists = fileName => { + const key = toPath(fileName); + const value = fileExistsCache.get(key); + if (value !== undefined) return value; + const newValue = originalFileExists.call(host, fileName); + fileExistsCache.set(key, !!newValue); + return newValue; + }; + host.writeFile = (fileName, data, writeByteOrderMark, onError, sourceFiles) => { + const key = toPath(fileName); + fileExistsCache.delete(key); + + const value = readFileCache.get(key); + if (value && value !== data) { + readFileCache.delete(key); + sourceFileCache.delete(key); + } + else { + const sourceFile = sourceFileCache.get(key); + if (sourceFile && sourceFile.text !== data) { + sourceFileCache.delete(key); + } + } + originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); + }; + + // directoryExists + if (originalDirectoryExists && originalCreateDirectory) { + host.directoryExists = directory => { + const key = toPath(directory); + const value = directoryExistsCache.get(key); + if (value !== undefined) return value; + const newValue = originalDirectoryExists.call(host, directory); + directoryExistsCache.set(key, !!newValue); + return newValue; + }; + host.createDirectory = directory => { + const key = toPath(directory); + directoryExistsCache.delete(key); + originalCreateDirectory.call(host, directory); + }; + } + const graph = getGlobalDependencyGraph(); reportBuildQueue(graph); let anyFailed = false; @@ -1232,6 +1324,13 @@ namespace ts { anyFailed = anyFailed || !!(buildResult & BuildResultFlags.AnyErrors); } reportErrorSummary(); + host.readFile = originalReadFile; + host.fileExists = originalFileExists; + host.directoryExists = originalDirectoryExists; + host.createDirectory = originalCreateDirectory; + host.writeFile = originalWriteFile; + readFileWithCache = savedReadFileWithCache; + host.getSourceFile = originalGetSourceFile; return anyFailed ? ExitStatus.DiagnosticsPresent_OutputsSkipped : ExitStatus.Success; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b4c405c3174..17444ed9704 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5014,6 +5014,9 @@ namespace ts { /* @internal */ hasInvalidatedResolution?: HasInvalidatedResolution; /* @internal */ hasChangedAutomaticTypeDirectiveNames?: boolean; createHash?(data: string): string; + + // TODO: later handle this in better way in builder host instead once the ap + /*@internal*/createDirectory?(directory: string): void; } /* @internal */ From d8ac9c1fd1b8c24310db0be9165f442a6c7d8bee Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 21 Nov 2018 12:36:04 +0900 Subject: [PATCH 055/322] address comment --- src/tsc/tsc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index 7548f2db072..0151d00f0ee 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -136,7 +136,7 @@ namespace ts { if (configParseResult.errors.length !== 0) { updateReportDiagnostic(configParseResult.options); configParseResult.errors.forEach(reportDiagnostic); - return sys.exit(ExitStatus.DiagnosticsPresent_OutputsGenerated); + return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } // tslint:disable-next-line:no-null-keyword sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine); From c7f8959034f245d00579ffff5e2b86b4d3c9aed3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Nov 2018 09:03:26 -0800 Subject: [PATCH 056/322] PR feedback. --- src/compiler/program.ts | 10 +++++----- src/compiler/tsbuild.ts | 2 +- src/compiler/types.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 24eeff36c6c..118850ab737 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -83,7 +83,7 @@ namespace ts { let text: string | undefined; try { performance.mark("beforeIORead"); - text = host.readFile(fileName); + text = compilerHost.readFile(fileName); performance.mark("afterIORead"); performance.measure("I/O Read", "beforeIORead", "afterIORead"); } @@ -112,8 +112,8 @@ namespace ts { if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { const parentDirectory = getDirectoryPath(directoryPath); ensureDirectoriesExist(parentDirectory); - if (host.createDirectory) { - host.createDirectory(directoryPath); + if (compilerHost.createDirectory) { + compilerHost.createDirectory(directoryPath); } else { system.createDirectory(directoryPath); @@ -181,7 +181,7 @@ namespace ts { const newLine = getNewLineCharacter(options, () => system.newLine); const realpath = system.realpath && ((path: string) => system.realpath!(path)); - const host: CompilerHost = { + const compilerHost: CompilerHost = { getSourceFile, getDefaultLibLocation, getDefaultLibFileName: options => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)), @@ -200,7 +200,7 @@ namespace ts { readDirectory: (path, extensions, include, exclude, depth) => system.readDirectory(path, extensions, include, exclude, depth), createDirectory: d => system.createDirectory(d) }; - return host; + return compilerHost; } export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray { diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index cd3ed158995..b0f7dd7ac3c 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1230,7 +1230,7 @@ namespace ts { return sourceFile; }; - // fileExits for any kind of extension + // fileExists for any kind of extension host.fileExists = fileName => { const key = toPath(fileName); const value = fileExistsCache.get(key); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 17444ed9704..495465f7032 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5015,7 +5015,7 @@ namespace ts { /* @internal */ hasChangedAutomaticTypeDirectiveNames?: boolean; createHash?(data: string): string; - // TODO: later handle this in better way in builder host instead once the ap + // TODO: later handle this in better way in builder host instead once the api for tsbuild finalizes and doesnt use compilerHost as base /*@internal*/createDirectory?(directory: string): void; } From 8d5d9005679901d3e68e63b970fe44ac2ab8c0f6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Nov 2018 09:18:03 -0800 Subject: [PATCH 057/322] Factor out caching logic so tsc (without watch can use it and --watch has its own cache logic). --- src/compiler/program.ts | 108 ++++++++++++++++++++++++++++++++++++++++ src/compiler/tsbuild.ts | 94 +++------------------------------- src/tsc/tsc.ts | 3 ++ 3 files changed, 117 insertions(+), 88 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 118850ab737..1789b161e39 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -203,6 +203,114 @@ namespace ts { return compilerHost; } + /*@internal*/ + export function changeCompilerHostToUseCache( + host: CompilerHost, + toPath: (fileName: string) => Path, + useCacheForSourceFile: boolean + ) { + const originalReadFile = host.readFile; + const originalFileExists = host.fileExists; + const originalDirectoryExists = host.directoryExists; + const originalCreateDirectory = host.createDirectory; + const originalWriteFile = host.writeFile; + const originalGetSourceFile = host.getSourceFile; + const readFileCache = createMap(); + const fileExistsCache = createMap(); + const directoryExistsCache = createMap(); + const sourceFileCache = createMap(); + + const readFileWithCache = (fileName: string): string | undefined => { + const key = toPath(fileName); + const value = readFileCache.get(key); + if (value !== undefined) return value || undefined; + return setReadFileCache(key, fileName); + }; + const setReadFileCache = (key: Path, fileName: string) => { + const newValue = originalReadFile.call(host, fileName); + readFileCache.set(key, newValue || false); + return newValue; + }; + host.readFile = fileName => { + const key = toPath(fileName); + const value = readFileCache.get(key); + if (value !== undefined) return value; // could be .d.ts from output + if (!fileExtensionIs(fileName, Extension.Json)) { + return originalReadFile.call(host, fileName); + } + + return setReadFileCache(key, fileName); + }; + + if (useCacheForSourceFile) { + host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => { + const key = toPath(fileName); + const value = sourceFileCache.get(key); + if (value) return value; + + const sourceFile = originalGetSourceFile.call(host, fileName, languageVersion, onError, shouldCreateNewSourceFile); + if (sourceFile && (isDeclarationFileName(fileName) || fileExtensionIs(fileName, Extension.Json))) { + sourceFileCache.set(key, sourceFile); + } + return sourceFile; + }; + } + + // fileExists for any kind of extension + host.fileExists = fileName => { + const key = toPath(fileName); + const value = fileExistsCache.get(key); + if (value !== undefined) return value; + const newValue = originalFileExists.call(host, fileName); + fileExistsCache.set(key, !!newValue); + return newValue; + }; + host.writeFile = (fileName, data, writeByteOrderMark, onError, sourceFiles) => { + const key = toPath(fileName); + fileExistsCache.delete(key); + + const value = readFileCache.get(key); + if (value && value !== data) { + readFileCache.delete(key); + sourceFileCache.delete(key); + } + else if (useCacheForSourceFile) { + const sourceFile = sourceFileCache.get(key); + if (sourceFile && sourceFile.text !== data) { + sourceFileCache.delete(key); + } + } + originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); + }; + + // directoryExists + if (originalDirectoryExists && originalCreateDirectory) { + host.directoryExists = directory => { + const key = toPath(directory); + const value = directoryExistsCache.get(key); + if (value !== undefined) return value; + const newValue = originalDirectoryExists.call(host, directory); + directoryExistsCache.set(key, !!newValue); + return newValue; + }; + host.createDirectory = directory => { + const key = toPath(directory); + directoryExistsCache.delete(key); + originalCreateDirectory.call(host, directory); + }; + } + + return { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + originalGetSourceFile, + readFileWithCache + }; + } + export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray { const diagnostics = [ ...program.getConfigFileParsingDiagnostics(), diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index b0f7dd7ac3c..2b8cac3ea57 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1183,96 +1183,14 @@ namespace ts { function buildAllProjects(): ExitStatus { if (options.watch) { reportWatchStatus(Diagnostics.Starting_compilation_in_watch_mode); } - const originalReadFile = host.readFile; - const originalFileExists = host.fileExists; - const originalDirectoryExists = host.directoryExists; - const originalCreateDirectory = host.createDirectory; - const originalWriteFile = host.writeFile; - const originalGetSourceFile = host.getSourceFile; - const readFileCache = createMap(); - const fileExistsCache = createMap(); - const directoryExistsCache = createMap(); - const sourceFileCache = createMap(); - const savedReadFileWithCache = readFileWithCache; - // TODO:: In watch mode as well to use caches for incremental build once we can invalidate caches correctly and have right api // Override readFile for json files and output .d.ts to cache the text - readFileWithCache = fileName => { - const key = toPath(fileName); - const value = readFileCache.get(key); - if (value !== undefined) return value || undefined; - return setReadFileCache(key, fileName); - }; - const setReadFileCache = (key: Path, fileName: string) => { - const newValue = originalReadFile.call(host, fileName); - readFileCache.set(key, newValue || false); - return newValue; - }; - host.readFile = fileName => { - const key = toPath(fileName); - const value = readFileCache.get(key); - if (value !== undefined) return value; // could be .d.ts from output - if (!fileExtensionIs(fileName, Extension.Json)) { - return originalReadFile.call(host, fileName); - } - - return setReadFileCache(key, fileName); - }; - host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => { - const key = toPath(fileName); - const value = sourceFileCache.get(key); - if (value) return value; - - const sourceFile = originalGetSourceFile.call(host, fileName, languageVersion, onError, shouldCreateNewSourceFile); - if (sourceFile && (isDeclarationFileName(fileName) || fileExtensionIs(fileName, Extension.Json))) { - sourceFileCache.set(key, sourceFile); - } - return sourceFile; - }; - - // fileExists for any kind of extension - host.fileExists = fileName => { - const key = toPath(fileName); - const value = fileExistsCache.get(key); - if (value !== undefined) return value; - const newValue = originalFileExists.call(host, fileName); - fileExistsCache.set(key, !!newValue); - return newValue; - }; - host.writeFile = (fileName, data, writeByteOrderMark, onError, sourceFiles) => { - const key = toPath(fileName); - fileExistsCache.delete(key); - - const value = readFileCache.get(key); - if (value && value !== data) { - readFileCache.delete(key); - sourceFileCache.delete(key); - } - else { - const sourceFile = sourceFileCache.get(key); - if (sourceFile && sourceFile.text !== data) { - sourceFileCache.delete(key); - } - } - originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); - }; - - // directoryExists - if (originalDirectoryExists && originalCreateDirectory) { - host.directoryExists = directory => { - const key = toPath(directory); - const value = directoryExistsCache.get(key); - if (value !== undefined) return value; - const newValue = originalDirectoryExists.call(host, directory); - directoryExistsCache.set(key, !!newValue); - return newValue; - }; - host.createDirectory = directory => { - const key = toPath(directory); - directoryExistsCache.delete(key); - originalCreateDirectory.call(host, directory); - }; - } + const { originalReadFile, originalFileExists, originalDirectoryExists, + originalCreateDirectory, originalWriteFile, originalGetSourceFile, + readFileWithCache: newReadFileWithCache + } = changeCompilerHostToUseCache(host, toPath, /*useCacheForSourceFile*/ true); + const savedReadFileWithCache = readFileWithCache; + readFileWithCache = newReadFileWithCache; const graph = getGlobalDependencyGraph(); reportBuildQueue(graph); diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index 8d9b2f1afa7..ec3da718ef4 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -227,6 +227,9 @@ namespace ts { function performCompilation(rootNames: string[], projectReferences: ReadonlyArray | undefined, options: CompilerOptions, configFileParsingDiagnostics?: ReadonlyArray) { const host = createCompilerHost(options); + const currentDirectory = host.getCurrentDirectory(); + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + changeCompilerHostToUseCache(host, fileName => toPath(fileName, currentDirectory, getCanonicalFileName), /*useCacheForSourceFile*/ false); enableStatistics(options); const programOptions: CreateProgramOptions = { From c4df3da5a3b80d590b6f3743ad28dbbd5d1d4e4c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 21 Nov 2018 09:59:37 -0800 Subject: [PATCH 058/322] Update user baselines (#28633) --- tests/baselines/reference/user/bluebird.log | 1 - tests/baselines/reference/user/follow-redirects.log | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/baselines/reference/user/bluebird.log b/tests/baselines/reference/user/bluebird.log index 25f9e8ab6ab..aea76fa7f2c 100644 --- a/tests/baselines/reference/user/bluebird.log +++ b/tests/baselines/reference/user/bluebird.log @@ -162,7 +162,6 @@ node_modules/bluebird/js/release/some.js(133,23): error TS2339: Property 'promis node_modules/bluebird/js/release/using.js(78,20): error TS2339: Property 'doDispose' does not exist on type 'Disposer'. node_modules/bluebird/js/release/using.js(97,23): error TS2339: Property 'data' does not exist on type 'FunctionDisposer'. node_modules/bluebird/js/release/using.js(223,15): error TS2350: Only a void function can be called with the 'new' keyword. -node_modules/bluebird/js/release/util.js(251,28): error TS2554: Expected 0 arguments, but got 2. node_modules/bluebird/js/release/util.js(279,45): error TS2345: Argument of type 'PropertyDescriptor | { value: any; } | undefined' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor'. diff --git a/tests/baselines/reference/user/follow-redirects.log b/tests/baselines/reference/user/follow-redirects.log index 4b5959dd0e3..565dd1e208e 100644 --- a/tests/baselines/reference/user/follow-redirects.log +++ b/tests/baselines/reference/user/follow-redirects.log @@ -1,12 +1,12 @@ Exit Code: 1 Standard output: -node_modules/follow-redirects/index.js(86,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(87,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(145,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(211,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. -node_modules/follow-redirects/index.js(245,35): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +node_modules/follow-redirects/index.js(97,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(98,10): error TS2339: Property 'abort' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(156,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(222,12): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(256,35): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'. -node_modules/follow-redirects/index.js(258,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. +node_modules/follow-redirects/index.js(269,10): error TS2339: Property 'emit' does not exist on type 'RedirectableRequest'. From 2128cc49a07ba42c217d6541ff66ae8ed3c85ba5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Nov 2018 10:45:08 -0800 Subject: [PATCH 059/322] Dont explicitly get declaration diagnostics --- src/compiler/tsbuild.ts | 36 +++++++++++++++++++----------------- src/compiler/utilities.ts | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index e17057b9140..1bf5bed76a2 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1050,14 +1050,6 @@ namespace ts { return buildErrors(syntaxDiagnostics, BuildResultFlags.SyntaxErrors, "Syntactic"); } - // Don't emit .d.ts if there are decl file errors - if (getEmitDeclarations(program.getCompilerOptions())) { - const declDiagnostics = program.getDeclarationDiagnostics(); - if (declDiagnostics.length) { - return buildErrors(declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"); - } - } - // Same as above but now for semantic diagnostics const semanticDiagnostics = program.getSemanticDiagnostics(); if (semanticDiagnostics.length) { @@ -1066,14 +1058,23 @@ namespace ts { let newestDeclarationFileContentChangedTime = minimumDate; let anyDtsChanged = false; - let emitDiagnostics: Diagnostic[] | undefined; - const reportEmitDiagnostic = (d: Diagnostic) => (emitDiagnostics || (emitDiagnostics = [])).push(d); - emitFilesAndReportErrors(program, reportEmitDiagnostic, writeFileName, /*reportSummary*/ undefined, (fileName, content, writeBom, onError) => { + let declDiagnostics: Diagnostic[] | undefined; + const reportDeclarationDiagnostics = (d: Diagnostic) => (declDiagnostics || (declDiagnostics = [])).push(d); + const outputFiles: OutputFile[] = []; + emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, (name, text, writeByteOrderMark) => outputFiles.push({ name, text, writeByteOrderMark })); + // Don't emit .d.ts if there are decl file errors + if (declDiagnostics) { + return buildErrors(declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"); + } + + // Actual Emit + const emitterDiagnostics = createDiagnosticCollection(); + outputFiles.forEach(({ name, text, writeByteOrderMark }) => { let priorChangeTime: Date | undefined; - if (!anyDtsChanged && isDeclarationFile(fileName)) { + if (!anyDtsChanged && isDeclarationFile(name)) { // Check for unchanged .d.ts files - if (host.fileExists(fileName) && host.readFile(fileName) === content) { - priorChangeTime = host.getModifiedTime(fileName); + if (host.fileExists(name) && host.readFile(name) === text) { + priorChangeTime = host.getModifiedTime(name); } else { resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged; @@ -1081,14 +1082,15 @@ namespace ts { } } - host.writeFile(fileName, content, writeBom, onError, emptyArray); + writeFile(host, emitterDiagnostics, name, text, writeByteOrderMark); if (priorChangeTime !== undefined) { newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime); - unchangedOutputs.setValue(fileName, priorChangeTime); + unchangedOutputs.setValue(name, priorChangeTime); } }); - if (emitDiagnostics) { + const emitDiagnostics = emitterDiagnostics.getDiagnostics(); + if (emitDiagnostics.length) { return buildErrors(emitDiagnostics, BuildResultFlags.EmitErrors, "Emit"); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 8ed85db3a23..30fd1ca1784 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3402,7 +3402,7 @@ namespace ts { return combinePaths(newDirPath, sourceFilePath); } - export function writeFile(host: EmitHost, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: ReadonlyArray) { + export function writeFile(host: { writeFile: WriteFileCallback; }, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: ReadonlyArray) { host.writeFile(fileName, data, writeByteOrderMark, hostErrorMessage => { diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); }, sourceFiles); From 5198bf3c6722d1d5082f42405e295580d10937b4 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 21 Nov 2018 21:46:55 -0800 Subject: [PATCH 060/322] Add perf optimizations for path comparisons --- src/compiler/utilities.ts | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 30fd1ca1784..966149f2a6c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6925,7 +6925,7 @@ namespace ts { export interface ObjectAllocator { getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; - getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; + getTokenConstructor(): { new (kind: TKind, pos?: number, end?: number): Token }; getIdentifierConstructor(): new (kind: SyntaxKind.Identifier, pos?: number, end?: number) => Identifier; getSourceFileConstructor(): new (kind: SyntaxKind.SourceFile, pos?: number, end?: number) => SourceFile; getSymbolConstructor(): new (flags: SymbolFlags, name: __String) => Symbol; @@ -7687,16 +7687,38 @@ namespace ts { return path; } + // check path for these segments: '', '.'. '..' + const relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a: string, b: string, componentComparer: (a: string, b: string) => Comparison) { if (a === b) return Comparison.EqualTo; if (a === undefined) return Comparison.LessThan; if (b === undefined) return Comparison.GreaterThan; + + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + const aRoot = a.substring(0, getRootLength(a)); + const bRoot = b.substring(0, getRootLength(b)); + const result = compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== Comparison.EqualTo) { + return result; + } + + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + const aRest = a.substring(aRoot.length); + const bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. const aComponents = reducePathComponents(getPathComponents(a)); const bComponents = reducePathComponents(getPathComponents(b)); const sharedLength = Math.min(aComponents.length, bComponents.length); - for (let i = 0; i < sharedLength; i++) { - const stringComparer = i === 0 ? compareStringsCaseInsensitive : componentComparer; - const result = stringComparer(aComponents[i], bComponents[i]); + for (let i = 1; i < sharedLength; i++) { + const result = componentComparer(aComponents[i], bComponents[i]); if (result !== Comparison.EqualTo) { return result; } From f915420c80baa7f632467586eeafa81c937af2a8 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 26 Nov 2018 14:45:19 -0800 Subject: [PATCH 061/322] Revert "Don't consider 'typeof a' as using 'a' (#28528)" This reverts commit 0c4ceeec24f16f87e75386355c86ac38612a1175. --- src/compiler/checker.ts | 4 ++-- .../unusedParameterUsedInTypeOf.errors.txt | 9 --------- .../unusedPropertyUsedInTypeOf.errors.txt | 11 ----------- .../reference/unusedPropertyUsedInTypeOf.js | 14 -------------- .../reference/unusedPropertyUsedInTypeOf.symbols | 16 ---------------- .../reference/unusedPropertyUsedInTypeOf.types | 16 ---------------- .../cases/compiler/unusedPropertyUsedInTypeOf.ts | 7 ------- 7 files changed, 2 insertions(+), 75 deletions(-) delete mode 100644 tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt delete mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt delete mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.js delete mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols delete mode 100644 tests/baselines/reference/unusedPropertyUsedInTypeOf.types delete mode 100644 tests/cases/compiler/unusedPropertyUsedInTypeOf.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1a5be51f957..7a1364c7a1f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1482,7 +1482,7 @@ namespace ts { // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol) && !isInTypeQuery(originalLocation!)) { + if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { result.isReferenced! |= meaning; } @@ -19054,7 +19054,7 @@ namespace ts { } function markPropertyAsReferenced(prop: Symbol, nodeForCheckWriteOnly: Node | undefined, isThisAccess: boolean) { - if (nodeForCheckWriteOnly && isInTypeQuery(nodeForCheckWriteOnly) || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { + if (!prop || !(prop.flags & SymbolFlags.ClassMember) || !prop.valueDeclaration || !hasModifier(prop.valueDeclaration, ModifierFlags.Private)) { return; } if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & SymbolFlags.SetAccessor && !(prop.flags & SymbolFlags.GetAccessor))) { diff --git a/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt b/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt deleted file mode 100644 index a2a30badc4a..00000000000 --- a/tests/baselines/reference/unusedParameterUsedInTypeOf.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/compiler/unusedParameterUsedInTypeOf.ts(1,14): error TS6133: 'a' is declared but its value is never read. - - -==== tests/cases/compiler/unusedParameterUsedInTypeOf.ts (1 errors) ==== - function f1 (a: number, b: typeof a) { - ~ -!!! error TS6133: 'a' is declared but its value is never read. - return b; - } \ No newline at end of file diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt b/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt deleted file mode 100644 index 60657d9c8c9..00000000000 --- a/tests/baselines/reference/unusedPropertyUsedInTypeOf.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/unusedPropertyUsedInTypeOf.ts(2,29): error TS6133: 'x' is declared but its value is never read. - - -==== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts (1 errors) ==== - class C { - private static readonly x: number; - ~ -!!! error TS6133: 'x' is declared but its value is never read. - m(p: typeof C.x) { return p; } - } - \ No newline at end of file diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.js b/tests/baselines/reference/unusedPropertyUsedInTypeOf.js deleted file mode 100644 index 98a1e9f0029..00000000000 --- a/tests/baselines/reference/unusedPropertyUsedInTypeOf.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [unusedPropertyUsedInTypeOf.ts] -class C { - private static readonly x: number; - m(p: typeof C.x) { return p; } -} - - -//// [unusedPropertyUsedInTypeOf.js] -var C = /** @class */ (function () { - function C() { - } - C.prototype.m = function (p) { return p; }; - return C; -}()); diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols b/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols deleted file mode 100644 index 9715c3fa11f..00000000000 --- a/tests/baselines/reference/unusedPropertyUsedInTypeOf.symbols +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts === -class C { ->C : Symbol(C, Decl(unusedPropertyUsedInTypeOf.ts, 0, 0)) - - private static readonly x: number; ->x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) - - m(p: typeof C.x) { return p; } ->m : Symbol(C.m, Decl(unusedPropertyUsedInTypeOf.ts, 1, 38)) ->p : Symbol(p, Decl(unusedPropertyUsedInTypeOf.ts, 2, 6)) ->C.x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) ->C : Symbol(C, Decl(unusedPropertyUsedInTypeOf.ts, 0, 0)) ->x : Symbol(C.x, Decl(unusedPropertyUsedInTypeOf.ts, 0, 9)) ->p : Symbol(p, Decl(unusedPropertyUsedInTypeOf.ts, 2, 6)) -} - diff --git a/tests/baselines/reference/unusedPropertyUsedInTypeOf.types b/tests/baselines/reference/unusedPropertyUsedInTypeOf.types deleted file mode 100644 index 12b40eb5ff6..00000000000 --- a/tests/baselines/reference/unusedPropertyUsedInTypeOf.types +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/compiler/unusedPropertyUsedInTypeOf.ts === -class C { ->C : C - - private static readonly x: number; ->x : number - - m(p: typeof C.x) { return p; } ->m : (p: number) => number ->p : number ->C.x : number ->C : typeof C ->x : number ->p : number -} - diff --git a/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts b/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts deleted file mode 100644 index 41c685e4b06..00000000000 --- a/tests/cases/compiler/unusedPropertyUsedInTypeOf.ts +++ /dev/null @@ -1,7 +0,0 @@ -// @noUnusedLocals:true -// @noUnusedParameters:true - -class C { - private static readonly x: number; - m(p: typeof C.x) { return p; } -} From e594407103a1d52c0a839fedcbd2d6056a3d6c93 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 27 Nov 2018 16:17:57 -0800 Subject: [PATCH 062/322] Count only unit types when counting overlapping keys --- src/compiler/checker.ts | 2 +- tests/baselines/reference/inferTypes1.errors.txt | 4 ++-- .../reference/intersectionWithUnionConstraint.errors.txt | 4 ++-- tests/baselines/reference/mappedTypeErrors.errors.txt | 4 ++-- tests/baselines/reference/mappedTypeErrors2.errors.txt | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a1364c7a1f..e3be8c307d2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11975,7 +11975,7 @@ namespace ts { // Some subset overlap if we have only string literals. // If we have a union of index types, it seems likely that we // needed to elaborate between two generic mapped types anyway. - const len = length((overlap as UnionType).types); + const len = length(filter((overlap as UnionType).types, isUnitType)); if (len >= matchingCount) { bestMatch = target; matchingCount = len; diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index cbe3eab039c..4684b8f5e34 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -18,7 +18,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: E tests/cases/conformance/types/conditional/inferTypes1.ts(82,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'string'. + Type 'T' is not assignable to type 'symbol'. ==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== @@ -202,7 +202,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: type B = string extends T ? { [P in T]: void; } : T; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'T' is not assignable to type 'symbol'. // Repro from #22302 diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt index 5ed34cbe626..9bdfc6f30f9 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt +++ b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(7,9): error TS2322: Type 'T & U' is not assignable to type 'string | number'. Type 'string | undefined' is not assignable to type 'string | number'. Type 'undefined' is not assignable to type 'string | number'. - Type 'T & U' is not assignable to type 'string'. + Type 'T & U' is not assignable to type 'number'. tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(8,9): error TS2322: Type 'T & U' is not assignable to type 'string | null'. Type 'string | undefined' is not assignable to type 'string | null'. Type 'undefined' is not assignable to type 'string | null'. @@ -32,7 +32,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12 !!! error TS2322: Type 'T & U' is not assignable to type 'string | number'. !!! error TS2322: Type 'string | undefined' is not assignable to type 'string | number'. !!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. -!!! error TS2322: Type 'T & U' is not assignable to type 'string'. +!!! error TS2322: Type 'T & U' is not assignable to type 'number'. let y2: string | null = x; // Error ~~ !!! error TS2322: Type 'T & U' is not assignable to type 'string | null'. diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 19be0493cc9..254d1cca1a8 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -37,7 +37,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'string'. + Type 'T' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(148,17): error TS2339: Property 'foo' does not exist on type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type 'Record'. @@ -249,7 +249,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: pt: {[P in T]?: T[P]}, // note: should be in keyof T ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'T' is not assignable to type 'symbol'. ~~~~ !!! error TS2536: Type 'P' cannot be used to index type 'T'. }; diff --git a/tests/baselines/reference/mappedTypeErrors2.errors.txt b/tests/baselines/reference/mappedTypeErrors2.errors.txt index d48db498154..9178731d189 100644 --- a/tests/baselines/reference/mappedTypeErrors2.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors2.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(9,30): error TS2536: T tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(13,30): error TS2536: Type 'K' cannot be used to index type 'T3'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,38): error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. - Type 'AB[S]' is not assignable to type 'string'. + Type 'AB[S]' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2536: Type 'S' cannot be used to index type 'AB'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: Type 'L' cannot be used to index type '{ [key in AB[S]]: true; }'. @@ -31,7 +31,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: !!! error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. ~~~~~ !!! error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'AB[S]' is not assignable to type 'string'. +!!! error TS2322: Type 'AB[S]' is not assignable to type 'symbol'. ~~~~~ !!! error TS2536: Type 'S' cannot be used to index type 'AB'. From b31c3e4e36a343549b2d679cd069cc0f6b92f297 Mon Sep 17 00:00:00 2001 From: typescript-bot Date: Wed, 28 Nov 2018 14:26:59 +0000 Subject: [PATCH 063/322] Update user baselines --- tests/baselines/reference/user/bcryptjs.log | 12 +- .../user/chrome-devtools-frontend.log | 12 +- tests/baselines/reference/user/lodash.log | 6 +- tests/baselines/reference/user/npm.log | 164 +++++++++--------- tests/baselines/reference/user/puppeteer.log | 6 +- 5 files changed, 100 insertions(+), 100 deletions(-) diff --git a/tests/baselines/reference/user/bcryptjs.log b/tests/baselines/reference/user/bcryptjs.log index 109b69d7586..1d099db177c 100644 --- a/tests/baselines/reference/user/bcryptjs.log +++ b/tests/baselines/reference/user/bcryptjs.log @@ -2,6 +2,12 @@ Exit Code: 1 Standard output: node_modules/bcryptjs/scripts/build.js(1,26): error TS2307: Cannot find module 'metascript'. node_modules/bcryptjs/scripts/build.js(32,1): error TS2741: Property 'ISAAC' is missing in type '{ VERSION: any; }' but required in type '{ VERSION: any; ISAAC: boolean; }'. +node_modules/bcryptjs/src/bcrypt.js(25,13): error TS2740: Type 'Buffer' is missing the following properties from type 'number[]': pop, push, concat, shift, and 5 more. +node_modules/bcryptjs/src/bcrypt.js(94,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. +node_modules/bcryptjs/src/bcrypt.js(150,5): error TS2322: Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. +node_modules/bcryptjs/src/bcrypt.js(160,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. +node_modules/bcryptjs/src/bcrypt.js(238,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. node_modules/bcryptjs/src/bcrypt/impl.js(516,22): error TS2345: Argument of type 'Int32List' is not assignable to parameter of type 'number[]'. Type 'Int32Array' is missing the following properties from type 'number[]': pop, push, concat, shift, and 5 more. node_modules/bcryptjs/src/bcrypt/impl.js(546,26): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error'. @@ -19,12 +25,6 @@ node_modules/bcryptjs/src/bcrypt/prng/accum.js(66,22): error TS2339: Property 'd node_modules/bcryptjs/src/bcrypt/prng/accum.js(67,22): error TS2339: Property 'detachEvent' does not exist on type 'Document'. node_modules/bcryptjs/src/bcrypt/util.js(4,12): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/bcryptjs/src/bcrypt/util.js(20,5): error TS2304: Cannot find name 'utfx'. -node_modules/bcryptjs/src/bcrypt.js(25,13): error TS2740: Type 'Buffer' is missing the following properties from type 'number[]': pop, push, concat, shift, and 5 more. -node_modules/bcryptjs/src/bcrypt.js(94,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. -node_modules/bcryptjs/src/bcrypt.js(150,5): error TS2322: Type 'string | undefined' is not assignable to type 'string'. - Type 'undefined' is not assignable to type 'string'. -node_modules/bcryptjs/src/bcrypt.js(160,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. -node_modules/bcryptjs/src/bcrypt.js(238,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. node_modules/bcryptjs/src/wrap.js(37,26): error TS2304: Cannot find name 'define'. node_modules/bcryptjs/src/wrap.js(37,51): error TS2304: Cannot find name 'define'. node_modules/bcryptjs/src/wrap.js(38,9): error TS2304: Cannot find name 'define'. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 7c6411141f5..e515fb02779 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -671,6 +671,8 @@ node_modules/chrome-devtools-frontend/front_end/audits2_test_runner/Audits2TestR node_modules/chrome-devtools-frontend/front_end/audits2_test_runner/Audits2TestRunner.js(77,40): error TS2339: Property 'checkboxElement' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/audits2_test_runner/Audits2TestRunner.js(89,29): error TS2339: Property 'disabled' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/audits2_test_runner/Audits2TestRunner.js(102,24): error TS2488: Type 'NodeListOf' must have a '[Symbol.iterator]()' method that returns an iterator. +node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(10,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(33,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/audits2_worker/Audits2Service.js(33,31): error TS1003: Identifier expected. @@ -3069,8 +3071,6 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(70756,10): error TS2531: Object is possibly 'null'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(70756,45): error TS2531: Object is possibly 'null'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(70848,34): error TS2304: Cannot find name 'fs'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(22,21): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(25,71): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(30,56): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. @@ -6317,6 +6317,8 @@ node_modules/chrome-devtools-frontend/front_end/formatter/ScriptFormatter.js(127 node_modules/chrome-devtools-frontend/front_end/formatter/ScriptFormatter.js(134,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/formatter/ScriptFormatter.js(173,45): error TS2694: Namespace 'Formatter.FormatterWorkerPool' has no exported member 'FormatMapping'. node_modules/chrome-devtools-frontend/front_end/formatter/ScriptFormatter.js(215,28): error TS2339: Property 'upperBound' does not exist on type 'number[]'. +node_modules/chrome-devtools-frontend/front_end/formatter_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/formatter_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/AcornTokenizer.js(14,55): error TS2322: Type 'number' is not assignable to type 'boolean'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/AcornTokenizer.js(14,71): error TS2322: Type 'any[]' is not assignable to type 'boolean'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/AcornTokenizer.js(15,63): error TS2339: Property 'computeLineEndings' does not exist on type 'string'. @@ -6509,8 +6511,6 @@ node_modules/chrome-devtools-frontend/front_end/formatter_worker/acorn/acorn_loo node_modules/chrome-devtools-frontend/front_end/formatter_worker/acorn/acorn_loose.js(258,55): error TS2339: Property 'end' does not exist on type 'true'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/acorn/acorn_loose.js(1365,5): error TS2339: Property 'next' does not exist on type 'LooseParser'. node_modules/chrome-devtools-frontend/front_end/formatter_worker/acorn/acorn_loose.js(1366,12): error TS2339: Property 'parseTopLevel' does not exist on type 'LooseParser'. -node_modules/chrome-devtools-frontend/front_end/formatter_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/formatter_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(26,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'page' must be of type 'any', but here has type 'HARPage'. node_modules/chrome-devtools-frontend/front_end/har_importer/HARImporter.js(46,5): error TS2322: Type 'Date' is not assignable to type 'number'. node_modules/chrome-devtools-frontend/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js(320,70): error TS2339: Property 'heap_profiler' does not exist on type 'any[]'. @@ -6522,6 +6522,8 @@ node_modules/chrome-devtools-frontend/front_end/heap_profiler_test_runner/HeapPr node_modules/chrome-devtools-frontend/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js(658,33): error TS2339: Property 'heap_profiler' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js(678,36): error TS2339: Property 'instance' does not exist on type 'typeof SamplingHeapProfileType'. node_modules/chrome-devtools-frontend/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js(682,36): error TS2339: Property 'instance' does not exist on type 'typeof SamplingHeapProfileType'. +node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(37,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(87,5): error TS2322: Type 'void' is not assignable to type 'HeapSnapshotNode'. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshot.js(144,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -6648,8 +6650,6 @@ node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapsho node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshotWorker.js(31,3): error TS2554: Expected 2-3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshotWorker.js(37,12): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js(87,36): error TS2339: Property 'eval' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/heap_snapshot_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/help/Help.js(6,19): error TS2694: Namespace 'Help' has no exported member 'ReleaseNote'. node_modules/chrome-devtools-frontend/front_end/help/Help.js(10,22): error TS2694: Namespace 'Help' has no exported member 'ReleaseNote'. node_modules/chrome-devtools-frontend/front_end/help/Help.js(61,74): error TS2694: Namespace 'Help' has no exported member 'ReleaseNoteHighlight'. diff --git a/tests/baselines/reference/user/lodash.log b/tests/baselines/reference/user/lodash.log index 84f7c21c4b9..8c27a74ea54 100644 --- a/tests/baselines/reference/user/lodash.log +++ b/tests/baselines/reference/user/lodash.log @@ -42,7 +42,7 @@ node_modules/lodash/_baseFlatten.js(24,22): error TS2532: Object is possibly 'un node_modules/lodash/_baseFlatten.js(24,22): error TS2722: Cannot invoke an object which is possibly 'undefined'. node_modules/lodash/_baseHas.js(16,56): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string | number | symbol'. Type 'any[]' is not assignable to type 'string | number | symbol'. - Type 'any[]' is not assignable to type 'symbol'. + Type 'any[]' is not assignable to type 'string'. node_modules/lodash/_baseIntersection.js(53,40): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'. Type 'undefined' is not assignable to type 'Function'. node_modules/lodash/_baseIntersection.js(60,54): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'. @@ -238,7 +238,7 @@ node_modules/lodash/core.js(2609,39): error TS2554: Expected 0 arguments, but go node_modules/lodash/core.js(2644,12): error TS2554: Expected 3-5 arguments, but got 2. node_modules/lodash/core.js(3245,58): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string | number | symbol'. Type 'any[]' is not assignable to type 'string | number | symbol'. - Type 'any[]' is not assignable to type 'symbol'. + Type 'any[]' is not assignable to type 'string'. node_modules/lodash/core.js(3354,53): error TS2538: Type 'any[]' cannot be used as an index type. node_modules/lodash/core.js(3424,41): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. Type 'Function' provides no match for the signature '(substring: string, ...args: any[]): string'. @@ -285,6 +285,7 @@ node_modules/lodash/findIndex.js(52,31): error TS2554: Expected 0-1 arguments, b node_modules/lodash/findKey.js(41,30): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/findLastIndex.js(56,31): error TS2554: Expected 0-1 arguments, but got 2. node_modules/lodash/findLastKey.js(41,30): error TS2554: Expected 0-1 arguments, but got 2. +node_modules/lodash/fp.js(2,18): error TS2554: Expected 3-4 arguments, but got 2. node_modules/lodash/fp/_baseConvert.js(143,5): error TS2559: Type 'Function' has no properties in common with type '{ cap?: boolean; curry?: boolean; fixed?: boolean; immutable?: boolean; rearg?: boolean; }'. node_modules/lodash/fp/_baseConvert.js(144,5): error TS2322: Type 'string' is not assignable to type 'Function'. node_modules/lodash/fp/_baseConvert.js(145,5): error TS2322: Type 'undefined' is not assignable to type 'string'. @@ -339,7 +340,6 @@ node_modules/lodash/fp/object.js(2,26): error TS2345: Argument of type '{ 'assig node_modules/lodash/fp/seq.js(2,26): error TS2345: Argument of type '{ 'at': Function; 'chain': (value: any) => any; 'commit': () => any; 'lodash': typeof lodash; 'next': typeof wrapperNext; 'plant': (value: any) => any; 'reverse': () => any; 'tap': (value: any, interceptor: Function) => any; 'thru': (value: any, interceptor: Function) => any; ... 4 more ...; 'wrapperChain': () => an...' is not assignable to parameter of type 'string'. node_modules/lodash/fp/string.js(2,26): error TS2345: Argument of type '{ 'camelCase': Function; 'capitalize': (string?: string | undefined) => string; 'deburr': (string?: string | undefined) => string; 'endsWith': (string?: string | undefined, target?: string | undefined, position?: number | undefined) => boolean; ... 26 more ...; 'words': (string?: string | undefined, pattern?: string...' is not assignable to parameter of type 'string'. node_modules/lodash/fp/util.js(2,26): error TS2345: Argument of type '{ 'attempt': Function; 'bindAll': Function; 'cond': (pairs: any[]) => Function; 'conforms': (source: any) => Function; 'constant': (value: any) => Function; 'defaultTo': (value: any, defaultValue: any) => any; ... 25 more ...; 'uniqueId': (prefix?: string | undefined) => string; }' is not assignable to parameter of type 'string'. -node_modules/lodash/fp.js(2,18): error TS2554: Expected 3-4 arguments, but got 2. node_modules/lodash/includes.js(24,10): error TS1003: Identifier expected. node_modules/lodash/includes.js(24,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name. node_modules/lodash/intersectionBy.js(41,32): error TS2554: Expected 0-1 arguments, but got 2. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index 3ab08f4b545..91a408b91d7 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -102,6 +102,32 @@ node_modules/npm/lib/completion.js(52,7): error TS2339: Property 'errno' does no node_modules/npm/lib/completion.js(129,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/completion.js(135,13): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/completion.js(247,23): error TS2339: Property 'fullList' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(74,18): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(83,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(84,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(85,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(87,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(93,25): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(135,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(136,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(137,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(156,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(158,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(159,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(167,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(186,26): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(187,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(210,27): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(223,18): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(225,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(238,52): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(241,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(245,45): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(245,75): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(248,47): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(248,79): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(251,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/config.js(273,29): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/bin-links.js(11,24): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/bin-links.js(12,16): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/bin-links.js(13,20): error TS2339: Property 'globalBin' does not exist on type 'typeof EventEmitter'. @@ -211,32 +237,6 @@ node_modules/npm/lib/config/pacote.js(84,31): error TS2339: Property 'config' do node_modules/npm/lib/config/pacote.js(89,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/pacote.js(90,38): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/pacote.js(110,60): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(74,18): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(83,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(84,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(85,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(87,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(93,25): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(135,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(136,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(137,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(156,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(158,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(159,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(167,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(186,26): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(187,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(210,27): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(223,18): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(225,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(238,52): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(241,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(245,45): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(245,75): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(248,47): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(248,79): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(251,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/config.js(273,29): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/dedupe.js(35,32): error TS2339: Property 'dir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/dedupe.js(37,11): error TS2339: Property 'command' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/dedupe.js(38,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -274,9 +274,6 @@ node_modules/npm/lib/dist-tag.js(109,11): error TS2339: Property 'registry' does node_modules/npm/lib/dist-tag.js(142,26): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/dist-tag.js(149,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/docs.js(40,38): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/doctor/check-files-permission.js(11,14): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/doctor/check-files-permission.js(11,38): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/doctor/verify-cached-files.js(10,90): error TS2345: Argument of type '2' is not assignable to parameter of type '(string | number)[] | null | undefined'. node_modules/npm/lib/doctor.js(23,41): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor.js(24,40): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor.js(42,32): error TS2339: Property 'cache' does not exist on type 'typeof EventEmitter'. @@ -285,6 +282,9 @@ node_modules/npm/lib/doctor.js(55,13): error TS2339: Property 'color' does not e node_modules/npm/lib/doctor.js(88,20): error TS2339: Property 'version' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor.js(90,24): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/doctor.js(108,92): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/doctor/check-files-permission.js(11,14): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/doctor/check-files-permission.js(11,38): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/doctor/verify-cached-files.js(10,90): error TS2345: Argument of type '2' is not assignable to parameter of type '(string | number)[] | null | undefined'. node_modules/npm/lib/edit.js(18,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/edit.js(27,28): error TS2339: Property 'dir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/edit.js(32,11): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. @@ -333,6 +333,51 @@ node_modules/npm/lib/help.js(207,14): error TS2339: Property 'split' does not ex node_modules/npm/lib/init.js(38,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/init.js(39,25): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/init.js(53,31): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(182,36): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(184,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(186,17): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(190,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(192,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(200,36): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(224,24): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(226,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(227,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(230,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(235,34): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(236,63): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(237,51): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(239,85): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(240,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(268,26): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(269,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(272,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(273,7): error TS2532: Object is possibly 'undefined'. +node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, err?: any, ...args: any[]) => any'. + Type 'undefined' is not assignable to type '(this: null, err?: any, ...args: any[]) => any'. +node_modules/npm/lib/install.js(340,25): error TS2339: Property 'failing' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(369,18): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install.js(376,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. +node_modules/npm/lib/install.js(519,40): error TS2339: Property 'globalPrefix' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(597,12): error TS2339: Property 'failing' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(614,12): error TS2339: Property 'failing' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(634,88): error TS2339: Property 'remove' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(643,12): error TS2339: Property 'failing' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(684,12): error TS2339: Property 'code' does not exist on type 'Error'. +node_modules/npm/lib/install.js(685,12): error TS2339: Property 'errno' does not exist on type 'Error'. +node_modules/npm/lib/install.js(745,32): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(751,12): error TS2339: Property 'failing' does not exist on type 'Installer'. +node_modules/npm/lib/install.js(768,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(770,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(771,14): error TS2554: Expected 0-1 arguments, but got 2. +node_modules/npm/lib/install.js(890,26): error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(897,26): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(899,25): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(901,27): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(903,25): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(905,27): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. +node_modules/npm/lib/install.js(948,8): error TS2454: Variable 'previousPath' is used before being assigned. +node_modules/npm/lib/install.js(985,53): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/install.js(1007,53): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install/access-error.js(4,18): error TS2554: Expected 0-1 arguments, but got 2. node_modules/npm/lib/install/action/build.js(10,50): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install/action/extract.js(39,40): error TS2339: Property 'limit' does not exist on type 'typeof EventEmitter'. @@ -412,51 +457,6 @@ node_modules/npm/lib/install/validate-tree.js(70,25): error TS2339: Property 'co node_modules/npm/lib/install/validate-tree.js(74,13): error TS2339: Property 'code' does not exist on type 'Error'. node_modules/npm/lib/install/validate-tree.js(89,15): error TS2339: Property 'code' does not exist on type 'Error'. node_modules/npm/lib/install/writable.js(22,21): error TS2339: Property 'W_OK' does not exist on type 'typeof import("fs")'. -node_modules/npm/lib/install.js(182,36): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(184,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(186,17): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(190,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(192,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(200,36): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(224,24): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(226,19): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(227,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(230,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(235,34): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(236,63): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(237,51): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(239,85): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(240,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(268,26): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(269,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(272,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(273,7): error TS2532: Object is possibly 'undefined'. -node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, err?: any, ...args: any[]) => any'. - Type 'undefined' is not assignable to type '(this: null, err?: any, ...args: any[]) => any'. -node_modules/npm/lib/install.js(340,25): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(369,18): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/install.js(376,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. -node_modules/npm/lib/install.js(519,40): error TS2339: Property 'globalPrefix' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(597,12): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(614,12): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(634,88): error TS2339: Property 'remove' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(643,12): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(684,12): error TS2339: Property 'code' does not exist on type 'Error'. -node_modules/npm/lib/install.js(685,12): error TS2339: Property 'errno' does not exist on type 'Error'. -node_modules/npm/lib/install.js(745,32): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(751,12): error TS2339: Property 'failing' does not exist on type 'Installer'. -node_modules/npm/lib/install.js(768,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(770,20): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(771,14): error TS2554: Expected 0-1 arguments, but got 2. -node_modules/npm/lib/install.js(890,26): error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(897,26): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(899,25): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(901,27): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(903,25): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(905,27): error TS2345: Argument of type '{ action: any; name: any; version: any; path: any; }' is not assignable to parameter of type 'never'. -node_modules/npm/lib/install.js(948,8): error TS2454: Variable 'previousPath' is used before being assigned. -node_modules/npm/lib/install.js(985,53): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/install.js(1007,53): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/link.js(25,17): error TS2339: Property 'globalDir' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/link.js(39,9): error TS2339: Property 'code' does not exist on type 'Error'. node_modules/npm/lib/link.js(40,9): error TS2339: Property 'errno' does not exist on type 'Error'. @@ -685,14 +685,6 @@ node_modules/npm/lib/run-script.js(77,36): error TS2322: Type 'string' is not as node_modules/npm/lib/run-script.js(94,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(99,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(148,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/all-package-metadata.js(33,30): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/all-package-metadata.js(36,35): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/all-package-metadata.js(146,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/all-package-metadata.js(239,20): error TS2339: Property 'cache' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/esearch.js(15,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/esearch.js(35,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/search/format-package-stream.js(130,31): error TS2339: Property 'fd' does not exist on type 'WriteStream'. -node_modules/npm/lib/search/format-package-stream.js(130,63): error TS2339: Property 'getWindowSize' does not exist on type 'WriteStream'. node_modules/npm/lib/search.js(25,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/search.js(26,34): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/search.js(27,40): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -706,6 +698,14 @@ node_modules/npm/lib/search.js(71,20): error TS2339: Property 'config' does not node_modules/npm/lib/search.js(72,16): error TS2339: Property 'color' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/search.js(82,28): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/search.js(82,55): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/all-package-metadata.js(33,30): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/all-package-metadata.js(36,35): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/all-package-metadata.js(146,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/all-package-metadata.js(239,20): error TS2339: Property 'cache' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/esearch.js(15,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/esearch.js(35,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/search/format-package-stream.js(130,31): error TS2339: Property 'fd' does not exist on type 'WriteStream'. +node_modules/npm/lib/search/format-package-stream.js(130,63): error TS2339: Property 'getWindowSize' does not exist on type 'WriteStream'. node_modules/npm/lib/set.js(8,22): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/set.js(12,7): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/shrinkwrap.js(30,29): error TS2339: Property 'lockfileVersion' does not exist on type 'typeof EventEmitter'. diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index 9d6c2b26482..b799b7125ab 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -8,9 +8,9 @@ lib/Browser.js(71,49): error TS2322: Type 'Promise' is not assignabl Type 'T' is not assignable to type 'string | symbol'. Type 'string | number | symbol' is not assignable to type 'string | symbol'. Type 'number' is not assignable to type 'string | symbol'. - Type 'T' is not assignable to type 'symbol'. - Type 'string | number | symbol' is not assignable to type 'symbol'. - Type 'string' is not assignable to type 'symbol'. + Type 'T' is not assignable to type 'string'. + Type 'string | number | symbol' is not assignable to type 'string'. + Type 'number' is not assignable to type 'string'. lib/BrowserFetcher.js(100,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. lib/BrowserFetcher.js(195,13): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. lib/Connection.js(91,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. From 54bbf74f62db993ab5f7957f7f449fb469922b65 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Nov 2018 13:58:43 -0800 Subject: [PATCH 064/322] Do not lookup name of default property symbols from the symbols value declaration (#28711) --- src/compiler/checker.ts | 10 +++++-- .../keyofModuleObjectHasCorrectKeys.js | 27 +++++++++++++++++++ .../keyofModuleObjectHasCorrectKeys.symbols | 27 +++++++++++++++++++ .../keyofModuleObjectHasCorrectKeys.types | 27 +++++++++++++++++++ .../keyofModuleObjectHasCorrectKeys.ts | 11 ++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/keyofModuleObjectHasCorrectKeys.js create mode 100644 tests/baselines/reference/keyofModuleObjectHasCorrectKeys.symbols create mode 100644 tests/baselines/reference/keyofModuleObjectHasCorrectKeys.types create mode 100644 tests/cases/compiler/keyofModuleObjectHasCorrectKeys.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a1364c7a1f..da3c807777c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9410,8 +9410,13 @@ namespace ts { if (!(getDeclarationModifierFlagsFromSymbol(prop) & ModifierFlags.NonPublicAccessibilityModifier)) { let type = getLateBoundSymbol(prop).nameType; if (!type && !isKnownSymbol(prop)) { - const name = prop.valueDeclaration && getNameOfDeclaration(prop.valueDeclaration) as PropertyName; - type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(symbolName(prop)); + if (prop.escapedName === InternalSymbolName.Default) { + type = getLiteralType("default"); + } + else { + const name = prop.valueDeclaration && getNameOfDeclaration(prop.valueDeclaration) as PropertyName; + type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(symbolName(prop)); + } } if (type && type.flags & include) { return type; @@ -20873,6 +20878,7 @@ namespace ts { if (hasSyntheticDefault) { const memberTable = createSymbolTable(); const newSymbol = createSymbol(SymbolFlags.Alias, InternalSymbolName.Default); + newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set(InternalSymbolName.Default, newSymbol); const anonymousSymbol = createSymbol(SymbolFlags.TypeLiteral, InternalSymbolName.Type); diff --git a/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.js b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.js new file mode 100644 index 00000000000..78a974bf590 --- /dev/null +++ b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/keyofModuleObjectHasCorrectKeys.ts] //// + +//// [example.ts] +export default function add(a: number, b: number) { + return a + b; +} + +//// [test.ts] +import * as example from './example'; + +declare function test(object: T, method: keyof T): void; + +test(example, "default"); + + +//// [example.js] +"use strict"; +exports.__esModule = true; +function add(a, b) { + return a + b; +} +exports["default"] = add; +//// [test.js] +"use strict"; +exports.__esModule = true; +var example = require("./example"); +test(example, "default"); diff --git a/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.symbols b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.symbols new file mode 100644 index 00000000000..b92bc8aa5ac --- /dev/null +++ b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/example.ts === +export default function add(a: number, b: number) { +>add : Symbol(add, Decl(example.ts, 0, 0)) +>a : Symbol(a, Decl(example.ts, 0, 28)) +>b : Symbol(b, Decl(example.ts, 0, 38)) + + return a + b; +>a : Symbol(a, Decl(example.ts, 0, 28)) +>b : Symbol(b, Decl(example.ts, 0, 38)) +} + +=== tests/cases/compiler/test.ts === +import * as example from './example'; +>example : Symbol(example, Decl(test.ts, 0, 6)) + +declare function test(object: T, method: keyof T): void; +>test : Symbol(test, Decl(test.ts, 0, 37)) +>T : Symbol(T, Decl(test.ts, 2, 22)) +>object : Symbol(object, Decl(test.ts, 2, 25)) +>T : Symbol(T, Decl(test.ts, 2, 22)) +>method : Symbol(method, Decl(test.ts, 2, 35)) +>T : Symbol(T, Decl(test.ts, 2, 22)) + +test(example, "default"); +>test : Symbol(test, Decl(test.ts, 0, 37)) +>example : Symbol(example, Decl(test.ts, 0, 6)) + diff --git a/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.types b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.types new file mode 100644 index 00000000000..f3f83f3942a --- /dev/null +++ b/tests/baselines/reference/keyofModuleObjectHasCorrectKeys.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/example.ts === +export default function add(a: number, b: number) { +>add : (a: number, b: number) => number +>a : number +>b : number + + return a + b; +>a + b : number +>a : number +>b : number +} + +=== tests/cases/compiler/test.ts === +import * as example from './example'; +>example : typeof example + +declare function test(object: T, method: keyof T): void; +>test : (object: T, method: keyof T) => void +>object : T +>method : keyof T + +test(example, "default"); +>test(example, "default") : void +>test : (object: T, method: keyof T) => void +>example : typeof example +>"default" : "default" + diff --git a/tests/cases/compiler/keyofModuleObjectHasCorrectKeys.ts b/tests/cases/compiler/keyofModuleObjectHasCorrectKeys.ts new file mode 100644 index 00000000000..3d92dff9a2f --- /dev/null +++ b/tests/cases/compiler/keyofModuleObjectHasCorrectKeys.ts @@ -0,0 +1,11 @@ +// @filename: example.ts +export default function add(a: number, b: number) { + return a + b; +} + +// @filename: test.ts +import * as example from './example'; + +declare function test(object: T, method: keyof T): void; + +test(example, "default"); From 9319ea4941e8495645511cdc33b774c4721aa283 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Nov 2018 14:01:02 -0800 Subject: [PATCH 065/322] --showConfig files list condition was inverted from what it needed to be (#28693) * --showConfig files list condition was inverted from what it needed to be * Make no assumptions about file list normalization * accept updated, correct, baseline --- src/compiler/commandLineParser.ts | 14 +++++++------- .../Show TSConfig with files options/tsconfig.json | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e80c1c639b7..8ca93fdab80 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1673,13 +1673,13 @@ namespace ts { const files = map( filter( configParseResult.fileNames, - !configParseResult.configFileSpecs ? _ => false : matchesSpecs( + (!configParseResult.configFileSpecs || !configParseResult.configFileSpecs.validatedIncludeSpecs) ? _ => true : matchesSpecs( configFileName, configParseResult.configFileSpecs.validatedIncludeSpecs, configParseResult.configFileSpecs.validatedExcludeSpecs ) ), - f => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), f, getCanonicalFileName) + f => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName) ); const optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames }); const config = { @@ -1713,20 +1713,20 @@ namespace ts { } function matchesSpecs(path: string, includeSpecs: ReadonlyArray | undefined, excludeSpecs: ReadonlyArray | undefined): (path: string) => boolean { - if (!includeSpecs) return _ => false; + if (!includeSpecs) return _ => true; const patterns = getFileMatcherPatterns(path, excludeSpecs, includeSpecs, sys.useCaseSensitiveFileNames, sys.getCurrentDirectory()); const excludeRe = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, sys.useCaseSensitiveFileNames); const includeRe = patterns.includeFilePattern && getRegexFromPattern(patterns.includeFilePattern, sys.useCaseSensitiveFileNames); if (includeRe) { if (excludeRe) { - return path => includeRe.test(path) && !excludeRe.test(path); + return path => !(includeRe.test(path) && !excludeRe.test(path)); } - return path => includeRe.test(path); + return path => !includeRe.test(path); } if (excludeRe) { - return path => !excludeRe.test(path); + return path => excludeRe.test(path); } - return _ => false; + return _ => true; } function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption): Map | undefined { diff --git a/tests/baselines/reference/showConfig/Show TSConfig with files options/tsconfig.json b/tests/baselines/reference/showConfig/Show TSConfig with files options/tsconfig.json index cd727e8ccdc..2b2c1385bab 100644 --- a/tests/baselines/reference/showConfig/Show TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/showConfig/Show TSConfig with files options/tsconfig.json @@ -1,3 +1,8 @@ { - "compilerOptions": {} + "compilerOptions": {}, + "files": [ + "./file0.st", + "./file1.ts", + "./file2.ts" + ] } From 01ee1b9c25ca8201bfae39aa288357e1c9ec91a4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Nov 2018 14:56:49 -0800 Subject: [PATCH 066/322] Exclude T[K] assignability check from definitelyAssignableRelation --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a1364c7a1f..bc3bd0ebd8a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12254,7 +12254,8 @@ namespace ts { else if (target.flags & TypeFlags.IndexedAccess) { // A type S is related to a type T[K], where T and K aren't both type variables, if S is related to C, // where C is the base constraint of T[K] - if (relation !== identityRelation && !(isGenericObjectType((target).objectType) && isGenericIndexType((target).indexType))) { + if (relation !== identityRelation && relation !== definitelyAssignableRelation && + !(isGenericObjectType((target).objectType) && isGenericIndexType((target).indexType))) { const constraint = getBaseConstraintOfType(target); if (constraint && constraint !== target) { if (result = isRelatedTo(source, constraint, reportErrors)) { From d832fbf46a04ad0374e144d98c200b99b2e0450c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Nov 2018 14:58:11 -0800 Subject: [PATCH 067/322] Add regression test --- .../conformance/types/conditional/conditionalTypes2.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes2.ts b/tests/cases/conformance/types/conditional/conditionalTypes2.ts index be758945469..2fd13ceff85 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes2.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes2.ts @@ -147,3 +147,12 @@ type B2 = type C2 = T extends object ? { [Q in keyof T]: C2; } : T; + +// Repro from #28654 + +type MaybeTrue = true extends T["b"] ? "yes" : "no"; + +type T0 = MaybeTrue<{ b: never }> // "no" +type T1 = MaybeTrue<{ b: false }>; // "no" +type T2 = MaybeTrue<{ b: true }>; // "yes" +type T3 = MaybeTrue<{ b: boolean }>; // "yes" From ff456ab17137e4382ea84d069f28881210c2671f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Nov 2018 14:58:21 -0800 Subject: [PATCH 068/322] Accept new baselines --- .../reference/conditionalTypes2.errors.txt | 9 ++++++ .../baselines/reference/conditionalTypes2.js | 24 ++++++++++++++++ .../reference/conditionalTypes2.symbols | 28 +++++++++++++++++++ .../reference/conditionalTypes2.types | 25 +++++++++++++++++ 4 files changed, 86 insertions(+) diff --git a/tests/baselines/reference/conditionalTypes2.errors.txt b/tests/baselines/reference/conditionalTypes2.errors.txt index fdf210f4793..322cbe1e7bb 100644 --- a/tests/baselines/reference/conditionalTypes2.errors.txt +++ b/tests/baselines/reference/conditionalTypes2.errors.txt @@ -203,4 +203,13 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2 type C2 = T extends object ? { [Q in keyof T]: C2; } : T; + + // Repro from #28654 + + type MaybeTrue = true extends T["b"] ? "yes" : "no"; + + type T0 = MaybeTrue<{ b: never }> // "no" + type T1 = MaybeTrue<{ b: false }>; // "no" + type T2 = MaybeTrue<{ b: true }>; // "yes" + type T3 = MaybeTrue<{ b: boolean }>; // "yes" \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes2.js b/tests/baselines/reference/conditionalTypes2.js index 1f95e7eb8d9..02581ab0015 100644 --- a/tests/baselines/reference/conditionalTypes2.js +++ b/tests/baselines/reference/conditionalTypes2.js @@ -145,6 +145,15 @@ type B2 = type C2 = T extends object ? { [Q in keyof T]: C2; } : T; + +// Repro from #28654 + +type MaybeTrue = true extends T["b"] ? "yes" : "no"; + +type T0 = MaybeTrue<{ b: never }> // "no" +type T1 = MaybeTrue<{ b: false }>; // "no" +type T2 = MaybeTrue<{ b: true }>; // "yes" +type T3 = MaybeTrue<{ b: boolean }>; // "yes" //// [conditionalTypes2.js] @@ -304,3 +313,18 @@ declare type B2 = T extends object ? T extends any[] ? T : { declare type C2 = T extends object ? { [Q in keyof T]: C2; } : T; +declare type MaybeTrue = true extends T["b"] ? "yes" : "no"; +declare type T0 = MaybeTrue<{ + b: never; +}>; +declare type T1 = MaybeTrue<{ + b: false; +}>; +declare type T2 = MaybeTrue<{ + b: true; +}>; +declare type T3 = MaybeTrue<{ + b: boolean; +}>; diff --git a/tests/baselines/reference/conditionalTypes2.symbols b/tests/baselines/reference/conditionalTypes2.symbols index c52179e81b0..b9098616f0f 100644 --- a/tests/baselines/reference/conditionalTypes2.symbols +++ b/tests/baselines/reference/conditionalTypes2.symbols @@ -551,3 +551,31 @@ type C2 = >E : Symbol(E, Decl(conditionalTypes2.ts, 144, 13)) >T : Symbol(T, Decl(conditionalTypes2.ts, 144, 8)) +// Repro from #28654 + +type MaybeTrue = true extends T["b"] ? "yes" : "no"; +>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) +>T : Symbol(T, Decl(conditionalTypes2.ts, 149, 15)) +>b : Symbol(b, Decl(conditionalTypes2.ts, 149, 26)) +>T : Symbol(T, Decl(conditionalTypes2.ts, 149, 15)) + +type T0 = MaybeTrue<{ b: never }> // "no" +>T0 : Symbol(T0, Decl(conditionalTypes2.ts, 149, 78)) +>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) +>b : Symbol(b, Decl(conditionalTypes2.ts, 151, 21)) + +type T1 = MaybeTrue<{ b: false }>; // "no" +>T1 : Symbol(T1, Decl(conditionalTypes2.ts, 151, 33)) +>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) +>b : Symbol(b, Decl(conditionalTypes2.ts, 152, 21)) + +type T2 = MaybeTrue<{ b: true }>; // "yes" +>T2 : Symbol(T2, Decl(conditionalTypes2.ts, 152, 34)) +>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) +>b : Symbol(b, Decl(conditionalTypes2.ts, 153, 21)) + +type T3 = MaybeTrue<{ b: boolean }>; // "yes" +>T3 : Symbol(T3, Decl(conditionalTypes2.ts, 153, 33)) +>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) +>b : Symbol(b, Decl(conditionalTypes2.ts, 154, 21)) + diff --git a/tests/baselines/reference/conditionalTypes2.types b/tests/baselines/reference/conditionalTypes2.types index 58ce7e5d5b4..e500d21d36b 100644 --- a/tests/baselines/reference/conditionalTypes2.types +++ b/tests/baselines/reference/conditionalTypes2.types @@ -341,3 +341,28 @@ type C2 = T extends object ? { [Q in keyof T]: C2; } : T; +// Repro from #28654 + +type MaybeTrue = true extends T["b"] ? "yes" : "no"; +>MaybeTrue : MaybeTrue +>b : boolean +>true : true + +type T0 = MaybeTrue<{ b: never }> // "no" +>T0 : "no" +>b : never + +type T1 = MaybeTrue<{ b: false }>; // "no" +>T1 : "no" +>b : false +>false : false + +type T2 = MaybeTrue<{ b: true }>; // "yes" +>T2 : "yes" +>b : true +>true : true + +type T3 = MaybeTrue<{ b: boolean }>; // "yes" +>T3 : "yes" +>b : boolean + From 92a8cc9f5f4ee23b848f2f3328646556e8b19236 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 29 Nov 2018 10:19:42 -0800 Subject: [PATCH 069/322] Fix logic that bails out of incremental parsing in certain contexts --- src/compiler/parser.ts | 58 ++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 3e98b6cbdbc..f976f77ea98 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -1717,6 +1717,8 @@ namespace ts { } function currentNode(parsingContext: ParsingContext): Node | undefined { + // If we don't have a cursor or the parsing context isn't reusable, there's nothing to reuse. + // // If there is an outstanding parse error that we've encountered, but not attached to // some node, then we cannot get a node from the old source tree. This is because we // want to mark the next node we encounter as being unusable. @@ -1724,30 +1726,17 @@ namespace ts { // Note: This may be too conservative. Perhaps we could reuse the node and set the bit // on it (or its leftmost child) as having the error. For now though, being conservative // is nice and likely won't ever affect perf. - if (parseErrorBeforeNextFinishedNode) { - return undefined; - } - - if (!syntaxCursor) { - // if we don't have a cursor, we could never return a node from the old tree. + if (!syntaxCursor || !isReusableParsingContext(parsingContext) || parseErrorBeforeNextFinishedNode) { return undefined; } const node = syntaxCursor.currentNode(scanner.getStartPos()); // Can't reuse a missing node. - if (nodeIsMissing(node)) { - return undefined; - } - // Can't reuse a node that intersected the change range. - if (node.intersectsChange) { - return undefined; - } - // Can't reuse a node that contains a parse error. This is necessary so that we // produce the same set of errors again. - if (containsParseError(node)) { + if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) { return undefined; } @@ -1788,6 +1777,23 @@ namespace ts { return node; } + function isReusableParsingContext(parsingContext: ParsingContext): boolean { + switch (parsingContext) { + case ParsingContext.ClassMembers: + case ParsingContext.SwitchClauses: + case ParsingContext.SourceElements: + case ParsingContext.BlockStatements: + case ParsingContext.SwitchClauseStatements: + case ParsingContext.EnumMembers: + case ParsingContext.TypeMembers: + case ParsingContext.VariableDeclarations: + case ParsingContext.JSDocParameters: + case ParsingContext.Parameters: + return true; + } + return false; + } + function canReuseNode(node: Node, parsingContext: ParsingContext): boolean { switch (parsingContext) { case ParsingContext.ClassMembers: @@ -1814,25 +1820,23 @@ namespace ts { case ParsingContext.Parameters: return isReusableParameter(node); - case ParsingContext.RestProperties: - return false; - // Any other lists we do not care about reusing nodes in. But feel free to add if // you can do so safely. Danger areas involve nodes that may involve speculative // parsing. If speculative parsing is involved with the node, then the range the // parser reached while looking ahead might be in the edited range (see the example // in canReuseVariableDeclaratorNode for a good case of this). - case ParsingContext.HeritageClauses: + + // case ParsingContext.HeritageClauses: // This would probably be safe to reuse. There is no speculative parsing with // heritage clauses. - case ParsingContext.TypeParameters: + // case ParsingContext.TypeParameters: // This would probably be safe to reuse. There is no speculative parsing with // type parameters. Note that that's because type *parameters* only occur in // unambiguous *type* contexts. While type *arguments* occur in very ambiguous // *expression* contexts. - case ParsingContext.TupleElementTypes: + // case ParsingContext.TupleElementTypes: // This would probably be safe to reuse. There is no speculative parsing with // tuple types. @@ -1841,28 +1845,28 @@ namespace ts { // produced from speculative parsing a < as a type argument list), we only have // the types because speculative parsing succeeded. Thus, the lookahead never // went past the end of the list and rewound. - case ParsingContext.TypeArguments: + // case ParsingContext.TypeArguments: // Note: these are almost certainly not safe to ever reuse. Expressions commonly // need a large amount of lookahead, and we should not reuse them as they may // have actually intersected the edit. - case ParsingContext.ArgumentExpressions: + // case ParsingContext.ArgumentExpressions: // This is not safe to reuse for the same reason as the 'AssignmentExpression' // cases. i.e. a property assignment may end with an expression, and thus might // have lookahead far beyond it's old node. - case ParsingContext.ObjectLiteralMembers: + // case ParsingContext.ObjectLiteralMembers: // This is probably not safe to reuse. There can be speculative parsing with // type names in a heritage clause. There can be generic names in the type // name list, and there can be left hand side expressions (which can have type // arguments.) - case ParsingContext.HeritageClauseElement: + // case ParsingContext.HeritageClauseElement: // Perhaps safe to reuse, but it's unlikely we'd see more than a dozen attributes // on any given element. Same for children. - case ParsingContext.JsxAttributes: - case ParsingContext.JsxChildren: + // case ParsingContext.JsxAttributes: + // case ParsingContext.JsxChildren: } From 23abcc02a30aecd01d783917f01e76bd87466fce Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 29 Nov 2018 11:58:32 -0800 Subject: [PATCH 070/322] Use compilerOptionsIndicateEs6Modules over program contains es6 modules for determining auto import offering. Also dont depend on uncheck js file for this. Fixes #28696 --- src/services/completions.ts | 8 ++- ...completionsImport_compilerOptionsModule.ts | 19 +++++-- ...oImportCompletionsInOtherJavaScriptFile.ts | 51 +++++++++++++------ 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index 878b4bcd130..c127f0c3a7b 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1050,12 +1050,10 @@ namespace ts.Completions { if (sourceFile.externalModuleIndicator) return true; // If already using commonjs, don't introduce ES6. if (sourceFile.commonJsModuleIndicator) return false; - // For JS, stay on the safe side. - if (isUncheckedFile) return false; - // If some file is using ES6 modules, assume that it's OK to add more. - if (programContainsEs6Modules(program)) return true; // If module transpilation is enabled or we're targeting es6 or above, or not emitting, OK. - return compilerOptionsIndicateEs6Modules(program.getCompilerOptions()); + if (compilerOptionsIndicateEs6Modules(program.getCompilerOptions())) return true; + // If some file is using ES6 modules, assume that it's OK to add more. + return programContainsEs6Modules(program); } function isSnippetScope(scopeNode: Node): boolean { diff --git a/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts b/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts index 6d1c22aec0c..27ae94d4172 100644 --- a/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts +++ b/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts @@ -11,22 +11,31 @@ ////fo/*b*/ // @Filename: /c.js -////const x = 0;/*c*/ // Off for JS files (unless a non-declaration external module exists in the project) +////const x = 0;/*c*/ + +// @Filename: /c1.js +////// @ts-check +////const x = 0;/*ccheck*/ // @Filename: /c2.ts -////const x = 0;/*c2*/ +////const x = 0;/*cts*/ // @Filename: /d.js ////const a = import("./a"); // Does not make this an external module ////fo/*d*/ +// @Filename: /d1.js +////// @ts-check +////const a = import("./a"); // Does not make this an external module +////fo/*dcheck*/ + // @Filename: /d2.ts ////const a = import("./a"); // Does not make this an external module -////fo/*d2*/ +////fo/*dts*/ -verify.completions({ marker: ["b", "c", "d"], excludes: "foo", preferences: { includeCompletionsForModuleExports: true } }); +verify.completions({ marker: ["b"], excludes: "foo", preferences: { includeCompletionsForModuleExports: true } }); verify.completions({ - marker: ["c2", "d2"], + marker: ["c", "ccheck", "cts", "d", "dcheck", "dts"], includes: [{ name: "foo", source: "/node_modules/a/index", text: "const foo: 0", kind: "const", kindModifiers: "export,declare", hasAction: true, sourceDisplay: "a" }], preferences: { includeCompletionsForModuleExports: true }, }); diff --git a/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts b/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts index 71ed84d7768..0848b3e7cc2 100644 --- a/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts +++ b/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts @@ -12,19 +12,40 @@ //// // @Filename: /b.js -//// /**/ +//// /*1*/ -verify.completions({ marker: "", excludes: "fail", preferences: { includeCompletionsForModuleExports: true } }); -edit.insert("export const k = 10;\r\nf"); -verify.completions({ - includes: { - name: "fail", - source: "/node_modules/foo/index", - sourceDisplay: "./node_modules/foo/index", - text: "const fail: number", - kind: "const", - kindModifiers: "export,declare", - hasAction: true, - }, - preferences: { includeCompletionsForModuleExports: true }, -}); +// @Filename: /b2.js +//////@ts-check +/////*2*/ + +// @Filename: /b3.ts +/////*3*/ + +// In esnext js files are assumed to be modules +goTo.eachMarker(() => { + verify.completions({ + includes: { + name: "fail", + source: "/node_modules/foo/index", + sourceDisplay: "./node_modules/foo/index", + text: "const fail: number", + kind: "const", + kindModifiers: "export,declare", + hasAction: true, + }, + preferences: { includeCompletionsForModuleExports: true }, + }); + edit.insert("export const k = 10;\r\nf"); + verify.completions({ + includes: { + name: "fail", + source: "/node_modules/foo/index", + sourceDisplay: "./node_modules/foo/index", + text: "const fail: number", + kind: "const", + kindModifiers: "export,declare", + hasAction: true, + }, + preferences: { includeCompletionsForModuleExports: true }, + }); +}); \ No newline at end of file From 0f5121df9f2a3d78d5960b6e2ef3c55164ecd739 Mon Sep 17 00:00:00 2001 From: r7kamura Date: Fri, 30 Nov 2018 22:26:21 +0900 Subject: [PATCH 071/322] Add terminating newline to generated tsconfig.json This commit adds a terminating newline to tsconfig.json generated by `tsc --init`, just like `npm init`'s package.json. The main reason I created this pull request is for editor friendliness. Recently I created a new TypeScript project with `tsc --init`, then I modified some compilerOptions and tried to git-commit the change, but I found a newline was automatically added by my editor. I think it's better that the default tsconfig.json template has a terminating newline. --- src/compiler/commandLineParser.ts | 2 +- .../tsConfig/Default initialized TSConfig/tsconfig.json | 2 +- .../Initialized TSConfig with advanced options/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../Initialized TSConfig with files options/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 8ca93fdab80..1ba7c1c3f46 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1893,7 +1893,7 @@ namespace ts { } result.push(`}`); - return result.join(newLine); + return result.join(newLine) + newLine; } } diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index e4e3d7b8ec4..ac5ebf02160 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json index 1919671c489..0e4adce88d2 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json @@ -62,4 +62,4 @@ "declarationDir": "lib", /* Output directory for generated declaration files. */ "skipLibCheck": true /* Skip type checking of declaration files. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index 3b49dee6e3d..211bcb97d5f 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index d91e167877d..8c3d7be38ec 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index e6107b29b4c..b8dfce1ff43 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -62,4 +62,4 @@ "file1.ts", "file2.ts" ] -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index 7c18b695c7b..60cccb8b3b3 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index e4e3d7b8ec4..ac5ebf02160 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index eedcc357043..81641589d59 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index 6fc7833730f..826babfd625 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -57,4 +57,4 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ } -} \ No newline at end of file +} From b44ee8ef4b5f3775c451b7aad90d53e8a284bdd0 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 14:59:43 -0800 Subject: [PATCH 072/322] Added tests for types with overlap across a single property name. --- .../errorsOnUnionsOfOverlappingObjects01.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts index aec1821c162..fe1d63cb606 100644 --- a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts +++ b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts @@ -27,3 +27,21 @@ declare function h(x: Foo | Bar | Other): any; h(x); h({ a: '', b: '' }) + +interface CatDog { cat: any, dog: any } +interface ManBearPig { man: any, bear: any, pig: any } +interface Platypus { platypus: any } + +type ExoticAnimal = + | CatDog + | ManBearPig + | Platypus; + +declare function addToZoo(animal: ExoticAnimal): void; + +addToZoo({ dog: "Barky McBarkface" }); +addToZoo({ man: "Manny", bear: "Coffee" }); + +const manBeer = { man: "Manny", beer: "Coffee" }; +addToZoo({ man: "Manny", beer: "Coffee" }); +addToZoo(manBeer); \ No newline at end of file From 448baaeb2fa7b05014b54b847d376d063759437c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 15:07:50 -0800 Subject: [PATCH 073/322] Accepted baselines. --- ...sOnUnionsOfOverlappingObjects01.errors.txt | 43 ++++++++++++- .../errorsOnUnionsOfOverlappingObjects01.js | 24 +++++++- ...rorsOnUnionsOfOverlappingObjects01.symbols | 55 +++++++++++++++++ ...errorsOnUnionsOfOverlappingObjects01.types | 61 +++++++++++++++++++ 4 files changed, 180 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt index 3944c430f33..353c3e2fe29 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt @@ -8,9 +8,17 @@ tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(19,3): error TS2345 Type 'string' is not assignable to type 'number'. tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(42,10): error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'. + Property 'platypus' is missing in type '{ dog: string; }' but required in type 'Platypus'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(43,10): error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'. + Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(46,26): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. + Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. +tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. + Type '{ man: string; beer: string; }' is missing the following properties from type 'ManBearPig': bear, pig -==== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts (3 errors) ==== +==== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts (7 errors) ==== interface Foo { a: string; b: number; @@ -53,4 +61,35 @@ tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345 h(x); h({ a: '', b: '' }) - \ No newline at end of file + + interface CatDog { cat: any, dog: any } + interface ManBearPig { man: any, bear: any, pig: any } + interface Platypus { platypus: any } + + type ExoticAnimal = + | CatDog + | ManBearPig + | Platypus; + + declare function addToZoo(animal: ExoticAnimal): void; + + addToZoo({ dog: "Barky McBarkface" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'. +!!! error TS2345: Property 'platypus' is missing in type '{ dog: string; }' but required in type 'Platypus'. +!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:33:22: 'platypus' is declared here. + addToZoo({ man: "Manny", bear: "Coffee" }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'. +!!! error TS2345: Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'. +!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:32:45: 'pig' is declared here. + + const manBeer = { man: "Manny", beer: "Coffee" }; + addToZoo({ man: "Manny", beer: "Coffee" }); + ~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. +!!! error TS2345: Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'. + addToZoo(manBeer); + ~~~~~~~ +!!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. +!!! error TS2345: Type '{ man: string; beer: string; }' is missing the following properties from type 'ManBearPig': bear, pig \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js index 36824508b12..a5d63d76f21 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.js @@ -28,7 +28,24 @@ declare function h(x: Foo | Bar | Other): any; h(x); h({ a: '', b: '' }) - + +interface CatDog { cat: any, dog: any } +interface ManBearPig { man: any, bear: any, pig: any } +interface Platypus { platypus: any } + +type ExoticAnimal = + | CatDog + | ManBearPig + | Platypus; + +declare function addToZoo(animal: ExoticAnimal): void; + +addToZoo({ dog: "Barky McBarkface" }); +addToZoo({ man: "Manny", bear: "Coffee" }); + +const manBeer = { man: "Manny", beer: "Coffee" }; +addToZoo({ man: "Manny", beer: "Coffee" }); +addToZoo(manBeer); //// [errorsOnUnionsOfOverlappingObjects01.js] "use strict"; @@ -41,3 +58,8 @@ g(exports.x); g({ a: '', b: '' }); h(exports.x); h({ a: '', b: '' }); +addToZoo({ dog: "Barky McBarkface" }); +addToZoo({ man: "Manny", bear: "Coffee" }); +var manBeer = { man: "Manny", beer: "Coffee" }; +addToZoo({ man: "Manny", beer: "Coffee" }); +addToZoo(manBeer); diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols index 0ce5d6fd2d4..b92f2e895f6 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.symbols @@ -75,3 +75,58 @@ h({ a: '', b: '' }) >a : Symbol(a, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 3)) >b : Symbol(b, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 10)) +interface CatDog { cat: any, dog: any } +>CatDog : Symbol(CatDog, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 19)) +>cat : Symbol(CatDog.cat, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 30, 18)) +>dog : Symbol(CatDog.dog, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 30, 28)) + +interface ManBearPig { man: any, bear: any, pig: any } +>ManBearPig : Symbol(ManBearPig, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 30, 39)) +>man : Symbol(ManBearPig.man, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 31, 22)) +>bear : Symbol(ManBearPig.bear, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 31, 32)) +>pig : Symbol(ManBearPig.pig, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 31, 43)) + +interface Platypus { platypus: any } +>Platypus : Symbol(Platypus, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 31, 54)) +>platypus : Symbol(Platypus.platypus, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 32, 20)) + +type ExoticAnimal = +>ExoticAnimal : Symbol(ExoticAnimal, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 32, 36)) + + | CatDog +>CatDog : Symbol(CatDog, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 28, 19)) + + | ManBearPig +>ManBearPig : Symbol(ManBearPig, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 30, 39)) + + | Platypus; +>Platypus : Symbol(Platypus, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 31, 54)) + +declare function addToZoo(animal: ExoticAnimal): void; +>addToZoo : Symbol(addToZoo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 37, 15)) +>animal : Symbol(animal, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 39, 26)) +>ExoticAnimal : Symbol(ExoticAnimal, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 32, 36)) + +addToZoo({ dog: "Barky McBarkface" }); +>addToZoo : Symbol(addToZoo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 37, 15)) +>dog : Symbol(dog, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 41, 10)) + +addToZoo({ man: "Manny", bear: "Coffee" }); +>addToZoo : Symbol(addToZoo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 37, 15)) +>man : Symbol(man, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 42, 10)) +>bear : Symbol(bear, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 42, 24)) + +const manBeer = { man: "Manny", beer: "Coffee" }; +>manBeer : Symbol(manBeer, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 44, 5)) +>man : Symbol(man, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 44, 17)) +>beer : Symbol(beer, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 44, 31)) + +addToZoo({ man: "Manny", beer: "Coffee" }); +>addToZoo : Symbol(addToZoo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 37, 15)) +>man : Symbol(man, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 45, 10)) +>beer : Symbol(beer, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 45, 24)) + +addToZoo(manBeer); +>addToZoo : Symbol(addToZoo, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 37, 15)) +>manBeer : Symbol(manBeer, Decl(errorsOnUnionsOfOverlappingObjects01.ts, 44, 5)) + diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types index a860897d1fa..1e9b1b8c5ef 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.types @@ -80,3 +80,64 @@ h({ a: '', b: '' }) >b : string >'' : "" +interface CatDog { cat: any, dog: any } +>cat : any +>dog : any + +interface ManBearPig { man: any, bear: any, pig: any } +>man : any +>bear : any +>pig : any + +interface Platypus { platypus: any } +>platypus : any + +type ExoticAnimal = +>ExoticAnimal : ExoticAnimal + + | CatDog + | ManBearPig + | Platypus; + +declare function addToZoo(animal: ExoticAnimal): void; +>addToZoo : (animal: ExoticAnimal) => void +>animal : ExoticAnimal + +addToZoo({ dog: "Barky McBarkface" }); +>addToZoo({ dog: "Barky McBarkface" }) : void +>addToZoo : (animal: ExoticAnimal) => void +>{ dog: "Barky McBarkface" } : { dog: string; } +>dog : string +>"Barky McBarkface" : "Barky McBarkface" + +addToZoo({ man: "Manny", bear: "Coffee" }); +>addToZoo({ man: "Manny", bear: "Coffee" }) : void +>addToZoo : (animal: ExoticAnimal) => void +>{ man: "Manny", bear: "Coffee" } : { man: string; bear: string; } +>man : string +>"Manny" : "Manny" +>bear : string +>"Coffee" : "Coffee" + +const manBeer = { man: "Manny", beer: "Coffee" }; +>manBeer : { man: string; beer: string; } +>{ man: "Manny", beer: "Coffee" } : { man: string; beer: string; } +>man : string +>"Manny" : "Manny" +>beer : string +>"Coffee" : "Coffee" + +addToZoo({ man: "Manny", beer: "Coffee" }); +>addToZoo({ man: "Manny", beer: "Coffee" }) : void +>addToZoo : (animal: ExoticAnimal) => void +>{ man: "Manny", beer: "Coffee" } : { man: string; beer: string; } +>man : string +>"Manny" : "Manny" +>beer : string +>"Coffee" : "Coffee" + +addToZoo(manBeer); +>addToZoo(manBeer) : void +>addToZoo : (animal: ExoticAnimal) => void +>manBeer : { man: string; beer: string; } + From ba5ba4187698b36d2e6f96bc23a0be9d3005594f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 15:09:02 -0800 Subject: [PATCH 074/322] Types are only overlappy if their index types are single 'keyof's or literal types. --- src/compiler/checker.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b0c22b61341..394f13bc2cc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11976,19 +11976,21 @@ namespace ts { bestMatch = target; matchingCount = Infinity; } - else if (overlap.flags & TypeFlags.Union) { - // Some subset overlap if we have only string literals. + else if (isLiteralType(overlap)) { + // We only want to account for literal types otherwise. // If we have a union of index types, it seems likely that we // needed to elaborate between two generic mapped types anyway. - const len = length((overlap as UnionType).types); - if (len >= matchingCount) { - bestMatch = target; - matchingCount = len; + if (overlap.flags & TypeFlags.Union) { + const len = length((overlap as UnionType).types); + if (len >= matchingCount) { + bestMatch = target; + matchingCount = len; + } + } + else if (1 >= matchingCount) { + bestMatch = target; + matchingCount = 1; } - } - else if (!(overlap.flags & TypeFlags.Never) && 1 >= matchingCount) { - bestMatch = target; - matchingCount = 1; } } return bestMatch; From ac11aa345eb1e3f21a65c8686c0ca7ce725cb3e3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 15:16:26 -0800 Subject: [PATCH 075/322] Accepted baselines. --- .../checkJsxChildrenProperty2.errors.txt | 16 ++++++++-------- ...rorsOnUnionsOfOverlappingObjects01.errors.txt | 6 +++--- tests/baselines/reference/inferTypes1.errors.txt | 4 ++-- .../intersectionWithUnionConstraint.errors.txt | 4 ++-- .../reference/iteratorSpreadInArray6.errors.txt | 12 ++---------- .../reference/mappedTypeErrors.errors.txt | 4 ++-- .../reference/mappedTypeErrors2.errors.txt | 4 ++-- ...TypeWithRecursiveSubtypeReduction2.errors.txt | 13 ++++++++++--- 8 files changed, 31 insertions(+), 32 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt index e2931b3fb5d..0edadf6dc1b 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt @@ -3,19 +3,19 @@ tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specif tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. - Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'. + Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(number | Element)[]' is not assignable to type 'string | Element'. - Type '(number | Element)[]' is not assignable to type 'string'. + Type '(number | Element)[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(string | Element)[]' is not assignable to type 'string | Element'. - Type '(string | Element)[]' is not assignable to type 'string'. + Type '(string | Element)[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'string | Element'. - Type 'Element[]' is not assignable to type 'string'. + Type 'Element[]' is missing the following properties from type 'Element': type, props ==== tests/cases/conformance/jsx/file.tsx (6 errors) ==== @@ -59,7 +59,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'. +!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props
My Div
{(name: string) =>
My name {name}
} ; @@ -70,7 +70,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string'. +!!! error TS2322: Type '(number | Element)[]' is missing the following properties from type 'Element': type, props
My Div
{1000000} ; @@ -81,7 +81,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string'. +!!! error TS2322: Type '(string | Element)[]' is missing the following properties from type 'Element': type, props
My Div
hi hi hi! ; @@ -92,7 +92,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type 'Element[]' is not assignable to type 'string'. +!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props
My Div
My Div
; \ No newline at end of file diff --git a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt index 353c3e2fe29..1b8dab19b5b 100644 --- a/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt +++ b/tests/baselines/reference/errorsOnUnionsOfOverlappingObjects01.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(19,3): error TS2345 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'. Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'. tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(42,10): error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'. - Property 'platypus' is missing in type '{ dog: string; }' but required in type 'Platypus'. + Property 'cat' is missing in type '{ dog: string; }' but required in type 'CatDog'. tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(43,10): error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'. Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'. tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(46,26): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'. @@ -76,8 +76,8 @@ tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS234 addToZoo({ dog: "Barky McBarkface" }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'. -!!! error TS2345: Property 'platypus' is missing in type '{ dog: string; }' but required in type 'Platypus'. -!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:33:22: 'platypus' is declared here. +!!! error TS2345: Property 'cat' is missing in type '{ dog: string; }' but required in type 'CatDog'. +!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:31:20: 'cat' is declared here. addToZoo({ man: "Manny", bear: "Coffee" }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'. diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index cbe3eab039c..4684b8f5e34 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -18,7 +18,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: E tests/cases/conformance/types/conditional/inferTypes1.ts(82,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'string'. + Type 'T' is not assignable to type 'symbol'. ==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== @@ -202,7 +202,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: type B = string extends T ? { [P in T]: void; } : T; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'T' is not assignable to type 'symbol'. // Repro from #22302 diff --git a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt index 5ed34cbe626..9bdfc6f30f9 100644 --- a/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt +++ b/tests/baselines/reference/intersectionWithUnionConstraint.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(7,9): error TS2322: Type 'T & U' is not assignable to type 'string | number'. Type 'string | undefined' is not assignable to type 'string | number'. Type 'undefined' is not assignable to type 'string | number'. - Type 'T & U' is not assignable to type 'string'. + Type 'T & U' is not assignable to type 'number'. tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(8,9): error TS2322: Type 'T & U' is not assignable to type 'string | null'. Type 'string | undefined' is not assignable to type 'string | null'. Type 'undefined' is not assignable to type 'string | null'. @@ -32,7 +32,7 @@ tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts(12 !!! error TS2322: Type 'T & U' is not assignable to type 'string | number'. !!! error TS2322: Type 'string | undefined' is not assignable to type 'string | number'. !!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. -!!! error TS2322: Type 'T & U' is not assignable to type 'string'. +!!! error TS2322: Type 'T & U' is not assignable to type 'number'. let y2: string | null = x; // Error ~~ !!! error TS2322: Type 'T & U' is not assignable to type 'string | null'. diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index 4f547c59ed0..b151757c98f 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,9 +1,5 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. - Type 'symbol[]' is not assignable to type 'number[]'. - Type 'symbol' is not assignable to type 'number'. + Type 'symbol[]' is not assignable to type 'number'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -24,8 +20,4 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS234 array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'ConcatArray'. -!!! error TS2345: Types of property 'slice' are incompatible. -!!! error TS2345: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2345: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Type 'symbol[]' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 19be0493cc9..254d1cca1a8 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -37,7 +37,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(128,16): error TS2322: tests/cases/conformance/types/mapped/mappedTypeErrors.ts(129,25): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(130,39): error TS2322: Type 'string' is not assignable to type 'number | undefined'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,16): error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. - Type 'T' is not assignable to type 'string'. + Type 'T' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: Type 'P' cannot be used to index type 'T'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(148,17): error TS2339: Property 'foo' does not exist on type 'Pick'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: Property 'foo' does not exist on type 'Record'. @@ -249,7 +249,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: pt: {[P in T]?: T[P]}, // note: should be in keyof T ~ !!! error TS2322: Type 'T' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'T' is not assignable to type 'string'. +!!! error TS2322: Type 'T' is not assignable to type 'symbol'. ~~~~ !!! error TS2536: Type 'P' cannot be used to index type 'T'. }; diff --git a/tests/baselines/reference/mappedTypeErrors2.errors.txt b/tests/baselines/reference/mappedTypeErrors2.errors.txt index d48db498154..9178731d189 100644 --- a/tests/baselines/reference/mappedTypeErrors2.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors2.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(9,30): error TS2536: T tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(13,30): error TS2536: Type 'K' cannot be used to index type 'T3'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,38): error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. - Type 'AB[S]' is not assignable to type 'string'. + Type 'AB[S]' is not assignable to type 'symbol'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2536: Type 'S' cannot be used to index type 'AB'. tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: Type 'L' cannot be used to index type '{ [key in AB[S]]: true; }'. @@ -31,7 +31,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: !!! error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'. ~~~~~ !!! error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'. -!!! error TS2322: Type 'AB[S]' is not assignable to type 'string'. +!!! error TS2322: Type 'AB[S]' is not assignable to type 'symbol'. ~~~~~ !!! error TS2536: Type 'S' cannot be used to index type 'AB'. diff --git a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt index a849878087f..1bd7a693966 100644 --- a/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt +++ b/tests/baselines/reference/unionTypeWithRecursiveSubtypeReduction2.errors.txt @@ -5,7 +5,11 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(19,1): error TS2 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2322: Type 'Class' is not assignable to type 'Property'. Types of property 'parent' are incompatible. Type 'Namespace' is not assignable to type 'Module | Class'. - Property 'parent' is missing in type 'Namespace' but required in type 'Class'. + Type 'Namespace' is not assignable to type 'Module'. + Types of property 'members' are incompatible. + Type '(Class | Property)[]' is not assignable to type 'Class[]'. + Type 'Class | Property' is not assignable to type 'Class'. + Type 'Property' is not assignable to type 'Class'. ==== tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts (2 errors) ==== @@ -39,6 +43,9 @@ tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts(20,1): error TS2 !!! error TS2322: Type 'Class' is not assignable to type 'Property'. !!! error TS2322: Types of property 'parent' are incompatible. !!! error TS2322: Type 'Namespace' is not assignable to type 'Module | Class'. -!!! error TS2322: Property 'parent' is missing in type 'Namespace' but required in type 'Class'. -!!! related TS2728 tests/cases/compiler/unionTypeWithRecursiveSubtypeReduction2.ts:10:12: 'parent' is declared here. +!!! error TS2322: Type 'Namespace' is not assignable to type 'Module'. +!!! error TS2322: Types of property 'members' are incompatible. +!!! error TS2322: Type '(Class | Property)[]' is not assignable to type 'Class[]'. +!!! error TS2322: Type 'Class | Property' is not assignable to type 'Class'. +!!! error TS2322: Type 'Property' is not assignable to type 'Class'. \ No newline at end of file From d92771d61a764e884eb27b638750ae6b54dc3dae Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 30 Nov 2018 15:55:20 -0800 Subject: [PATCH 076/322] Fix crash on umd and module merge, allow umds to be accessed when merged with a non-UMD symbol --- src/compiler/checker.ts | 13 +++---- .../exportAsNamespace_augment.errors.txt | 14 +------- .../reference/umdGlobalAugmentationNoCrash.js | 27 ++++++++++++++ .../umdGlobalAugmentationNoCrash.symbols | 34 ++++++++++++++++++ .../umdGlobalAugmentationNoCrash.types | 36 +++++++++++++++++++ .../compiler/umdGlobalAugmentationNoCrash.ts | 21 +++++++++++ 6 files changed, 126 insertions(+), 19 deletions(-) create mode 100644 tests/baselines/reference/umdGlobalAugmentationNoCrash.js create mode 100644 tests/baselines/reference/umdGlobalAugmentationNoCrash.symbols create mode 100644 tests/baselines/reference/umdGlobalAugmentationNoCrash.types create mode 100644 tests/cases/compiler/umdGlobalAugmentationNoCrash.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b0c22b61341..c163014b2b5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1569,7 +1569,8 @@ namespace ts { // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & SymbolFlags.Value) === SymbolFlags.Value && !(originalLocation!.flags & NodeFlags.JSDoc)) { - if (some(result.declarations, d => isNamespaceExportDeclaration(d) || isSourceFile(d) && !!d.symbol.globalExports)) { + const merged = getMergedSymbol(result); + if (length(merged.declarations) && every(merged.declarations, d => isNamespaceExportDeclaration(d) || isSourceFile(d) && !!d.symbol.globalExports)) { error(errorLocation!, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, unescapeLeadingUnderscores(name)); // TODO: GH#18217 } } @@ -5322,12 +5323,11 @@ namespace ts { return anyType; } // Handle export default expressions - if (isSourceFile(declaration)) { - const jsonSourceFile = cast(declaration, isJsonSourceFile); - if (!jsonSourceFile.statements.length) { + if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { + if (!declaration.statements.length) { return emptyObjectType; } - const type = getWidenedLiteralType(checkExpression(jsonSourceFile.statements[0].expression)); + const type = getWidenedLiteralType(checkExpression(declaration.statements[0].expression)); if (type.flags & TypeFlags.Object) { return getRegularTypeOfObjectLiteral(type); } @@ -5352,7 +5352,8 @@ namespace ts { || isClassDeclaration(declaration) || isFunctionDeclaration(declaration) || (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration)) - || isMethodSignature(declaration)) { + || isMethodSignature(declaration) + || isSourceFile(declaration)) { // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { return getTypeOfFuncClassEnumModule(symbol); diff --git a/tests/baselines/reference/exportAsNamespace_augment.errors.txt b/tests/baselines/reference/exportAsNamespace_augment.errors.txt index ba1b4d80c6d..5e60df3bbb1 100644 --- a/tests/baselines/reference/exportAsNamespace_augment.errors.txt +++ b/tests/baselines/reference/exportAsNamespace_augment.errors.txt @@ -1,10 +1,6 @@ /a.d.ts(3,14): error TS2451: Cannot redeclare block-scoped variable 'conflict'. /b.ts(6,22): error TS2451: Cannot redeclare block-scoped variable 'conflict'. /b.ts(12,18): error TS2451: Cannot redeclare block-scoped variable 'conflict'. -/b.ts(15,1): error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. -/b.ts(15,7): error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. -/b.ts(15,13): error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. -/b.ts(15,19): error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. ==== /a.d.ts (1 errors) ==== @@ -16,7 +12,7 @@ !!! related TS6203 /b.ts:6:22: 'conflict' was also declared here. !!! related TS6204 /b.ts:12:18: and here. -==== /b.ts (6 errors) ==== +==== /b.ts (2 errors) ==== import * as a2 from "./a"; declare global { @@ -38,13 +34,5 @@ } a.x + a.y + a.z + a.conflict; - ~ -!!! error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. - ~ -!!! error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. - ~ -!!! error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. - ~ -!!! error TS2686: 'a' refers to a UMD global, but the current file is a module. Consider adding an import instead. a2.x + a2.y + a2.z + a2.conflict; \ No newline at end of file diff --git a/tests/baselines/reference/umdGlobalAugmentationNoCrash.js b/tests/baselines/reference/umdGlobalAugmentationNoCrash.js new file mode 100644 index 00000000000..23c2344a33a --- /dev/null +++ b/tests/baselines/reference/umdGlobalAugmentationNoCrash.js @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/umdGlobalAugmentationNoCrash.ts] //// + +//// [global.d.ts] +declare global { + const React: typeof import("./module"); +} +export {}; + +//// [module.d.ts] +export as namespace React; +export function foo(): string; + +//// [some_module.ts] +export {} +React.foo; + +//// [emits.ts] +console.log("hello"); +React.foo; + + +//// [some_module.js] +React.foo; +//// [emits.js] +"use strict"; +console.log("hello"); +React.foo; diff --git a/tests/baselines/reference/umdGlobalAugmentationNoCrash.symbols b/tests/baselines/reference/umdGlobalAugmentationNoCrash.symbols new file mode 100644 index 00000000000..ac3f57f2d58 --- /dev/null +++ b/tests/baselines/reference/umdGlobalAugmentationNoCrash.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/global.d.ts === +declare global { +>global : Symbol(global, Decl(global.d.ts, 0, 0)) + + const React: typeof import("./module"); +>React : Symbol("tests/cases/compiler/module", Decl(module.d.ts, 0, 0), Decl(global.d.ts, 1, 9)) +} +export {}; + +=== tests/cases/compiler/module.d.ts === +export as namespace React; +>React : Symbol(React, Decl(module.d.ts, 0, 0)) + +export function foo(): string; +>foo : Symbol(foo, Decl(module.d.ts, 0, 26)) + +=== tests/cases/compiler/some_module.ts === +export {} +React.foo; +>React.foo : Symbol(foo, Decl(module.d.ts, 0, 26)) +>React : Symbol("tests/cases/compiler/module", Decl(module.d.ts, 0, 0), Decl(global.d.ts, 1, 9)) +>foo : Symbol(foo, Decl(module.d.ts, 0, 26)) + +=== tests/cases/compiler/emits.ts === +console.log("hello"); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) + +React.foo; +>React.foo : Symbol(foo, Decl(module.d.ts, 0, 26)) +>React : Symbol("tests/cases/compiler/module", Decl(module.d.ts, 0, 0), Decl(global.d.ts, 1, 9)) +>foo : Symbol(foo, Decl(module.d.ts, 0, 26)) + diff --git a/tests/baselines/reference/umdGlobalAugmentationNoCrash.types b/tests/baselines/reference/umdGlobalAugmentationNoCrash.types new file mode 100644 index 00000000000..92643f47586 --- /dev/null +++ b/tests/baselines/reference/umdGlobalAugmentationNoCrash.types @@ -0,0 +1,36 @@ +=== tests/cases/compiler/global.d.ts === +declare global { +>global : typeof global + + const React: typeof import("./module"); +>React : typeof import("tests/cases/compiler/module") +} +export {}; + +=== tests/cases/compiler/module.d.ts === +export as namespace React; +>React : typeof import("tests/cases/compiler/module") + +export function foo(): string; +>foo : () => string + +=== tests/cases/compiler/some_module.ts === +export {} +React.foo; +>React.foo : () => string +>React : typeof import("tests/cases/compiler/module") +>foo : () => string + +=== tests/cases/compiler/emits.ts === +console.log("hello"); +>console.log("hello") : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>"hello" : "hello" + +React.foo; +>React.foo : () => string +>React : typeof import("tests/cases/compiler/module") +>foo : () => string + diff --git a/tests/cases/compiler/umdGlobalAugmentationNoCrash.ts b/tests/cases/compiler/umdGlobalAugmentationNoCrash.ts new file mode 100644 index 00000000000..ce0e0aae00e --- /dev/null +++ b/tests/cases/compiler/umdGlobalAugmentationNoCrash.ts @@ -0,0 +1,21 @@ +// @strict: true +// @module: esnext +// @moduleResolution: node +// @target: es2018 +// @filename: global.d.ts +declare global { + const React: typeof import("./module"); +} +export {}; + +// @filename: module.d.ts +export as namespace React; +export function foo(): string; + +// @filename: some_module.ts +export {} +React.foo; + +// @filename: emits.ts +console.log("hello"); +React.foo; From fa8df0d32ca90643ad824a0fc4b1249552d0dd81 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 30 Nov 2018 16:25:07 -0800 Subject: [PATCH 077/322] Add missing case to declaration diagnostic handler --- .../transformers/declarations/diagnostics.ts | 1 + ...LambdaWithMissingTypeParameterNoCrash.errors.txt | 13 +++++++++++++ ...tionEmitLambdaWithMissingTypeParameterNoCrash.js | 9 +++++++++ ...mitLambdaWithMissingTypeParameterNoCrash.symbols | 11 +++++++++++ ...nEmitLambdaWithMissingTypeParameterNoCrash.types | 7 +++++++ ...tionEmitLambdaWithMissingTypeParameterNoCrash.ts | 4 ++++ 6 files changed, 45 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt create mode 100644 tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js create mode 100644 tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols create mode 100644 tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types create mode 100644 tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts diff --git a/src/compiler/transformers/declarations/diagnostics.ts b/src/compiler/transformers/declarations/diagnostics.ts index 94d6994f8d2..f07c76e6c73 100644 --- a/src/compiler/transformers/declarations/diagnostics.ts +++ b/src/compiler/transformers/declarations/diagnostics.ts @@ -410,6 +410,7 @@ namespace ts { } break; + case SyntaxKind.FunctionType: case SyntaxKind.FunctionDeclaration: diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt new file mode 100644 index 00000000000..9d626f960b4 --- /dev/null +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt @@ -0,0 +1,13 @@ +tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(2,27): error TS2304: Cannot find name 'T2'. +tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(2,27): error TS4016: Type parameter 'T1' of exported function has or is using private name 'T2'. + + +==== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts (2 errors) ==== + export interface Foo { + preFetch: (c: T1) => void; // Type T2 is not defined + ~~ +!!! error TS2304: Cannot find name 'T2'. + ~~ +!!! error TS4016: Type parameter 'T1' of exported function has or is using private name 'T2'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js new file mode 100644 index 00000000000..b580f5a8968 --- /dev/null +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js @@ -0,0 +1,9 @@ +//// [declarationEmitLambdaWithMissingTypeParameterNoCrash.ts] +export interface Foo { + preFetch: (c: T1) => void; // Type T2 is not defined +} + + +//// [declarationEmitLambdaWithMissingTypeParameterNoCrash.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols new file mode 100644 index 00000000000..44f9fdc6bc0 --- /dev/null +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts === +export interface Foo { +>Foo : Symbol(Foo, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 0, 0)) + + preFetch: (c: T1) => void; // Type T2 is not defined +>preFetch : Symbol(Foo.preFetch, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 0, 22)) +>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15)) +>c : Symbol(c, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 31)) +>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15)) +} + diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types new file mode 100644 index 00000000000..56f32fc5a13 --- /dev/null +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts === +export interface Foo { + preFetch: (c: T1) => void; // Type T2 is not defined +>preFetch : (c: T1) => void +>c : T1 +} + diff --git a/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts b/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts new file mode 100644 index 00000000000..d2a7112ceb8 --- /dev/null +++ b/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts @@ -0,0 +1,4 @@ +// @declaration: true +export interface Foo { + preFetch: (c: T1) => void; // Type T2 is not defined +} From d25baf1c9771a0693bb86aafa130030b8b4e9862 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 30 Nov 2018 16:28:10 -0800 Subject: [PATCH 078/322] Handle destructuring in control flow reference matching --- src/compiler/checker.ts | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b0c22b61341..372a1ac5f2c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14615,15 +14615,15 @@ namespace ts { getAccessedPropertyName(source as PropertyAccessExpression | ElementAccessExpression) === getAccessedPropertyName(target) && isMatchingReference((source as PropertyAccessExpression | ElementAccessExpression).expression, target.expression); case SyntaxKind.BindingElement: - if (target.kind !== SyntaxKind.PropertyAccessExpression) return false; - const t = target as PropertyAccessExpression; - if (t.name.escapedText !== getBindingElementNameText(source as BindingElement)) return false; - if (source.parent.parent.kind === SyntaxKind.BindingElement && isMatchingReference(source.parent.parent, t.expression)) { - return true; - } - if (source.parent.parent.kind === SyntaxKind.VariableDeclaration) { - const maybeId = (source.parent.parent as VariableDeclaration).initializer; - return !!maybeId && isMatchingReference(maybeId, t.expression); + if (target.kind === SyntaxKind.PropertyAccessExpression && (target).name.escapedText === getBindingElementNameText(source)) { + const ancestor = source.parent.parent; + if (ancestor.kind === SyntaxKind.BindingElement) { + return isMatchingReference(ancestor, (target).expression); + } + if (ancestor.kind === SyntaxKind.VariableDeclaration) { + const initializer = (ancestor).initializer; + return !!initializer && isMatchingReference(initializer, (target).expression); + } } } return false; @@ -14635,14 +14635,25 @@ namespace ts { undefined; } + function getReferenceParent(source: Node) { + if (source.kind === SyntaxKind.PropertyAccessExpression) { + return (source).expression; + } + if (source.kind === SyntaxKind.BindingElement) { + const ancestor = source.parent.parent; + return ancestor.kind === SyntaxKind.VariableDeclaration ? (ancestor).initializer : ancestor; + } + return undefined; + } + function containsMatchingReference(source: Node, target: Node) { - while (source.kind === SyntaxKind.PropertyAccessExpression) { - source = (source).expression; - if (isMatchingReference(source, target)) { + let parent = getReferenceParent(source); + while (parent) { + if (isMatchingReference(parent, target)) { return true; } + parent = getReferenceParent(parent); } - return false; } // Return true if target is a property access xxx.yyy, source is a property access xxx.zzz, the declared From 290eff9722a2f8a0f267c30a3b3e78a16489b985 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 30 Nov 2018 16:28:21 -0800 Subject: [PATCH 079/322] Add regression test --- .../compiler/controlFlowDestructuringLoop.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cases/compiler/controlFlowDestructuringLoop.ts diff --git a/tests/cases/compiler/controlFlowDestructuringLoop.ts b/tests/cases/compiler/controlFlowDestructuringLoop.ts new file mode 100644 index 00000000000..bf3a68cb2d8 --- /dev/null +++ b/tests/cases/compiler/controlFlowDestructuringLoop.ts @@ -0,0 +1,24 @@ +// @strict: true + +// Repro from #28758 + +interface NumVal { val: number; } +interface StrVal { val: string; } +type Val = NumVal | StrVal; + +function isNumVal(x: Val): x is NumVal { + return typeof x.val === 'number'; +} + +function foo(things: Val[]): void { + for (const thing of things) { + if (isNumVal(thing)) { + const { val } = thing; + val.toFixed(2); + } + else { + const { val } = thing; + val.length; + } + } +} \ No newline at end of file From e96824377bf7b1a7b6012567d2ba900aa799f6fb Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 30 Nov 2018 16:28:29 -0800 Subject: [PATCH 080/322] Accept new baselines --- .../reference/controlFlowDestructuringLoop.js | 43 +++++++++++++ .../controlFlowDestructuringLoop.symbols | 63 +++++++++++++++++++ .../controlFlowDestructuringLoop.types | 61 ++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 tests/baselines/reference/controlFlowDestructuringLoop.js create mode 100644 tests/baselines/reference/controlFlowDestructuringLoop.symbols create mode 100644 tests/baselines/reference/controlFlowDestructuringLoop.types diff --git a/tests/baselines/reference/controlFlowDestructuringLoop.js b/tests/baselines/reference/controlFlowDestructuringLoop.js new file mode 100644 index 00000000000..d7ff51b8259 --- /dev/null +++ b/tests/baselines/reference/controlFlowDestructuringLoop.js @@ -0,0 +1,43 @@ +//// [controlFlowDestructuringLoop.ts] +// Repro from #28758 + +interface NumVal { val: number; } +interface StrVal { val: string; } +type Val = NumVal | StrVal; + +function isNumVal(x: Val): x is NumVal { + return typeof x.val === 'number'; +} + +function foo(things: Val[]): void { + for (const thing of things) { + if (isNumVal(thing)) { + const { val } = thing; + val.toFixed(2); + } + else { + const { val } = thing; + val.length; + } + } +} + +//// [controlFlowDestructuringLoop.js] +"use strict"; +// Repro from #28758 +function isNumVal(x) { + return typeof x.val === 'number'; +} +function foo(things) { + for (var _i = 0, things_1 = things; _i < things_1.length; _i++) { + var thing = things_1[_i]; + if (isNumVal(thing)) { + var val = thing.val; + val.toFixed(2); + } + else { + var val = thing.val; + val.length; + } + } +} diff --git a/tests/baselines/reference/controlFlowDestructuringLoop.symbols b/tests/baselines/reference/controlFlowDestructuringLoop.symbols new file mode 100644 index 00000000000..46b7ecd5842 --- /dev/null +++ b/tests/baselines/reference/controlFlowDestructuringLoop.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/controlFlowDestructuringLoop.ts === +// Repro from #28758 + +interface NumVal { val: number; } +>NumVal : Symbol(NumVal, Decl(controlFlowDestructuringLoop.ts, 0, 0)) +>val : Symbol(NumVal.val, Decl(controlFlowDestructuringLoop.ts, 2, 18)) + +interface StrVal { val: string; } +>StrVal : Symbol(StrVal, Decl(controlFlowDestructuringLoop.ts, 2, 33)) +>val : Symbol(StrVal.val, Decl(controlFlowDestructuringLoop.ts, 3, 18)) + +type Val = NumVal | StrVal; +>Val : Symbol(Val, Decl(controlFlowDestructuringLoop.ts, 3, 33)) +>NumVal : Symbol(NumVal, Decl(controlFlowDestructuringLoop.ts, 0, 0)) +>StrVal : Symbol(StrVal, Decl(controlFlowDestructuringLoop.ts, 2, 33)) + +function isNumVal(x: Val): x is NumVal { +>isNumVal : Symbol(isNumVal, Decl(controlFlowDestructuringLoop.ts, 4, 27)) +>x : Symbol(x, Decl(controlFlowDestructuringLoop.ts, 6, 18)) +>Val : Symbol(Val, Decl(controlFlowDestructuringLoop.ts, 3, 33)) +>x : Symbol(x, Decl(controlFlowDestructuringLoop.ts, 6, 18)) +>NumVal : Symbol(NumVal, Decl(controlFlowDestructuringLoop.ts, 0, 0)) + + return typeof x.val === 'number'; +>x.val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 2, 18), Decl(controlFlowDestructuringLoop.ts, 3, 18)) +>x : Symbol(x, Decl(controlFlowDestructuringLoop.ts, 6, 18)) +>val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 2, 18), Decl(controlFlowDestructuringLoop.ts, 3, 18)) +} + +function foo(things: Val[]): void { +>foo : Symbol(foo, Decl(controlFlowDestructuringLoop.ts, 8, 1)) +>things : Symbol(things, Decl(controlFlowDestructuringLoop.ts, 10, 13)) +>Val : Symbol(Val, Decl(controlFlowDestructuringLoop.ts, 3, 33)) + + for (const thing of things) { +>thing : Symbol(thing, Decl(controlFlowDestructuringLoop.ts, 11, 14)) +>things : Symbol(things, Decl(controlFlowDestructuringLoop.ts, 10, 13)) + + if (isNumVal(thing)) { +>isNumVal : Symbol(isNumVal, Decl(controlFlowDestructuringLoop.ts, 4, 27)) +>thing : Symbol(thing, Decl(controlFlowDestructuringLoop.ts, 11, 14)) + + const { val } = thing; +>val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 13, 19)) +>thing : Symbol(thing, Decl(controlFlowDestructuringLoop.ts, 11, 14)) + + val.toFixed(2); +>val.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) +>val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 13, 19)) +>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) + } + else { + const { val } = thing; +>val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 17, 19)) +>thing : Symbol(thing, Decl(controlFlowDestructuringLoop.ts, 11, 14)) + + val.length; +>val.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>val : Symbol(val, Decl(controlFlowDestructuringLoop.ts, 17, 19)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) + } + } +} diff --git a/tests/baselines/reference/controlFlowDestructuringLoop.types b/tests/baselines/reference/controlFlowDestructuringLoop.types new file mode 100644 index 00000000000..a4735399f9e --- /dev/null +++ b/tests/baselines/reference/controlFlowDestructuringLoop.types @@ -0,0 +1,61 @@ +=== tests/cases/compiler/controlFlowDestructuringLoop.ts === +// Repro from #28758 + +interface NumVal { val: number; } +>val : number + +interface StrVal { val: string; } +>val : string + +type Val = NumVal | StrVal; +>Val : Val + +function isNumVal(x: Val): x is NumVal { +>isNumVal : (x: Val) => x is NumVal +>x : Val + + return typeof x.val === 'number'; +>typeof x.val === 'number' : boolean +>typeof x.val : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" +>x.val : string | number +>x : Val +>val : string | number +>'number' : "number" +} + +function foo(things: Val[]): void { +>foo : (things: Val[]) => void +>things : Val[] + + for (const thing of things) { +>thing : Val +>things : Val[] + + if (isNumVal(thing)) { +>isNumVal(thing) : boolean +>isNumVal : (x: Val) => x is NumVal +>thing : Val + + const { val } = thing; +>val : number +>thing : NumVal + + val.toFixed(2); +>val.toFixed(2) : string +>val.toFixed : (fractionDigits?: number | undefined) => string +>val : number +>toFixed : (fractionDigits?: number | undefined) => string +>2 : 2 + } + else { + const { val } = thing; +>val : string +>thing : StrVal + + val.length; +>val.length : number +>val : string +>length : number + } + } +} From 6d2c0037fcf4b88c66e8d0f40be3b25c180b7fd3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 16:42:14 -0800 Subject: [PATCH 081/322] Only count singleton unit types. --- src/compiler/checker.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8f1faaa368b..da22fecfb8d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11976,22 +11976,20 @@ namespace ts { bestMatch = target; matchingCount = Infinity; } - else if (isLiteralType(overlap)) { + else if (overlap.flags & TypeFlags.Union) { // We only want to account for literal types otherwise. // If we have a union of index types, it seems likely that we // needed to elaborate between two generic mapped types anyway. - if (overlap.flags & TypeFlags.Union) { - const len = length(filter((overlap as UnionType).types, isUnitType)); - if (len >= matchingCount) { - bestMatch = target; - matchingCount = len; - } - } - else if (1 >= matchingCount) { + const len = length(filter((overlap as UnionType).types, isUnitType)); + if (len >= matchingCount) { bestMatch = target; - matchingCount = 1; + matchingCount = len; } } + else if (isUnitType(overlap) && 1 >= matchingCount) { + bestMatch = target; + matchingCount = 1; + } } return bestMatch; } From 8e98943cbd53e38ccac2f80c7c4c8d4a924ab251 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 30 Nov 2018 16:42:30 -0800 Subject: [PATCH 082/322] Accepted baselines. --- .../checkJsxChildrenProperty2.errors.txt | 16 ++++++++-------- .../reference/iteratorSpreadInArray6.errors.txt | 12 ++++++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt index 0edadf6dc1b..e2931b3fb5d 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt @@ -3,19 +3,19 @@ tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specif tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. - Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props + Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(number | Element)[]' is not assignable to type 'string | Element'. - Type '(number | Element)[]' is missing the following properties from type 'Element': type, props + Type '(number | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(string | Element)[]' is not assignable to type 'string | Element'. - Type '(string | Element)[]' is missing the following properties from type 'Element': type, props + Type '(string | Element)[]' is not assignable to type 'string'. tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'string | Element'. - Type 'Element[]' is missing the following properties from type 'Element': type, props + Type 'Element[]' is not assignable to type 'string'. ==== tests/cases/conformance/jsx/file.tsx (6 errors) ==== @@ -59,7 +59,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string'.
My Div
{(name: string) =>
My name {name}
} ; @@ -70,7 +70,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(number | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string'.
My Div
{1000000} ; @@ -81,7 +81,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type '(string | Element)[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string'.
My Div
hi hi hi! ; @@ -92,7 +92,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'. -!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props +!!! error TS2322: Type 'Element[]' is not assignable to type 'string'.
My Div
My Div
; \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt index b151757c98f..4f547c59ed0 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray6.errors.txt @@ -1,5 +1,9 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'number'. + Type 'symbol[]' is not assignable to type 'ConcatArray'. + Types of property 'slice' are incompatible. + Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. + Type 'symbol[]' is not assignable to type 'number[]'. + Type 'symbol' is not assignable to type 'number'. ==== tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts (1 errors) ==== @@ -20,4 +24,8 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray6.ts(15,14): error TS234 array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. -!!! error TS2345: Type 'symbol[]' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2345: Type 'symbol[]' is not assignable to type 'ConcatArray'. +!!! error TS2345: Types of property 'slice' are incompatible. +!!! error TS2345: Type '(start?: number, end?: number) => symbol[]' is not assignable to type '(start?: number, end?: number) => number[]'. +!!! error TS2345: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2345: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file From cd6fdb11d6d1c372d8230cbee987d7e03f703ed7 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 30 Nov 2018 17:44:25 -0800 Subject: [PATCH 083/322] Add constructor case --- src/compiler/transformers/declarations/diagnostics.ts | 1 + ...nEmitLambdaWithMissingTypeParameterNoCrash.errors.txt | 9 ++++++++- ...clarationEmitLambdaWithMissingTypeParameterNoCrash.js | 1 + ...tionEmitLambdaWithMissingTypeParameterNoCrash.symbols | 6 ++++++ ...rationEmitLambdaWithMissingTypeParameterNoCrash.types | 4 ++++ ...clarationEmitLambdaWithMissingTypeParameterNoCrash.ts | 1 + 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/compiler/transformers/declarations/diagnostics.ts b/src/compiler/transformers/declarations/diagnostics.ts index f07c76e6c73..b4c72c79012 100644 --- a/src/compiler/transformers/declarations/diagnostics.ts +++ b/src/compiler/transformers/declarations/diagnostics.ts @@ -389,6 +389,7 @@ namespace ts { diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; + case SyntaxKind.ConstructorType: case SyntaxKind.ConstructSignature: diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt index 9d626f960b4..02718216afc 100644 --- a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.errors.txt @@ -1,13 +1,20 @@ tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(2,27): error TS2304: Cannot find name 'T2'. tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(2,27): error TS4016: Type parameter 'T1' of exported function has or is using private name 'T2'. +tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(3,33): error TS2304: Cannot find name 'T2'. +tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts(3,33): error TS4006: Type parameter 'T1' of constructor signature from exported interface has or is using private name 'T2'. -==== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts (2 errors) ==== +==== tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts (4 errors) ==== export interface Foo { preFetch: (c: T1) => void; // Type T2 is not defined ~~ !!! error TS2304: Cannot find name 'T2'. ~~ !!! error TS4016: Type parameter 'T1' of exported function has or is using private name 'T2'. + preFetcher: new (c: T1) => void; // Type T2 is not defined + ~~ +!!! error TS2304: Cannot find name 'T2'. + ~~ +!!! error TS4006: Type parameter 'T1' of constructor signature from exported interface has or is using private name 'T2'. } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js index b580f5a8968..36d9b9f7ae3 100644 --- a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.js @@ -1,6 +1,7 @@ //// [declarationEmitLambdaWithMissingTypeParameterNoCrash.ts] export interface Foo { preFetch: (c: T1) => void; // Type T2 is not defined + preFetcher: new (c: T1) => void; // Type T2 is not defined } diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols index 44f9fdc6bc0..c7908a593c1 100644 --- a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.symbols @@ -7,5 +7,11 @@ export interface Foo { >T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15)) >c : Symbol(c, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 31)) >T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 15)) + + preFetcher: new (c: T1) => void; // Type T2 is not defined +>preFetcher : Symbol(Foo.preFetcher, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 1, 46)) +>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 21)) +>c : Symbol(c, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 37)) +>T1 : Symbol(T1, Decl(declarationEmitLambdaWithMissingTypeParameterNoCrash.ts, 2, 21)) } diff --git a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types index 56f32fc5a13..5f132c3dfe8 100644 --- a/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types +++ b/tests/baselines/reference/declarationEmitLambdaWithMissingTypeParameterNoCrash.types @@ -2,6 +2,10 @@ export interface Foo { preFetch: (c: T1) => void; // Type T2 is not defined >preFetch : (c: T1) => void +>c : T1 + + preFetcher: new (c: T1) => void; // Type T2 is not defined +>preFetcher : new (c: T1) => void >c : T1 } diff --git a/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts b/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts index d2a7112ceb8..1c5b9890db6 100644 --- a/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts +++ b/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts @@ -1,4 +1,5 @@ // @declaration: true export interface Foo { preFetch: (c: T1) => void; // Type T2 is not defined + preFetcher: new (c: T1) => void; // Type T2 is not defined } From 0a6380c6df5c7a7686784dfb19c053dc21470963 Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 00:32:33 +0800 Subject: [PATCH 084/322] Move await keyword to inside function --- src/services/completions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index c127f0c3a7b..d20ed537177 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1921,7 +1921,7 @@ namespace ts.Completions { case KeywordCompletionFilters.None: return false; case KeywordCompletionFilters.All: - return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword + return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword || isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword; case KeywordCompletionFilters.ClassElementKeywords: return isClassMemberCompletionKeyword(kind); @@ -1957,7 +1957,7 @@ namespace ts.Completions { } function isFunctionLikeBodyKeyword(kind: SyntaxKind) { - return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node: Node): SyntaxKind { From 47302147abed1381f87f8053d7c4cd58c9ca0c67 Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 01:19:51 +0800 Subject: [PATCH 085/322] Move await keyword to inside of function and test --- tests/cases/fourslash/completionInFunctionLikeBody.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/fourslash/completionInFunctionLikeBody.ts b/tests/cases/fourslash/completionInFunctionLikeBody.ts index 95407b8f018..8c163ccb3b0 100644 --- a/tests/cases/fourslash/completionInFunctionLikeBody.ts +++ b/tests/cases/fourslash/completionInFunctionLikeBody.ts @@ -16,7 +16,7 @@ verify.completions( { marker: ["1", "2"], - includes: "async", + includes: ["async", "await"], excludes: ["public", "private", "protected", "constructor", "readonly", "static", "abstract", "get", "set"], }, { marker: ["3", "4"], exact: completion.classElementKeywords, isNewIdentifierLocation: true }, From 8eefaf48f547642f9dc5cec948fd4824bdd184f1 Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 01:50:02 +0800 Subject: [PATCH 086/322] Move await keyword to inside of function (Recovery & try test) --- src/services/completions.ts | 4 ++-- tests/cases/fourslash/completionInFunctionLikeBody.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index d20ed537177..c127f0c3a7b 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1921,7 +1921,7 @@ namespace ts.Completions { case KeywordCompletionFilters.None: return false; case KeywordCompletionFilters.All: - return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword + return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword || isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword; case KeywordCompletionFilters.ClassElementKeywords: return isClassMemberCompletionKeyword(kind); @@ -1957,7 +1957,7 @@ namespace ts.Completions { } function isFunctionLikeBodyKeyword(kind: SyntaxKind) { - return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node: Node): SyntaxKind { diff --git a/tests/cases/fourslash/completionInFunctionLikeBody.ts b/tests/cases/fourslash/completionInFunctionLikeBody.ts index 8c163ccb3b0..95407b8f018 100644 --- a/tests/cases/fourslash/completionInFunctionLikeBody.ts +++ b/tests/cases/fourslash/completionInFunctionLikeBody.ts @@ -16,7 +16,7 @@ verify.completions( { marker: ["1", "2"], - includes: ["async", "await"], + includes: "async", excludes: ["public", "private", "protected", "constructor", "readonly", "static", "abstract", "get", "set"], }, { marker: ["3", "4"], exact: completion.classElementKeywords, isNewIdentifierLocation: true }, From f2d297fd1fa4fa53e66cd48c3b0d5c709063ffd5 Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 02:40:43 +0800 Subject: [PATCH 087/322] Move await keyword to inside of function and test --- src/harness/fourslash.ts | 1 + src/services/completions.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 34fedccc19c..29fc1b5765b 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -4775,6 +4775,7 @@ namespace FourSlashInterface { "package", "yield", "async", + "await", ].map(keywordEntry); // TODO: many of these are inappropriate to always provide diff --git a/src/services/completions.ts b/src/services/completions.ts index c127f0c3a7b..93bea69f165 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1957,7 +1957,7 @@ namespace ts.Completions { } function isFunctionLikeBodyKeyword(kind: SyntaxKind) { - return kind === SyntaxKind.AsyncKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node: Node): SyntaxKind { From a2851d2ddc6e61c9c6f106816ab36d655ce1676f Mon Sep 17 00:00:00 2001 From: "dreamran43@gmail.com" Date: Tue, 4 Dec 2018 03:01:56 +0800 Subject: [PATCH 088/322] Move await keyword to inside of function and test --- src/harness/fourslash.ts | 1 + src/services/completions.ts | 2 +- tests/cases/fourslash/completionInFunctionLikeBody.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 29fc1b5765b..b79a154c555 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -4908,6 +4908,7 @@ namespace FourSlashInterface { "package", "yield", "async", + "await", ].map(keywordEntry); export const globalKeywordsPlusUndefined: ReadonlyArray = (() => { diff --git a/src/services/completions.ts b/src/services/completions.ts index 93bea69f165..43f00c58acf 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1957,7 +1957,7 @@ namespace ts.Completions { } function isFunctionLikeBodyKeyword(kind: SyntaxKind) { - return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node: Node): SyntaxKind { diff --git a/tests/cases/fourslash/completionInFunctionLikeBody.ts b/tests/cases/fourslash/completionInFunctionLikeBody.ts index 95407b8f018..8c163ccb3b0 100644 --- a/tests/cases/fourslash/completionInFunctionLikeBody.ts +++ b/tests/cases/fourslash/completionInFunctionLikeBody.ts @@ -16,7 +16,7 @@ verify.completions( { marker: ["1", "2"], - includes: "async", + includes: ["async", "await"], excludes: ["public", "private", "protected", "constructor", "readonly", "static", "abstract", "get", "set"], }, { marker: ["3", "4"], exact: completion.classElementKeywords, isNewIdentifierLocation: true }, From 594430f113f16a7d144ae8cc9fdc3789add01b5a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 4 Dec 2018 09:03:08 -0800 Subject: [PATCH 089/322] Infer from arrows from usage. (#28832) * Infer from arrows from usage. Previously only function expressions were, and only those with an easily accessible name. Now any arrow function or function expression will infer from usage. * remove isApplicableFunctionForInference *all* functions are applicable for inference now. --- src/services/codefixes/inferFromUsage.ts | 24 ++++++------------- .../fourslash/annotateWithTypeFromJSDoc11.ts | 1 + .../fourslash/annotateWithTypeFromJSDoc16.ts | 2 +- .../fourslash/annotateWithTypeFromJSDoc9.5.ts | 1 + .../fourslash/annotateWithTypeFromJSDoc9.ts | 1 + .../codeFixAwaitInSyncFunction6.5.ts | 1 + .../fourslash/codeFixAwaitInSyncFunction6.ts | 1 + ...aceComputedPropertyNameWellKnownSymbols.ts | 1 + .../fourslash/codeFixInferFromUsageArrow.ts | 15 ++++++++++++ 9 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 tests/cases/fourslash/codeFixInferFromUsageArrow.ts diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index 9cf5133d982..8e5b962116d 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -187,24 +187,10 @@ namespace ts.codefix { } } - function isApplicableFunctionForInference(declaration: FunctionLike): declaration is MethodDeclaration | FunctionDeclaration | ConstructorDeclaration { - switch (declaration.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.Constructor: - return true; - case SyntaxKind.FunctionExpression: - const parent = declaration.parent; - return isVariableDeclaration(parent) && isIdentifier(parent.name) || !!declaration.name; - } - return false; - } - function annotateParameters(changes: textChanges.ChangeTracker, sourceFile: SourceFile, parameterDeclaration: ParameterDeclaration, containingFunction: FunctionLike, program: Program, host: LanguageServiceHost, cancellationToken: CancellationToken): void { - if (!isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { + if (!isIdentifier(parameterDeclaration.name)) { return; } - const parameterInferences = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || containingFunction.parameters.map(p => ({ declaration: p, @@ -216,11 +202,14 @@ namespace ts.codefix { annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host); } else { + const needParens = isArrowFunction(containingFunction) && !findChildOfKind(containingFunction, SyntaxKind.OpenParenToken, sourceFile); + if (needParens) changes.insertNodeBefore(sourceFile, first(containingFunction.parameters), createToken(SyntaxKind.OpenParenToken)); for (const { declaration, type } of parameterInferences) { if (declaration && !declaration.type && !declaration.initializer) { annotate(changes, sourceFile, declaration, type, program, host); } } + if (needParens) changes.insertNodeAfter(sourceFile, last(containingFunction.parameters), createToken(SyntaxKind.CloseParenToken)); } } @@ -342,12 +331,13 @@ namespace ts.codefix { return InferFromReference.unifyFromContext(types, checker); } - function inferTypeForParametersFromUsage(containingFunction: FunctionLikeDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): ParameterInference[] | undefined { + function inferTypeForParametersFromUsage(containingFunction: FunctionLike, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): ParameterInference[] | undefined { let searchToken; switch (containingFunction.kind) { case SyntaxKind.Constructor: searchToken = findChildOfKind>(containingFunction, SyntaxKind.ConstructorKeyword, sourceFile); break; + case SyntaxKind.ArrowFunction: case SyntaxKind.FunctionExpression: const parent = containingFunction.parent; searchToken = isVariableDeclaration(parent) && isIdentifier(parent.name) ? @@ -399,7 +389,7 @@ namespace ts.codefix { return inferFromContext(usageContext, checker); } - export function inferTypeForParametersFromReferences(references: ReadonlyArray, declaration: FunctionLikeDeclaration, program: Program, cancellationToken: CancellationToken): ParameterInference[] | undefined { + export function inferTypeForParametersFromReferences(references: ReadonlyArray, declaration: FunctionLike, program: Program, cancellationToken: CancellationToken): ParameterInference[] | undefined { const checker = program.getTypeChecker(); if (references.length === 0) { return undefined; diff --git a/tests/cases/fourslash/annotateWithTypeFromJSDoc11.ts b/tests/cases/fourslash/annotateWithTypeFromJSDoc11.ts index 2bd1df5c6e6..a08906ef91a 100644 --- a/tests/cases/fourslash/annotateWithTypeFromJSDoc11.ts +++ b/tests/cases/fourslash/annotateWithTypeFromJSDoc11.ts @@ -7,6 +7,7 @@ ////var f = (x) => x verify.codeFix({ + index: 0, description: "Annotate with type from JSDoc", newFileContent: `/** diff --git a/tests/cases/fourslash/annotateWithTypeFromJSDoc16.ts b/tests/cases/fourslash/annotateWithTypeFromJSDoc16.ts index 6eb079f9692..eee556aafbd 100644 --- a/tests/cases/fourslash/annotateWithTypeFromJSDoc16.ts +++ b/tests/cases/fourslash/annotateWithTypeFromJSDoc16.ts @@ -4,8 +4,8 @@ ////var x = (x, ys, ...zs) => { x; ys; zs; }; verify.codeFix({ + index: 3, description: "Annotate with type from JSDoc", - index: 0, newFileContent: `/** @type {function(*, ...number, ...boolean): void} */ var x: (arg0: any, arg1: number[], ...rest: boolean[]) => void = (x, ys, ...zs) => { x; ys; zs; };`, diff --git a/tests/cases/fourslash/annotateWithTypeFromJSDoc9.5.ts b/tests/cases/fourslash/annotateWithTypeFromJSDoc9.5.ts index d0319bee614..aa17b0591c8 100644 --- a/tests/cases/fourslash/annotateWithTypeFromJSDoc9.5.ts +++ b/tests/cases/fourslash/annotateWithTypeFromJSDoc9.5.ts @@ -8,6 +8,7 @@ ////var f = /*a*/x/*b*/ => x verify.codeFix({ + index: 0, description: "Annotate with type from JSDoc", newFileContent: `/** diff --git a/tests/cases/fourslash/annotateWithTypeFromJSDoc9.ts b/tests/cases/fourslash/annotateWithTypeFromJSDoc9.ts index d1517a2c009..f664d5be6b7 100644 --- a/tests/cases/fourslash/annotateWithTypeFromJSDoc9.ts +++ b/tests/cases/fourslash/annotateWithTypeFromJSDoc9.ts @@ -7,6 +7,7 @@ ////var f = x => x verify.codeFix({ + index: 0, description: "Annotate with type from JSDoc", newFileContent: `/** diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction6.5.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction6.5.ts index c1b06811113..b33d50078ef 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction6.5.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction6.5.ts @@ -5,6 +5,7 @@ ////} verify.codeFix({ + index: 0, description: "Add async modifier to containing function", newFileContent: `const f = async promise => { diff --git a/tests/cases/fourslash/codeFixAwaitInSyncFunction6.ts b/tests/cases/fourslash/codeFixAwaitInSyncFunction6.ts index 0b0aa098164..5fc50a4f9d7 100644 --- a/tests/cases/fourslash/codeFixAwaitInSyncFunction6.ts +++ b/tests/cases/fourslash/codeFixAwaitInSyncFunction6.ts @@ -5,6 +5,7 @@ ////} verify.codeFix({ + index: 0, description: "Add async modifier to containing function", newFileContent: `const f = async (promise) => { diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts index 2bc7a738258..d87fcb73d4e 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts @@ -20,6 +20,7 @@ ////class C implements I {} verify.codeFix({ + index: 0, description: "Implement interface 'I'", newFileContent: `interface I { diff --git a/tests/cases/fourslash/codeFixInferFromUsageArrow.ts b/tests/cases/fourslash/codeFixInferFromUsageArrow.ts new file mode 100644 index 00000000000..6e8cdb2dca5 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageArrow.ts @@ -0,0 +1,15 @@ +/// +////const a = (x) => x; +////const b = x => x; +////const c = x => x + 1; +////const d = x => x; +////d(1); +verify.codeFixAll({ + fixId: "inferFromUsage", + fixAllDescription: "Infer all types from usage", + newFileContent: `const a = (x: any) => x; +const b = (x: any) => x; +const c = (x: number) => x + 1; +const d = (x: number) => x; +d(1);`, +}); From 24b39f90c92befca6b8732704dd8e360a513d469 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 4 Dec 2018 09:17:37 -0800 Subject: [PATCH 090/322] Skip implicit any suggestions with no codefix (#28822) The only unsupported one is binding patterns, which aren't supported by the codefix. The code was a lot faster to write without supporting them, but there's no real barrier besides that. --- src/compiler/checker.ts | 4 ++++ .../fourslash/codeFixInferFromUsageBindingElement.ts | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/cases/fourslash/codeFixInferFromUsageBindingElement.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e1aad0b3835..f9affcad6bc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13684,6 +13684,10 @@ namespace ts { break; case SyntaxKind.BindingElement: diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; + if (!noImplicitAny) { + // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. + return; + } break; case SyntaxKind.JSDocFunctionType: error(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); diff --git a/tests/cases/fourslash/codeFixInferFromUsageBindingElement.ts b/tests/cases/fourslash/codeFixInferFromUsageBindingElement.ts new file mode 100644 index 00000000000..e60b7efa3b9 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageBindingElement.ts @@ -0,0 +1,8 @@ +/// +////function f([car, cdr]) { +//// return car + cdr + 1 +////} + +// When inferFromUsage supports it, it should infer number for both variables +verify.getSuggestionDiagnostics([]); + From ee987a25e2f9c1c8411f531dc0edb80014f4ac3b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 4 Dec 2018 12:45:00 -0800 Subject: [PATCH 091/322] Revert over-eager bailout when trailing whitespace (#28848) --- src/services/formatting/formatting.ts | 5 +---- tests/cases/fourslash/formatAfterWhitespace.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/formatAfterWhitespace.ts diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index a5135f11783..01c09a4989c 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -1106,10 +1106,7 @@ namespace ts.formatting { * Trimming will be done for lines after the previous range */ function trimTrailingWhitespacesForRemainingRange() { - if (!previousRange) { - return; - } - const startPosition = previousRange.end; + const startPosition = previousRange ? previousRange.end : originalRange.pos; const startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line; const endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; diff --git a/tests/cases/fourslash/formatAfterWhitespace.ts b/tests/cases/fourslash/formatAfterWhitespace.ts new file mode 100644 index 00000000000..02e2c60b36e --- /dev/null +++ b/tests/cases/fourslash/formatAfterWhitespace.ts @@ -0,0 +1,14 @@ +/// +////function foo() +////{ +//// var bar; +//// /*1*/ +////} +goTo.marker('1') +edit.insertLine(""); +verify.currentFileContentIs(`function foo() +{ + var bar; + + +}`); From b032e063cd3b8b55f738e832e8b8bcd781b5e4e2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 13:06:53 -0800 Subject: [PATCH 092/322] Resolve conditional type only when check and extends types are non-generic --- src/compiler/checker.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 982da682be0..224cde1f5ea 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9784,14 +9784,11 @@ namespace ts { if (checkType === wildcardType || extendsType === wildcardType) { return wildcardType; } - // If this is a distributive conditional type and the check type is generic we need to defer - // resolution of the conditional type such that a later instantiation will properly distribute - // over union types. - const isDeferred = root.isDistributive && maybeTypeOfKind(checkType, TypeFlags.Instantiable); + const checkTypeInstantiable = maybeTypeOfKind(checkType, TypeFlags.Instantiable); let combinedMapper: TypeMapper | undefined; if (root.inferTypeParameters) { const context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, InferenceFlags.None); - if (!isDeferred) { + if (!checkTypeInstantiable) { // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. @@ -9799,16 +9796,17 @@ namespace ts { } combinedMapper = combineTypeMappers(mapper, context); } - if (!isDeferred) { - if (extendsType.flags & TypeFlags.AnyOrUnknown) { + // Instantiate the extends type including inferences for 'infer T' type parameters + const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // We attempt to resolve the conditional type only when the check and extends types are non-generic + if (!checkTypeInstantiable && !maybeTypeOfKind(inferredExtendsType, TypeFlags.Instantiable)) { + if (inferredExtendsType.flags & TypeFlags.AnyOrUnknown) { return instantiateType(root.trueType, mapper); } // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & TypeFlags.Any) { return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } - // Instantiate the extends type including inferences for 'infer T' type parameters - const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; // Return falseType for a definitely false extends check. We check an instantations of the two // types with type parameters mapped to the wildcard type, the most permissive instantiations // possible (the wildcard type is assignable to and from all types). If those are not related, From 7c727365e406203d94235f3b18cd5a87b4ff2617 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 13:10:58 -0800 Subject: [PATCH 093/322] Accept new baselines --- tests/baselines/reference/infiniteConstraints.types | 4 ++-- tests/baselines/reference/unknownType1.types | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/infiniteConstraints.types b/tests/baselines/reference/infiniteConstraints.types index e23e138c820..c7d4c07ff4b 100644 --- a/tests/baselines/reference/infiniteConstraints.types +++ b/tests/baselines/reference/infiniteConstraints.types @@ -15,7 +15,7 @@ type AProp = T >a : string declare function myBug< ->myBug : (arg: T) => T +>myBug : (arg: T) => T T extends { [K in keyof T]: T[K] extends AProp ? U : never } >(arg: T): T @@ -24,7 +24,7 @@ declare function myBug< const out = myBug({obj1: {a: "test"}}) >out : { obj1: { a: string; }; } >myBug({obj1: {a: "test"}}) : { obj1: { a: string; }; } ->myBug : (arg: T) => T +>myBug : (arg: T) => T >{obj1: {a: "test"}} : { obj1: { a: string; }; } >obj1 : { a: string; } >{a: "test"} : { a: string; } diff --git a/tests/baselines/reference/unknownType1.types b/tests/baselines/reference/unknownType1.types index aaaf73bb709..bf177d4fde8 100644 --- a/tests/baselines/reference/unknownType1.types +++ b/tests/baselines/reference/unknownType1.types @@ -76,7 +76,7 @@ type T31 = T extends unknown ? true : false; // Deferred (so it distributes) >false : false type T32 = never extends T ? true : false; // true ->T32 : true +>T32 : T32 >true : true >false : false From 3e2f130b3c4815889c346bc1c971e14071118454 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 13:18:04 -0800 Subject: [PATCH 094/322] Add regression test --- .../types/conditional/conditionalTypes2.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes2.ts b/tests/cases/conformance/types/conditional/conditionalTypes2.ts index 2fd13ceff85..4b65b5ddeb2 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes2.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes2.ts @@ -156,3 +156,37 @@ type T0 = MaybeTrue<{ b: never }> // "no" type T1 = MaybeTrue<{ b: false }>; // "no" type T2 = MaybeTrue<{ b: true }>; // "yes" type T3 = MaybeTrue<{ b: boolean }>; // "yes" + +// Repro from #28824 + +type Union = 'a' | 'b'; +type Product = { f1: A, f2: B}; +type ProductUnion = Product<'a', 0> | Product<'b', 1>; + +// {a: "b"; b: "a"} +type UnionComplement = { + [K in Union]: Exclude +}; +type UCA = UnionComplement['a']; +type UCB = UnionComplement['b']; + +// {a: "a"; b: "b"} +type UnionComplementComplement = { + [K in Union]: Exclude> +}; +type UCCA = UnionComplementComplement['a']; +type UCCB = UnionComplementComplement['b']; + +// {a: Product<'b', 1>; b: Product<'a', 0>} +type ProductComplement = { + [K in Union]: Exclude +}; +type PCA = ProductComplement['a']; +type PCB = ProductComplement['b']; + +// {a: Product<'a', 0>; b: Product<'b', 1>} +type ProductComplementComplement = { + [K in Union]: Exclude> +}; +type PCCA = ProductComplementComplement['a']; +type PCCB = ProductComplementComplement['b']; From 3afa86fd9c0d56820ad27447bac6e1de7db90a26 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 13:18:13 -0800 Subject: [PATCH 095/322] Accept new baselines --- .../reference/conditionalTypes2.errors.txt | 34 ++++++ .../baselines/reference/conditionalTypes2.js | 64 +++++++++++ .../reference/conditionalTypes2.symbols | 106 ++++++++++++++++++ .../reference/conditionalTypes2.types | 65 +++++++++++ 4 files changed, 269 insertions(+) diff --git a/tests/baselines/reference/conditionalTypes2.errors.txt b/tests/baselines/reference/conditionalTypes2.errors.txt index 322cbe1e7bb..a1a23b6da18 100644 --- a/tests/baselines/reference/conditionalTypes2.errors.txt +++ b/tests/baselines/reference/conditionalTypes2.errors.txt @@ -212,4 +212,38 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2 type T1 = MaybeTrue<{ b: false }>; // "no" type T2 = MaybeTrue<{ b: true }>; // "yes" type T3 = MaybeTrue<{ b: boolean }>; // "yes" + + // Repro from #28824 + + type Union = 'a' | 'b'; + type Product = { f1: A, f2: B}; + type ProductUnion = Product<'a', 0> | Product<'b', 1>; + + // {a: "b"; b: "a"} + type UnionComplement = { + [K in Union]: Exclude + }; + type UCA = UnionComplement['a']; + type UCB = UnionComplement['b']; + + // {a: "a"; b: "b"} + type UnionComplementComplement = { + [K in Union]: Exclude> + }; + type UCCA = UnionComplementComplement['a']; + type UCCB = UnionComplementComplement['b']; + + // {a: Product<'b', 1>; b: Product<'a', 0>} + type ProductComplement = { + [K in Union]: Exclude + }; + type PCA = ProductComplement['a']; + type PCB = ProductComplement['b']; + + // {a: Product<'a', 0>; b: Product<'b', 1>} + type ProductComplementComplement = { + [K in Union]: Exclude> + }; + type PCCA = ProductComplementComplement['a']; + type PCCB = ProductComplementComplement['b']; \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes2.js b/tests/baselines/reference/conditionalTypes2.js index 02581ab0015..4f4f35e821a 100644 --- a/tests/baselines/reference/conditionalTypes2.js +++ b/tests/baselines/reference/conditionalTypes2.js @@ -154,6 +154,40 @@ type T0 = MaybeTrue<{ b: never }> // "no" type T1 = MaybeTrue<{ b: false }>; // "no" type T2 = MaybeTrue<{ b: true }>; // "yes" type T3 = MaybeTrue<{ b: boolean }>; // "yes" + +// Repro from #28824 + +type Union = 'a' | 'b'; +type Product = { f1: A, f2: B}; +type ProductUnion = Product<'a', 0> | Product<'b', 1>; + +// {a: "b"; b: "a"} +type UnionComplement = { + [K in Union]: Exclude +}; +type UCA = UnionComplement['a']; +type UCB = UnionComplement['b']; + +// {a: "a"; b: "b"} +type UnionComplementComplement = { + [K in Union]: Exclude> +}; +type UCCA = UnionComplementComplement['a']; +type UCCB = UnionComplementComplement['b']; + +// {a: Product<'b', 1>; b: Product<'a', 0>} +type ProductComplement = { + [K in Union]: Exclude +}; +type PCA = ProductComplement['a']; +type PCB = ProductComplement['b']; + +// {a: Product<'a', 0>; b: Product<'b', 1>} +type ProductComplementComplement = { + [K in Union]: Exclude> +}; +type PCCA = ProductComplementComplement['a']; +type PCCB = ProductComplementComplement['b']; //// [conditionalTypes2.js] @@ -328,3 +362,33 @@ declare type T2 = MaybeTrue<{ declare type T3 = MaybeTrue<{ b: boolean; }>; +declare type Union = 'a' | 'b'; +declare type Product = { + f1: A; + f2: B; +}; +declare type ProductUnion = Product<'a', 0> | Product<'b', 1>; +declare type UnionComplement = { + [K in Union]: Exclude; +}; +declare type UCA = UnionComplement['a']; +declare type UCB = UnionComplement['b']; +declare type UnionComplementComplement = { + [K in Union]: Exclude>; +}; +declare type UCCA = UnionComplementComplement['a']; +declare type UCCB = UnionComplementComplement['b']; +declare type ProductComplement = { + [K in Union]: Exclude; +}; +declare type PCA = ProductComplement['a']; +declare type PCB = ProductComplement['b']; +declare type ProductComplementComplement = { + [K in Union]: Exclude>; +}; +declare type PCCA = ProductComplementComplement['a']; +declare type PCCB = ProductComplementComplement['b']; diff --git a/tests/baselines/reference/conditionalTypes2.symbols b/tests/baselines/reference/conditionalTypes2.symbols index b9098616f0f..b164d26e450 100644 --- a/tests/baselines/reference/conditionalTypes2.symbols +++ b/tests/baselines/reference/conditionalTypes2.symbols @@ -579,3 +579,109 @@ type T3 = MaybeTrue<{ b: boolean }>; // "yes" >MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63)) >b : Symbol(b, Decl(conditionalTypes2.ts, 154, 21)) +// Repro from #28824 + +type Union = 'a' | 'b'; +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) + +type Product = { f1: A, f2: B}; +>Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23)) +>A : Symbol(A, Decl(conditionalTypes2.ts, 159, 13)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>B : Symbol(B, Decl(conditionalTypes2.ts, 159, 29)) +>f1 : Symbol(f1, Decl(conditionalTypes2.ts, 159, 36)) +>A : Symbol(A, Decl(conditionalTypes2.ts, 159, 13)) +>f2 : Symbol(f2, Decl(conditionalTypes2.ts, 159, 43)) +>B : Symbol(B, Decl(conditionalTypes2.ts, 159, 29)) + +type ProductUnion = Product<'a', 0> | Product<'b', 1>; +>ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51)) +>Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23)) +>Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23)) + +// {a: "b"; b: "a"} +type UnionComplement = { +>UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54)) + + [K in Union]: Exclude +>K : Symbol(K, Decl(conditionalTypes2.ts, 164, 3)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>K : Symbol(K, Decl(conditionalTypes2.ts, 164, 3)) + +}; +type UCA = UnionComplement['a']; +>UCA : Symbol(UCA, Decl(conditionalTypes2.ts, 165, 2)) +>UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54)) + +type UCB = UnionComplement['b']; +>UCB : Symbol(UCB, Decl(conditionalTypes2.ts, 166, 32)) +>UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54)) + +// {a: "a"; b: "b"} +type UnionComplementComplement = { +>UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32)) + + [K in Union]: Exclude> +>K : Symbol(K, Decl(conditionalTypes2.ts, 171, 3)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>K : Symbol(K, Decl(conditionalTypes2.ts, 171, 3)) + +}; +type UCCA = UnionComplementComplement['a']; +>UCCA : Symbol(UCCA, Decl(conditionalTypes2.ts, 172, 2)) +>UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32)) + +type UCCB = UnionComplementComplement['b']; +>UCCB : Symbol(UCCB, Decl(conditionalTypes2.ts, 173, 43)) +>UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32)) + +// {a: Product<'b', 1>; b: Product<'a', 0>} +type ProductComplement = { +>ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43)) + + [K in Union]: Exclude +>K : Symbol(K, Decl(conditionalTypes2.ts, 178, 3)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51)) +>f1 : Symbol(f1, Decl(conditionalTypes2.ts, 178, 39)) +>K : Symbol(K, Decl(conditionalTypes2.ts, 178, 3)) + +}; +type PCA = ProductComplement['a']; +>PCA : Symbol(PCA, Decl(conditionalTypes2.ts, 179, 2)) +>ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43)) + +type PCB = ProductComplement['b']; +>PCB : Symbol(PCB, Decl(conditionalTypes2.ts, 180, 34)) +>ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43)) + +// {a: Product<'a', 0>; b: Product<'b', 1>} +type ProductComplementComplement = { +>ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34)) + + [K in Union]: Exclude> +>K : Symbol(K, Decl(conditionalTypes2.ts, 185, 3)) +>Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51)) +>Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --)) +>ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51)) +>f1 : Symbol(f1, Decl(conditionalTypes2.ts, 185, 61)) +>K : Symbol(K, Decl(conditionalTypes2.ts, 185, 3)) + +}; +type PCCA = ProductComplementComplement['a']; +>PCCA : Symbol(PCCA, Decl(conditionalTypes2.ts, 186, 2)) +>ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34)) + +type PCCB = ProductComplementComplement['b']; +>PCCB : Symbol(PCCB, Decl(conditionalTypes2.ts, 187, 45)) +>ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34)) + diff --git a/tests/baselines/reference/conditionalTypes2.types b/tests/baselines/reference/conditionalTypes2.types index e500d21d36b..aac6ba47475 100644 --- a/tests/baselines/reference/conditionalTypes2.types +++ b/tests/baselines/reference/conditionalTypes2.types @@ -366,3 +366,68 @@ type T3 = MaybeTrue<{ b: boolean }>; // "yes" >T3 : "yes" >b : boolean +// Repro from #28824 + +type Union = 'a' | 'b'; +>Union : Union + +type Product = { f1: A, f2: B}; +>Product : Product +>f1 : A +>f2 : B + +type ProductUnion = Product<'a', 0> | Product<'b', 1>; +>ProductUnion : ProductUnion + +// {a: "b"; b: "a"} +type UnionComplement = { +>UnionComplement : UnionComplement + + [K in Union]: Exclude +}; +type UCA = UnionComplement['a']; +>UCA : "b" + +type UCB = UnionComplement['b']; +>UCB : "a" + +// {a: "a"; b: "b"} +type UnionComplementComplement = { +>UnionComplementComplement : UnionComplementComplement + + [K in Union]: Exclude> +}; +type UCCA = UnionComplementComplement['a']; +>UCCA : "a" + +type UCCB = UnionComplementComplement['b']; +>UCCB : "b" + +// {a: Product<'b', 1>; b: Product<'a', 0>} +type ProductComplement = { +>ProductComplement : ProductComplement + + [K in Union]: Exclude +>f1 : K + +}; +type PCA = ProductComplement['a']; +>PCA : Product<"b", 1> + +type PCB = ProductComplement['b']; +>PCB : Product<"a", 0> + +// {a: Product<'a', 0>; b: Product<'b', 1>} +type ProductComplementComplement = { +>ProductComplementComplement : ProductComplementComplement + + [K in Union]: Exclude> +>f1 : K + +}; +type PCCA = ProductComplementComplement['a']; +>PCCA : Product<"a", 0> + +type PCCB = ProductComplementComplement['b']; +>PCCB : Product<"b", 1> + From 1d2df84a771e60c925e33b6a473348585efd7765 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 14:50:56 -0800 Subject: [PATCH 096/322] Improve excess property checking logic --- src/compiler/checker.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 982da682be0..d3ea9c170ad 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11836,7 +11836,7 @@ namespace ts { if (!noImplicitAny && getObjectFlags(target) & ObjectFlags.JSLiteral) { return false; // Disable excess property checks on JS literals to simulate having an implicit "index signature" - but only outside of noImplicitAny } - if (maybeTypeOfKind(target, TypeFlags.Object) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) { + if (isExcessPropertyCheckTarget(target)) { const isComparingJsxAttributes = !!(getObjectFlags(source) & ObjectFlags.JsxAttributes); if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { @@ -11849,6 +11849,9 @@ namespace ts { for (const prop of getPropertiesOfObjectType(source)) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { + // Report error in terms of object types in the target as those are the only ones + // we check in isKnownProperty. + const errorTarget = filterType(target, isExcessPropertyCheckTarget); // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. @@ -11857,7 +11860,7 @@ namespace ts { // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal. // However, using an object-literal error message will be very confusing to the users so we give different a message. // TODO: Spelling suggestions for excess jsx attributes (needs new diagnostic messages) - reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); + reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(errorTarget)); } else { // use the property's value declaration if the property is assigned inside the literal itself @@ -11871,17 +11874,17 @@ namespace ts { const name = propDeclaration.name!; if (isIdentifier(name)) { - suggestion = getSuggestionForNonexistentProperty(name, target); + suggestion = getSuggestionForNonexistentProperty(name, errorTarget); } } if (suggestion !== undefined) { reportError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, - symbolToString(prop), typeToString(target), suggestion); + symbolToString(prop), typeToString(errorTarget), suggestion); } else { reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, - symbolToString(prop), typeToString(target)); + symbolToString(prop), typeToString(errorTarget)); } } } @@ -18595,20 +18598,23 @@ namespace ts { return true; } } - else if (targetType.flags & TypeFlags.UnionOrIntersection) { + else if (targetType.flags & TypeFlags.UnionOrIntersection && isExcessPropertyCheckTarget(targetType)) { for (const t of (targetType as UnionOrIntersectionType).types) { if (isKnownProperty(t, name, isComparingJsxAttributes)) { return true; } } } - else if (targetType.flags & TypeFlags.Conditional) { - return isKnownProperty((targetType as ConditionalType).root.trueType, name, isComparingJsxAttributes) || - isKnownProperty((targetType as ConditionalType).root.falseType, name, isComparingJsxAttributes); - } return false; } + function isExcessPropertyCheckTarget(type: Type): boolean { + return !!(type.flags & TypeFlags.Object && !(getObjectFlags(type) & ObjectFlags.ObjectLiteralPatternWithComputedProperties) || + type.flags & TypeFlags.NonPrimitive || + type.flags & TypeFlags.Union && some((type).types, isExcessPropertyCheckTarget) || + type.flags & TypeFlags.Intersection && every((type).types, isExcessPropertyCheckTarget)); + } + function checkJsxExpression(node: JsxExpression, checkMode?: CheckMode) { if (node.expression) { const type = checkExpression(node.expression, checkMode); From f1b3c6ec8c7fdb1bc8e285d420d3425f1aef0c5f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 14:51:35 -0800 Subject: [PATCH 097/322] Accept new baselines --- .../reference/conditionalTypesExcessProperties.errors.txt | 8 ++++---- .../reference/tsxIntrinsicAttributeErrors.errors.txt | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/conditionalTypesExcessProperties.errors.txt b/tests/baselines/reference/conditionalTypesExcessProperties.errors.txt index 54e8c8742a7..24669d3426d 100644 --- a/tests/baselines/reference/conditionalTypesExcessProperties.errors.txt +++ b/tests/baselines/reference/conditionalTypesExcessProperties.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(8,5): error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something'. Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'. -tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,33): error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something'. - Object literal may only specify known properties, and 'arr' does not exist in type 'Something'. +tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,5): error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something'. + Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'. ==== tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts (2 errors) ==== @@ -17,8 +17,8 @@ tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9, !!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something'. !!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'. sa = { test: 'bye', arg: a, arr: a } // excess - ~~~~~~ + ~~ !!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something'. -!!! error TS2322: Object literal may only specify known properties, and 'arr' does not exist in type 'Something'. +!!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxIntrinsicAttributeErrors.errors.txt b/tests/baselines/reference/tsxIntrinsicAttributeErrors.errors.txt index ae3f26d641e..c26eb2f7d3d 100644 --- a/tests/baselines/reference/tsxIntrinsicAttributeErrors.errors.txt +++ b/tests/baselines/reference/tsxIntrinsicAttributeErrors.errors.txt @@ -1,5 +1,4 @@ -tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx(29,2): error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<{ x: number; render(): void; }> & string'. - Property 'x' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<{ x: number; render(): void; }> & string'. +tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx(29,2): error TS2741: Property 'key' is missing in type '{ x: number; }' but required in type 'IntrinsicAttributes'. ==== tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx (1 errors) ==== @@ -33,6 +32,6 @@ tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx(29,2): error TS2322: var E: I; ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<{ x: number; render(): void; }> & string'. -!!! error TS2322: Property 'x' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<{ x: number; render(): void; }> & string'. +!!! error TS2741: Property 'key' is missing in type '{ x: number; }' but required in type 'IntrinsicAttributes'. +!!! related TS2728 tests/cases/conformance/jsx/tsxIntrinsicAttributeErrors.tsx:7:9: 'key' is declared here. \ No newline at end of file From e7bb5625c008b0fd6f3ad9baef4d427db8c3db3d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 14:51:59 -0800 Subject: [PATCH 098/322] Add additional tests --- .../compiler/objectLiteralExcessProperties.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/cases/compiler/objectLiteralExcessProperties.ts b/tests/cases/compiler/objectLiteralExcessProperties.ts index ca681b7b28e..660529ec3ff 100644 --- a/tests/cases/compiler/objectLiteralExcessProperties.ts +++ b/tests/cases/compiler/objectLiteralExcessProperties.ts @@ -31,3 +31,20 @@ interface Indexed { var b10: Indexed = { 0: { }, '1': { } }; // ok var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still errors + +// Repros inspired by #28752 + +function test() { + // No excess property checks on generic types + const obj1: T = { name: "test" }; + // No excess property checks on intersections involving generics + const obj2: T & { prop: boolean } = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + const obj3: T | { prop: boolean } = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; + // No excess property checks when union includes 'object' type + const obj5: object | { x: string } = { z: 'abc' } + // The 'object' type has no effect on intersections + const obj6: object & { x: string } = { z: 'abc' } +} From 6e022bdd43a93499655b0468a7a75f597f5e35dc Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 4 Dec 2018 14:52:06 -0800 Subject: [PATCH 099/322] Accept new baselines --- .../objectLiteralExcessProperties.errors.txt | 57 +++++++++++++++--- .../objectLiteralExcessProperties.js | 32 ++++++++++ .../objectLiteralExcessProperties.symbols | 50 ++++++++++++++++ .../objectLiteralExcessProperties.types | 60 +++++++++++++++++++ 4 files changed, 192 insertions(+), 7 deletions(-) diff --git a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt index fa76abac0de..4b034b06206 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(9,18): error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'. Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(11,27): error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. - Object literal may only specify known properties, and 'foreward' does not exist in type 'string | Book'. + Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book[]'. Type '{ foreword: string; } | { forwards: string; }' is not assignable to type 'Book'. @@ -13,17 +13,27 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(17,26): error TS2322: Type Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. -tests/cases/compiler/objectLiteralExcessProperties.ts(21,43): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. - Object literal may only specify known properties, and 'price' does not exist in type 'Book & number'. +tests/cases/compiler/objectLiteralExcessProperties.ts(21,5): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. + Type '{ foreword: string; price: number; }' is not assignable to type 'number'. tests/cases/compiler/objectLiteralExcessProperties.ts(23,29): error TS2322: Type '{ couleur: string; }' is not assignable to type 'Cover | Cover[]'. Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. tests/cases/compiler/objectLiteralExcessProperties.ts(25,27): error TS2322: Type '{ forewarned: string; }' is not assignable to type 'Book | Book[]'. Object literal may only specify known properties, and 'forewarned' does not exist in type 'Book | Book[]'. tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? +tests/cases/compiler/objectLiteralExcessProperties.ts(37,25): error TS2304: Cannot find name 'IFoo'. +tests/cases/compiler/objectLiteralExcessProperties.ts(39,11): error TS2322: Type '{ name: string; }' is not assignable to type 'T'. +tests/cases/compiler/objectLiteralExcessProperties.ts(41,11): error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T & { prop: boolean; }'. + Type '{ name: string; prop: boolean; }' is not assignable to type 'T'. +tests/cases/compiler/objectLiteralExcessProperties.ts(43,43): error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T | { prop: boolean; }'. + Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. +tests/cases/compiler/objectLiteralExcessProperties.ts(45,76): error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type '{ name: string; } | (T & { prop: boolean; })'. + Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. +tests/cases/compiler/objectLiteralExcessProperties.ts(49,44): error TS2322: Type '{ z: string; }' is not assignable to type 'object & { x: string; }'. + Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. -==== tests/cases/compiler/objectLiteralExcessProperties.ts (10 errors) ==== +==== tests/cases/compiler/objectLiteralExcessProperties.ts (16 errors) ==== interface Book { foreword: string; } @@ -40,7 +50,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type var b2: Book | string = { foreward: "nope" }; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. -!!! error TS2322: Object literal may only specify known properties, and 'foreward' does not exist in type 'string | Book'. +!!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book'. Did you mean to write 'foreword'? var b3: Book | (Book[]) = [{ foreword: "hello" }, { forwards: "back" }]; ~~~~~~~~~~~~~~~~ @@ -66,9 +76,9 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type !!! error TS2322: Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. var b7: Book & number = { foreword: "hi", price: 10.99 }; - ~~~~~~~~~~~~ + ~~ !!! error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. -!!! error TS2322: Object literal may only specify known properties, and 'price' does not exist in type 'Book & number'. +!!! error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'number'. var b8: Cover | Cover[] = { couleur : "non" }; ~~~~~~~~~~~~~~~ @@ -91,4 +101,37 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type !!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'. !!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'? !!! related TS6501 tests/cases/compiler/objectLiteralExcessProperties.ts:28:5: The expected type comes from this index signature. + + // Repros inspired by #28752 + + function test() { + ~~~~ +!!! error TS2304: Cannot find name 'IFoo'. + // No excess property checks on generic types + const obj1: T = { name: "test" }; + ~~~~ +!!! error TS2322: Type '{ name: string; }' is not assignable to type 'T'. + // No excess property checks on intersections involving generics + const obj2: T & { prop: boolean } = { name: "test", prop: true }; + ~~~~ +!!! error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T & { prop: boolean; }'. +!!! error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T'. + // Excess property checks only on non-generic parts of unions + const obj3: T | { prop: boolean } = { name: "test", prop: true }; + ~~~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type 'T | { prop: boolean; }'. +!!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ prop: boolean; }'. + // Excess property checks only on non-generic parts of unions + const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; + ~~~~~~~~~~ +!!! error TS2322: Type '{ name: string; prop: boolean; }' is not assignable to type '{ name: string; } | (T & { prop: boolean; })'. +!!! error TS2322: Object literal may only specify known properties, and 'prop' does not exist in type '{ name: string; }'. + // No excess property checks when union includes 'object' type + const obj5: object | { x: string } = { z: 'abc' } + // The 'object' type has no effect on intersections + const obj6: object & { x: string } = { z: 'abc' } + ~~~~~~~~ +!!! error TS2322: Type '{ z: string; }' is not assignable to type 'object & { x: string; }'. +!!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type 'object & { x: string; }'. + } \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralExcessProperties.js b/tests/baselines/reference/objectLiteralExcessProperties.js index 38186b19bf7..5df0aebc12d 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.js +++ b/tests/baselines/reference/objectLiteralExcessProperties.js @@ -32,6 +32,23 @@ interface Indexed { var b10: Indexed = { 0: { }, '1': { } }; // ok var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still errors + +// Repros inspired by #28752 + +function test() { + // No excess property checks on generic types + const obj1: T = { name: "test" }; + // No excess property checks on intersections involving generics + const obj2: T & { prop: boolean } = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + const obj3: T | { prop: boolean } = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; + // No excess property checks when union includes 'object' type + const obj5: object | { x: string } = { z: 'abc' } + // The 'object' type has no effect on intersections + const obj6: object & { x: string } = { z: 'abc' } +} //// [objectLiteralExcessProperties.js] @@ -46,3 +63,18 @@ var b8 = { couleur: "non" }; var b9 = { forewarned: "still no" }; var b10 = { 0: {}, '1': {} }; // ok var b11 = { 0: { colour: "blue" } }; // nested object literal still errors +// Repros inspired by #28752 +function test() { + // No excess property checks on generic types + var obj1 = { name: "test" }; + // No excess property checks on intersections involving generics + var obj2 = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + var obj3 = { name: "test", prop: true }; + // Excess property checks only on non-generic parts of unions + var obj4 = { name: "test", prop: true }; + // No excess property checks when union includes 'object' type + var obj5 = { z: 'abc' }; + // The 'object' type has no effect on intersections + var obj6 = { z: 'abc' }; +} diff --git a/tests/baselines/reference/objectLiteralExcessProperties.symbols b/tests/baselines/reference/objectLiteralExcessProperties.symbols index d145f43cd5f..3624766ba0d 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.symbols +++ b/tests/baselines/reference/objectLiteralExcessProperties.symbols @@ -90,3 +90,53 @@ var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still err >0 : Symbol(0, Decl(objectLiteralExcessProperties.ts, 32, 20)) >colour : Symbol(colour, Decl(objectLiteralExcessProperties.ts, 32, 25)) +// Repros inspired by #28752 + +function test() { +>test : Symbol(test, Decl(objectLiteralExcessProperties.ts, 32, 45)) +>T : Symbol(T, Decl(objectLiteralExcessProperties.ts, 36, 14)) + + // No excess property checks on generic types + const obj1: T = { name: "test" }; +>obj1 : Symbol(obj1, Decl(objectLiteralExcessProperties.ts, 38, 9)) +>T : Symbol(T, Decl(objectLiteralExcessProperties.ts, 36, 14)) +>name : Symbol(name, Decl(objectLiteralExcessProperties.ts, 38, 21)) + + // No excess property checks on intersections involving generics + const obj2: T & { prop: boolean } = { name: "test", prop: true }; +>obj2 : Symbol(obj2, Decl(objectLiteralExcessProperties.ts, 40, 9)) +>T : Symbol(T, Decl(objectLiteralExcessProperties.ts, 36, 14)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 40, 21)) +>name : Symbol(name, Decl(objectLiteralExcessProperties.ts, 40, 41)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 40, 55)) + + // Excess property checks only on non-generic parts of unions + const obj3: T | { prop: boolean } = { name: "test", prop: true }; +>obj3 : Symbol(obj3, Decl(objectLiteralExcessProperties.ts, 42, 9)) +>T : Symbol(T, Decl(objectLiteralExcessProperties.ts, 36, 14)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 42, 21)) +>name : Symbol(name, Decl(objectLiteralExcessProperties.ts, 42, 41)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 42, 55)) + + // Excess property checks only on non-generic parts of unions + const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; +>obj4 : Symbol(obj4, Decl(objectLiteralExcessProperties.ts, 44, 9)) +>T : Symbol(T, Decl(objectLiteralExcessProperties.ts, 36, 14)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 44, 21)) +>name : Symbol(name, Decl(objectLiteralExcessProperties.ts, 44, 41)) +>name : Symbol(name, Decl(objectLiteralExcessProperties.ts, 44, 60)) +>prop : Symbol(prop, Decl(objectLiteralExcessProperties.ts, 44, 74)) + + // No excess property checks when union includes 'object' type + const obj5: object | { x: string } = { z: 'abc' } +>obj5 : Symbol(obj5, Decl(objectLiteralExcessProperties.ts, 46, 9)) +>x : Symbol(x, Decl(objectLiteralExcessProperties.ts, 46, 26)) +>z : Symbol(z, Decl(objectLiteralExcessProperties.ts, 46, 42)) + + // The 'object' type has no effect on intersections + const obj6: object & { x: string } = { z: 'abc' } +>obj6 : Symbol(obj6, Decl(objectLiteralExcessProperties.ts, 48, 9)) +>x : Symbol(x, Decl(objectLiteralExcessProperties.ts, 48, 26)) +>z : Symbol(z, Decl(objectLiteralExcessProperties.ts, 48, 42)) +} + diff --git a/tests/baselines/reference/objectLiteralExcessProperties.types b/tests/baselines/reference/objectLiteralExcessProperties.types index 0b1c10c3bec..8765432ab70 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.types +++ b/tests/baselines/reference/objectLiteralExcessProperties.types @@ -98,3 +98,63 @@ var b11: Indexed = { 0: { colour: "blue" } }; // nested object literal still err >colour : string >"blue" : "blue" +// Repros inspired by #28752 + +function test() { +>test : () => void + + // No excess property checks on generic types + const obj1: T = { name: "test" }; +>obj1 : T +>{ name: "test" } : { name: string; } +>name : string +>"test" : "test" + + // No excess property checks on intersections involving generics + const obj2: T & { prop: boolean } = { name: "test", prop: true }; +>obj2 : T & { prop: boolean; } +>prop : boolean +>{ name: "test", prop: true } : { name: string; prop: boolean; } +>name : string +>"test" : "test" +>prop : boolean +>true : true + + // Excess property checks only on non-generic parts of unions + const obj3: T | { prop: boolean } = { name: "test", prop: true }; +>obj3 : T | { prop: boolean; } +>prop : boolean +>{ name: "test", prop: true } : { name: string; prop: boolean; } +>name : string +>"test" : "test" +>prop : boolean +>true : true + + // Excess property checks only on non-generic parts of unions + const obj4: T & { prop: boolean } | { name: string } = { name: "test", prop: true }; +>obj4 : { name: string; } | (T & { prop: boolean; }) +>prop : boolean +>name : string +>{ name: "test", prop: true } : { name: string; prop: boolean; } +>name : string +>"test" : "test" +>prop : boolean +>true : true + + // No excess property checks when union includes 'object' type + const obj5: object | { x: string } = { z: 'abc' } +>obj5 : object | { x: string; } +>x : string +>{ z: 'abc' } : { z: string; } +>z : string +>'abc' : "abc" + + // The 'object' type has no effect on intersections + const obj6: object & { x: string } = { z: 'abc' } +>obj6 : object & { x: string; } +>x : string +>{ z: 'abc' } : { z: string; } +>z : string +>'abc' : "abc" +} + From 19de47f2db05f70442f90f8a72df50dca4cf08ae Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 4 Dec 2018 16:24:25 -0800 Subject: [PATCH 100/322] Fix paths showConfig, exhaustively test showConfig --- src/compiler/commandLineParser.ts | 4 +- src/testRunner/unittests/showConfig.ts | 129 +++++++++++++++++- .../tsconfig.json | 36 +++++ .../all/tsconfig.json | 3 + .../allowJs/tsconfig.json | 5 + .../tsconfig.json | 5 + .../allowUnreachableCode/tsconfig.json | 5 + .../allowUnusedLabels/tsconfig.json | 5 + .../alwaysStrict/tsconfig.json | 5 + .../baseUrl/tsconfig.json | 5 + .../build/tsconfig.json | 3 + .../charset/tsconfig.json | 5 + .../checkJs/tsconfig.json | 5 + .../composite/tsconfig.json | 5 + .../declaration/tsconfig.json | 5 + .../declarationDir/tsconfig.json | 5 + .../declarationMap/tsconfig.json | 5 + .../diagnostics/tsconfig.json | 5 + .../disableSizeLimit/tsconfig.json | 5 + .../downlevelIteration/tsconfig.json | 5 + .../emitBOM/tsconfig.json | 5 + .../emitDeclarationOnly/tsconfig.json | 5 + .../emitDecoratorMetadata/tsconfig.json | 5 + .../esModuleInterop/tsconfig.json | 5 + .../experimentalDecorators/tsconfig.json | 5 + .../extendedDiagnostics/tsconfig.json | 5 + .../tsconfig.json | 5 + .../help/tsconfig.json | 3 + .../importHelpers/tsconfig.json | 5 + .../init/tsconfig.json | 3 + .../inlineSourceMap/tsconfig.json | 5 + .../inlineSources/tsconfig.json | 5 + .../isolatedModules/tsconfig.json | 5 + .../jsx/tsconfig.json | 5 + .../jsxFactory/tsconfig.json | 5 + .../keyofStringsOnly/tsconfig.json | 5 + .../lib/tsconfig.json | 5 + .../listEmittedFiles/tsconfig.json | 3 + .../listFiles/tsconfig.json | 3 + .../locale/tsconfig.json | 5 + .../mapRoot/tsconfig.json | 5 + .../maxNodeModuleJsDepth/tsconfig.json | 5 + .../module/tsconfig.json | 5 + .../moduleResolution/tsconfig.json | 5 + .../newLine/tsconfig.json | 5 + .../noEmit/tsconfig.json | 5 + .../noEmitHelpers/tsconfig.json | 5 + .../noEmitOnError/tsconfig.json | 5 + .../noErrorTruncation/tsconfig.json | 5 + .../noFallthroughCasesInSwitch/tsconfig.json | 5 + .../noImplicitAny/tsconfig.json | 5 + .../noImplicitReturns/tsconfig.json | 5 + .../noImplicitThis/tsconfig.json | 5 + .../noImplicitUseStrict/tsconfig.json | 5 + .../noLib/tsconfig.json | 5 + .../noResolve/tsconfig.json | 5 + .../noStrictGenericChecks/tsconfig.json | 5 + .../noUnusedLocals/tsconfig.json | 5 + .../noUnusedParameters/tsconfig.json | 5 + .../out/tsconfig.json | 5 + .../outDir/tsconfig.json | 5 + .../outFile/tsconfig.json | 5 + .../paths/tsconfig.json | 5 + .../plugins/tsconfig.json | 5 + .../preserveConstEnums/tsconfig.json | 5 + .../preserveSymlinks/tsconfig.json | 5 + .../preserveWatchOutput/tsconfig.json | 5 + .../pretty/tsconfig.json | 3 + .../project/tsconfig.json | 3 + .../reactNamespace/tsconfig.json | 5 + .../removeComments/tsconfig.json | 5 + .../resolveJsonModule/tsconfig.json | 5 + .../rootDir/tsconfig.json | 5 + .../rootDirs/tsconfig.json | 5 + .../showConfig/tsconfig.json | 3 + .../skipDefaultLibCheck/tsconfig.json | 5 + .../skipLibCheck/tsconfig.json | 5 + .../sourceMap/tsconfig.json | 5 + .../sourceRoot/tsconfig.json | 5 + .../strict/tsconfig.json | 5 + .../strictBindCallApply/tsconfig.json | 5 + .../strictFunctionTypes/tsconfig.json | 5 + .../strictNullChecks/tsconfig.json | 5 + .../tsconfig.json | 5 + .../stripInternal/tsconfig.json | 5 + .../tsconfig.json | 5 + .../tsconfig.json | 5 + .../target/tsconfig.json | 5 + .../traceResolution/tsconfig.json | 5 + .../typeRoots/tsconfig.json | 5 + .../types/tsconfig.json | 5 + .../version/tsconfig.json | 3 + .../watch/tsconfig.json | 3 + 93 files changed, 590 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/showConfig/Show TSConfig with paths and more/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/all/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/allowJs/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/allowSyntheticDefaultImports/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnreachableCode/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnusedLabels/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/alwaysStrict/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/baseUrl/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/build/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/charset/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/checkJs/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/composite/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/declaration/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationDir/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationMap/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/diagnostics/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/disableSizeLimit/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/downlevelIteration/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/emitBOM/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDeclarationOnly/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDecoratorMetadata/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/esModuleInterop/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/experimentalDecorators/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/extendedDiagnostics/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/forceConsistentCasingInFileNames/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/help/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/importHelpers/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/init/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSourceMap/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSources/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/isolatedModules/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/jsx/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/jsxFactory/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/keyofStringsOnly/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/lib/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/listEmittedFiles/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/listFiles/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/locale/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/mapRoot/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/maxNodeModuleJsDepth/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/module/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/moduleResolution/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/newLine/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmit/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitHelpers/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitOnError/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noErrorTruncation/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noFallthroughCasesInSwitch/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitAny/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitReturns/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitThis/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitUseStrict/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noLib/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noResolve/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noStrictGenericChecks/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedLocals/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedParameters/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/out/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/outDir/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/outFile/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/paths/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/plugins/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveConstEnums/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveSymlinks/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveWatchOutput/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/pretty/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/project/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/reactNamespace/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/removeComments/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/resolveJsonModule/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDir/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDirs/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/showConfig/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/skipDefaultLibCheck/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/skipLibCheck/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceMap/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceRoot/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strict/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strictBindCallApply/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strictFunctionTypes/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strictNullChecks/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/strictPropertyInitialization/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/stripInternal/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressExcessPropertyErrors/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressImplicitAnyIndexErrors/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/target/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/traceResolution/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/typeRoots/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/types/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/version/tsconfig.json create mode 100644 tests/baselines/reference/showConfig/Shows tsconfig for single option/watch/tsconfig.json diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 8ca93fdab80..a44fad2538b 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1693,6 +1693,8 @@ namespace ts { listFiles: undefined, listEmittedFiles: undefined, project: undefined, + build: undefined, + version: undefined, }, references: map(configParseResult.projectReferences, r => ({ ...r, path: r.originalPath, originalPath: undefined })), files: length(files) ? files : undefined, @@ -1730,7 +1732,7 @@ namespace ts { } function getCustomTypeMapOfCommandLineOption(optionDefinition: CommandLineOption): Map | undefined { - if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { + if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean" || optionDefinition.type === "object") { // this is of a type CommandLineOptionOfPrimitiveType return undefined; } diff --git a/src/testRunner/unittests/showConfig.ts b/src/testRunner/unittests/showConfig.ts index a2b5bb10258..4040e6563a8 100644 --- a/src/testRunner/unittests/showConfig.ts +++ b/src/testRunner/unittests/showConfig.ts @@ -1,12 +1,34 @@ namespace ts { - describe("showTSConfig", () => { - function showTSConfigCorrectly(name: string, commandLinesArgs: string[]) { + describe("showConfig", () => { + function showTSConfigCorrectly(name: string, commandLinesArgs: string[], configJson?: object) { describe(name, () => { - const commandLine = parseCommandLine(commandLinesArgs); - const initResult = convertToTSConfig(commandLine, `/${name}/tsconfig.json`, { getCurrentDirectory() { return `/${name}`; }, useCaseSensitiveFileNames: true }); - const outputFileName = `showConfig/${name.replace(/[^a-z0-9\-. ]/ig, "")}/tsconfig.json`; + const outputFileName = `showConfig/${name.replace(/[^a-z0-9\-./ ]/ig, "")}/tsconfig.json`; it(`Correct output for ${outputFileName}`, () => { + const cwd = `/${name}`; + const configPath = combinePaths(cwd, "tsconfig.json"); + const configContents = configJson ? JSON.stringify(configJson) : undefined; + const configParseHost: ParseConfigFileHost = { + fileExists: path => + comparePaths(getNormalizedAbsolutePath(path, cwd), configPath) === Comparison.EqualTo ? true : false, + getCurrentDirectory() { return cwd; }, + useCaseSensitiveFileNames: true, + onUnRecoverableConfigFileDiagnostic: d => { + throw new Error(flattenDiagnosticMessageText(d.messageText, "\n")); + }, + readDirectory() { return []; }, + readFile: path => + comparePaths(getNormalizedAbsolutePath(path, cwd), configPath) === Comparison.EqualTo ? configContents : undefined, + }; + let commandLine = parseCommandLine(commandLinesArgs); + if (commandLine.options.project) { + const result = getParsedCommandLineOfConfigFile(commandLine.options.project, commandLine.options, configParseHost); + if (result) { + commandLine = result; + } + } + const initResult = convertToTSConfig(commandLine, configPath, configParseHost); + // tslint:disable-next-line:no-null-keyword Harness.Baseline.runBaseline(outputFileName, JSON.stringify(initResult, null, 4) + "\n"); }); @@ -30,5 +52,100 @@ namespace ts { showTSConfigCorrectly("Show TSConfig with incorrect compiler option value", ["--showConfig", "--lib", "nonExistLib,es5,es2015.promise"]); showTSConfigCorrectly("Show TSConfig with advanced options", ["--showConfig", "--declaration", "--declarationDir", "lib", "--skipLibCheck", "--noErrorTruncation"]); + + // Regression test for https://github.com/Microsoft/TypeScript/issues/28836 + showTSConfigCorrectly("Show TSConfig with paths and more", ["-p", "tsconfig.json"], { + compilerOptions: { + allowJs: true, + outDir: "./lib", + esModuleInterop: true, + module: "commonjs", + moduleResolution: "node", + target: "ES2017", + sourceMap: true, + baseUrl: ".", + paths: { + "@root/*": ["./*"], + "@configs/*": ["src/configs/*"], + "@common/*": ["src/common/*"], + "*": [ + "node_modules/*", + "src/types/*" + ] + }, + experimentalDecorators: true, + emitDecoratorMetadata: true, + resolveJsonModule: true + }, + include: [ + "./src/**/*" + ] +}); + + // Bulk validation of all option declarations + for (const option of optionDeclarations) { + if (option.name === "project") continue; + let configObject: object | undefined; + let args: string[]; + switch (option.type) { + case "boolean": { + if (option.isTSConfigOnly) { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: true } }; + } + else { + args = [`--${option.name}`]; + } + break; + } + case "list": { + if (option.isTSConfigOnly) { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: [] } }; + } + else { + args = [`--${option.name}`]; + } + break; + } + case "string": { + if (option.isTSConfigOnly) { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: "someString" } }; + } + else { + args = [`--${option.name}`, "someString"]; + } + break; + } + case "number": { + if (option.isTSConfigOnly) { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: 0 } }; + } + else { + args = [`--${option.name}`, "0"]; + } + break; + } + case "object": { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: {} } }; + break; + } + default: { + const val = option.type.keys().next().value; + if (option.isTSConfigOnly) { + args = ["-p", "tsconfig.json"]; + configObject = { compilerOptions: { [option.name]: val } }; + } + else { + args = [`--${option.name}`, val]; + } + break; + } + } + showTSConfigCorrectly(`Shows tsconfig for single option/${option.name}`, args, configObject); + } }); -} \ No newline at end of file +} diff --git a/tests/baselines/reference/showConfig/Show TSConfig with paths and more/tsconfig.json b/tests/baselines/reference/showConfig/Show TSConfig with paths and more/tsconfig.json new file mode 100644 index 00000000000..dc6c7ab7abb --- /dev/null +++ b/tests/baselines/reference/showConfig/Show TSConfig with paths and more/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "allowJs": true, + "outDir": "./lib", + "esModuleInterop": true, + "module": "commonjs", + "moduleResolution": "node", + "target": "es2017", + "sourceMap": true, + "baseUrl": "./", + "paths": { + "@root/*": [ + "./*" + ], + "@configs/*": [ + "src/configs/*" + ], + "@common/*": [ + "src/common/*" + ], + "*": [ + "node_modules/*", + "src/types/*" + ] + }, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "resolveJsonModule": true + }, + "include": [ + "./src/**/*" + ], + "exclude": [ + "./lib" + ] +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/all/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/all/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/all/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowJs/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowJs/tsconfig.json new file mode 100644 index 00000000000..30d4135f151 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowJs/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowJs": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowSyntheticDefaultImports/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowSyntheticDefaultImports/tsconfig.json new file mode 100644 index 00000000000..70f49aa0a08 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowSyntheticDefaultImports/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnreachableCode/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnreachableCode/tsconfig.json new file mode 100644 index 00000000000..689e956526d --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnreachableCode/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowUnreachableCode": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnusedLabels/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnusedLabels/tsconfig.json new file mode 100644 index 00000000000..2aeff65ad78 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/allowUnusedLabels/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "allowUnusedLabels": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/alwaysStrict/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/alwaysStrict/tsconfig.json new file mode 100644 index 00000000000..1a755fcd059 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/alwaysStrict/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "alwaysStrict": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/baseUrl/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/baseUrl/tsconfig.json new file mode 100644 index 00000000000..7f78d5d65ef --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/baseUrl/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "baseUrl": "./someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/build/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/build/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/build/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/charset/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/charset/tsconfig.json new file mode 100644 index 00000000000..2bc8201b661 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/charset/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "charset": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/checkJs/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/checkJs/tsconfig.json new file mode 100644 index 00000000000..21d7a1d2268 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/checkJs/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "checkJs": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/composite/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/composite/tsconfig.json new file mode 100644 index 00000000000..664df5f6051 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/composite/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "composite": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/declaration/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declaration/tsconfig.json new file mode 100644 index 00000000000..d5f8d1fb3f3 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declaration/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "declaration": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationDir/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationDir/tsconfig.json new file mode 100644 index 00000000000..00dee9b8473 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationDir/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "declarationDir": "./someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationMap/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationMap/tsconfig.json new file mode 100644 index 00000000000..2f7fcec4c90 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/declarationMap/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "declarationMap": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/diagnostics/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/diagnostics/tsconfig.json new file mode 100644 index 00000000000..212fa702823 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/diagnostics/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "diagnostics": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/disableSizeLimit/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/disableSizeLimit/tsconfig.json new file mode 100644 index 00000000000..e5099232b8e --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/disableSizeLimit/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "disableSizeLimit": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/downlevelIteration/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/downlevelIteration/tsconfig.json new file mode 100644 index 00000000000..2bcb5a9745d --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/downlevelIteration/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "downlevelIteration": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitBOM/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitBOM/tsconfig.json new file mode 100644 index 00000000000..6c6a91873e9 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitBOM/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "emitBOM": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDeclarationOnly/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDeclarationOnly/tsconfig.json new file mode 100644 index 00000000000..9149038f8a7 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDeclarationOnly/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "emitDeclarationOnly": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDecoratorMetadata/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDecoratorMetadata/tsconfig.json new file mode 100644 index 00000000000..f303570ba2e --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/emitDecoratorMetadata/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/esModuleInterop/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/esModuleInterop/tsconfig.json new file mode 100644 index 00000000000..a72ee3e88b6 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/esModuleInterop/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "esModuleInterop": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/experimentalDecorators/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/experimentalDecorators/tsconfig.json new file mode 100644 index 00000000000..cd4d4102338 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/experimentalDecorators/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/extendedDiagnostics/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/extendedDiagnostics/tsconfig.json new file mode 100644 index 00000000000..10ad78f2a26 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/extendedDiagnostics/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "extendedDiagnostics": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/forceConsistentCasingInFileNames/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/forceConsistentCasingInFileNames/tsconfig.json new file mode 100644 index 00000000000..88b1f317093 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/forceConsistentCasingInFileNames/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "forceConsistentCasingInFileNames": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/help/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/help/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/help/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/importHelpers/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/importHelpers/tsconfig.json new file mode 100644 index 00000000000..3a5ab7b4af0 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/importHelpers/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "importHelpers": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/init/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/init/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/init/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSourceMap/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSourceMap/tsconfig.json new file mode 100644 index 00000000000..40d719d22de --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSourceMap/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "inlineSourceMap": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSources/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSources/tsconfig.json new file mode 100644 index 00000000000..05467464c96 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/inlineSources/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "inlineSources": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/isolatedModules/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/isolatedModules/tsconfig.json new file mode 100644 index 00000000000..78df38c5439 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/isolatedModules/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "isolatedModules": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsx/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsx/tsconfig.json new file mode 100644 index 00000000000..94e40481a5a --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsx/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "jsx": "preserve" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsxFactory/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsxFactory/tsconfig.json new file mode 100644 index 00000000000..a2afa006410 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/jsxFactory/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "jsxFactory": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/keyofStringsOnly/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/keyofStringsOnly/tsconfig.json new file mode 100644 index 00000000000..7e60194af7d --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/keyofStringsOnly/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "keyofStringsOnly": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/lib/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/lib/tsconfig.json new file mode 100644 index 00000000000..786e75e66e9 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/lib/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "lib": [] + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/listEmittedFiles/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/listEmittedFiles/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/listEmittedFiles/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/listFiles/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/listFiles/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/listFiles/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/locale/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/locale/tsconfig.json new file mode 100644 index 00000000000..0ef23f45b2e --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/locale/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "locale": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/mapRoot/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/mapRoot/tsconfig.json new file mode 100644 index 00000000000..ed171f0c20c --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/mapRoot/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "mapRoot": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/maxNodeModuleJsDepth/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/maxNodeModuleJsDepth/tsconfig.json new file mode 100644 index 00000000000..d107c9ade31 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/maxNodeModuleJsDepth/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "maxNodeModuleJsDepth": 0 + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/module/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/module/tsconfig.json new file mode 100644 index 00000000000..e7f1c93b4cc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/module/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "module": "none" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/moduleResolution/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/moduleResolution/tsconfig.json new file mode 100644 index 00000000000..2476027cba2 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/moduleResolution/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "moduleResolution": "node" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/newLine/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/newLine/tsconfig.json new file mode 100644 index 00000000000..2c082971489 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/newLine/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "newLine": "crlf" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmit/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmit/tsconfig.json new file mode 100644 index 00000000000..5cdd4dcee48 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmit/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noEmit": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitHelpers/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitHelpers/tsconfig.json new file mode 100644 index 00000000000..479ed5f714f --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitHelpers/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noEmitHelpers": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitOnError/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitOnError/tsconfig.json new file mode 100644 index 00000000000..c6c00cae80c --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noEmitOnError/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noEmitOnError": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noErrorTruncation/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noErrorTruncation/tsconfig.json new file mode 100644 index 00000000000..a0b362f4cfa --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noErrorTruncation/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noErrorTruncation": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noFallthroughCasesInSwitch/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noFallthroughCasesInSwitch/tsconfig.json new file mode 100644 index 00000000000..eebdaaec717 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noFallthroughCasesInSwitch/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noFallthroughCasesInSwitch": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitAny/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitAny/tsconfig.json new file mode 100644 index 00000000000..d60b8dc04e5 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitAny/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noImplicitAny": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitReturns/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitReturns/tsconfig.json new file mode 100644 index 00000000000..3c2f0d2f749 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitReturns/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noImplicitReturns": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitThis/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitThis/tsconfig.json new file mode 100644 index 00000000000..a473dda4c19 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitThis/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noImplicitThis": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitUseStrict/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitUseStrict/tsconfig.json new file mode 100644 index 00000000000..d17f848b7de --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noImplicitUseStrict/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noImplicitUseStrict": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noLib/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noLib/tsconfig.json new file mode 100644 index 00000000000..695884aeb49 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noLib/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noLib": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noResolve/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noResolve/tsconfig.json new file mode 100644 index 00000000000..cd3adb3703b --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noResolve/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noResolve": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noStrictGenericChecks/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noStrictGenericChecks/tsconfig.json new file mode 100644 index 00000000000..d0c2dca70cf --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noStrictGenericChecks/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noStrictGenericChecks": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedLocals/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedLocals/tsconfig.json new file mode 100644 index 00000000000..650a347f895 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedLocals/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noUnusedLocals": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedParameters/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedParameters/tsconfig.json new file mode 100644 index 00000000000..340db0b6663 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/noUnusedParameters/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noUnusedParameters": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/out/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/out/tsconfig.json new file mode 100644 index 00000000000..8b802528282 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/out/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "out": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/outDir/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/outDir/tsconfig.json new file mode 100644 index 00000000000..7823bcf72b8 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/outDir/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "outDir": "./someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/outFile/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/outFile/tsconfig.json new file mode 100644 index 00000000000..db851ac2fda --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/outFile/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "outFile": "./someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/paths/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/paths/tsconfig.json new file mode 100644 index 00000000000..c73368aa743 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/paths/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "paths": {} + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/plugins/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/plugins/tsconfig.json new file mode 100644 index 00000000000..2b1d90ccaf1 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/plugins/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "plugins": [] + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveConstEnums/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveConstEnums/tsconfig.json new file mode 100644 index 00000000000..9d6a1ec3011 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveConstEnums/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "preserveConstEnums": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveSymlinks/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveSymlinks/tsconfig.json new file mode 100644 index 00000000000..c0614df69b4 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveSymlinks/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "preserveSymlinks": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveWatchOutput/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveWatchOutput/tsconfig.json new file mode 100644 index 00000000000..79b91a4add5 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/preserveWatchOutput/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "preserveWatchOutput": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/pretty/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/pretty/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/pretty/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/project/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/project/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/project/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/reactNamespace/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/reactNamespace/tsconfig.json new file mode 100644 index 00000000000..e3d6898ae9f --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/reactNamespace/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "reactNamespace": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/removeComments/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/removeComments/tsconfig.json new file mode 100644 index 00000000000..f1b2574762f --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/removeComments/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "removeComments": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/resolveJsonModule/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/resolveJsonModule/tsconfig.json new file mode 100644 index 00000000000..65c3994d510 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/resolveJsonModule/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "resolveJsonModule": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDir/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDir/tsconfig.json new file mode 100644 index 00000000000..11eee2d8daf --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDir/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "rootDir": "./someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDirs/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDirs/tsconfig.json new file mode 100644 index 00000000000..a2ce2057041 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/rootDirs/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "rootDirs": [] + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/showConfig/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/showConfig/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/showConfig/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipDefaultLibCheck/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipDefaultLibCheck/tsconfig.json new file mode 100644 index 00000000000..44c0e79ee7e --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipDefaultLibCheck/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "skipDefaultLibCheck": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipLibCheck/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipLibCheck/tsconfig.json new file mode 100644 index 00000000000..2c4213127d9 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/skipLibCheck/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "skipLibCheck": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceMap/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceMap/tsconfig.json new file mode 100644 index 00000000000..13573aec246 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceMap/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "sourceMap": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceRoot/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceRoot/tsconfig.json new file mode 100644 index 00000000000..f0f481c3de5 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/sourceRoot/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "sourceRoot": "someString" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strict/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strict/tsconfig.json new file mode 100644 index 00000000000..8dc142972f8 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strict/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strict": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictBindCallApply/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictBindCallApply/tsconfig.json new file mode 100644 index 00000000000..765755da04a --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictBindCallApply/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictBindCallApply": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictFunctionTypes/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictFunctionTypes/tsconfig.json new file mode 100644 index 00000000000..95be94130db --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictFunctionTypes/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictFunctionTypes": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictNullChecks/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictNullChecks/tsconfig.json new file mode 100644 index 00000000000..c4d430eb449 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictNullChecks/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictNullChecks": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictPropertyInitialization/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictPropertyInitialization/tsconfig.json new file mode 100644 index 00000000000..a743e1332cb --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/strictPropertyInitialization/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictPropertyInitialization": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/stripInternal/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/stripInternal/tsconfig.json new file mode 100644 index 00000000000..19e614d7378 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/stripInternal/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "stripInternal": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressExcessPropertyErrors/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressExcessPropertyErrors/tsconfig.json new file mode 100644 index 00000000000..67287716230 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressExcessPropertyErrors/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "suppressExcessPropertyErrors": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressImplicitAnyIndexErrors/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressImplicitAnyIndexErrors/tsconfig.json new file mode 100644 index 00000000000..ee0dedd44e2 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/suppressImplicitAnyIndexErrors/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "suppressImplicitAnyIndexErrors": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/target/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/target/tsconfig.json new file mode 100644 index 00000000000..7e6010a661a --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/target/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "target": "es3" + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/traceResolution/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/traceResolution/tsconfig.json new file mode 100644 index 00000000000..658a24dd18c --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/traceResolution/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "traceResolution": true + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/typeRoots/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/typeRoots/tsconfig.json new file mode 100644 index 00000000000..5704323b7a5 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/typeRoots/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "typeRoots": [] + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/types/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/types/tsconfig.json new file mode 100644 index 00000000000..56d9d8ed347 --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/types/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "types": [] + } +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/version/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/version/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/version/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} diff --git a/tests/baselines/reference/showConfig/Shows tsconfig for single option/watch/tsconfig.json b/tests/baselines/reference/showConfig/Shows tsconfig for single option/watch/tsconfig.json new file mode 100644 index 00000000000..cd727e8ccdc --- /dev/null +++ b/tests/baselines/reference/showConfig/Shows tsconfig for single option/watch/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compilerOptions": {} +} From 174816fc2608adece8fd1f831bb3b9054e22835d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 4 Dec 2018 17:59:20 -0800 Subject: [PATCH 101/322] Added error for IdentifierStart immediately after a NumericLiteral Fixes #4702. --- src/compiler/diagnosticMessages.json | 4 + src/compiler/scanner.ts | 10 + .../reference/bigIntWithTargetES3.errors.txt | 23 +- .../reference/bigintIndex.errors.txt | 22 +- .../reference/bigintWithLib.errors.txt | 49 +++- .../reference/bigintWithoutLib.errors.txt | 68 +++-- ...ntifierStartAfterNumericLiteral.errors.txt | 74 +++++ .../identifierStartAfterNumericLiteral.js | 35 +++ ...identifierStartAfterNumericLiteral.symbols | 16 ++ .../identifierStartAfterNumericLiteral.types | 56 ++++ .../numberVsBigIntOperations.errors.txt | 254 +++++++++++++++++- ...ralsWithTrailingDecimalPoints01.errors.txt | 12 +- .../reference/parseBigInt.errors.txt | 71 ++++- ...umericSeparators.binaryNegative.errors.txt | 6 +- ...r.numericSeparators.hexNegative.errors.txt | 6 +- ...numericSeparators.octalNegative.errors.txt | 6 +- .../tsxAttributeInvalidNames.errors.txt | 5 +- .../identifierStartAfterNumericLiteral.ts | 13 + 18 files changed, 643 insertions(+), 87 deletions(-) create mode 100644 tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt create mode 100644 tests/baselines/reference/identifierStartAfterNumericLiteral.js create mode 100644 tests/baselines/reference/identifierStartAfterNumericLiteral.symbols create mode 100644 tests/baselines/reference/identifierStartAfterNumericLiteral.types create mode 100644 tests/cases/compiler/identifierStartAfterNumericLiteral.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e3f8e1a7ad5..b7aaaf02742 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1011,6 +1011,10 @@ "category": "Message", "code": 1350 }, + "An identifier cannot follow a numeric literal.": { + "category": "Error", + "code": 1351 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 9eedfeefb53..3762eaa91fa 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -974,7 +974,10 @@ namespace ts { else { result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } + + checkForIdentifierAfterNumericLiteral(); if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { + checkForIdentifierAfterNumericLiteral(); return { type: SyntaxKind.NumericLiteral, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -983,10 +986,17 @@ namespace ts { else { tokenValue = result; const type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint + checkForIdentifierAfterNumericLiteral(); return { type, value: tokenValue }; } } + function checkForIdentifierAfterNumericLiteral() { + if (isIdentifierStart(text.charCodeAt(pos), languageVersion)) { + error(Diagnostics.An_identifier_cannot_follow_a_numeric_literal, pos, 1); + } + } + function scanOctalDigits(): number { const start = pos; while (isOctalDigit(text.charCodeAt(pos))) { diff --git a/tests/baselines/reference/bigIntWithTargetES3.errors.txt b/tests/baselines/reference/bigIntWithTargetES3.errors.txt index 6fa938535f1..ed65939999a 100644 --- a/tests/baselines/reference/bigIntWithTargetES3.errors.txt +++ b/tests/baselines/reference/bigIntWithTargetES3.errors.txt @@ -1,21 +1,18 @@ -tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigIntWithTargetES3.ts(3,27): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigIntWithTargetES3.ts(4,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigIntWithTargetES3.ts(5,25): error TS1351: An identifier cannot follow a numeric literal. -==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ==== +==== tests/cases/compiler/bigIntWithTargetES3.ts (3 errors) ==== const normalNumber = 123; // should not error let bigintType: bigint; // should not error let bigintLiteralType: 123n; // should not error when used as type + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. let bigintNegativeLiteralType: -123n; // should not error when used as type + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error - ~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~~~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. \ No newline at end of file diff --git a/tests/baselines/reference/bigintIndex.errors.txt b/tests/baselines/reference/bigintIndex.errors.txt index 50e360a1905..628e2b683be 100644 --- a/tests/baselines/reference/bigintIndex.errors.txt +++ b/tests/baselines/reference/bigintIndex.errors.txt @@ -1,19 +1,21 @@ -tests/cases/compiler/a.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/compiler/a.ts(8,11): error TS2538: Type '1n' cannot be used as an index type. +tests/cases/compiler/a.ts(8,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/a.ts(14,1): error TS2322: Type '123n' is not assignable to type 'string | number | symbol'. +tests/cases/compiler/a.ts(14,10): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/a.ts(17,25): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/a.ts(19,12): error TS2538: Type 'bigint' cannot be used as an index type. tests/cases/compiler/b.ts(2,12): error TS1136: Property assignment expected. +tests/cases/compiler/b.ts(2,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/b.ts(2,14): error TS1005: ';' expected. tests/cases/compiler/b.ts(2,19): error TS1128: Declaration or statement expected. tests/cases/compiler/b.ts(3,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. +tests/cases/compiler/b.ts(3,14): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/compiler/a.ts (4 errors) ==== +==== tests/cases/compiler/a.ts (6 errors) ==== interface BigIntIndex { [index: bigint]: E; // should error - ~~~~~ -!!! error TS1023: An index signature parameter type must be 'string' or 'number'. } const arr: number[] = [1, 2, 3]; @@ -22,6 +24,8 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be num = arr[1n]; // should error ~~ !!! error TS2538: Type '1n' cannot be used as an index type. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. let key: keyof any; // should be type "string | number | symbol" key = 123; @@ -30,9 +34,13 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be key = 123n; // should error ~~~ !!! error TS2322: Type '123n' is not assignable to type 'string | number | symbol'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Show correct usage of bigint index: explicitly convert to string const bigNum: bigint = 0n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const typedArray = new Uint8Array(3); typedArray[bigNum] = 0xAA; // should error ~~~~~~ @@ -42,11 +50,13 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be typedArray[2] = 0xCC; // {1n: 123} is a syntax error; must go in separate file so BigIntIndex error is shown -==== tests/cases/compiler/b.ts (5 errors) ==== +==== tests/cases/compiler/b.ts (7 errors) ==== // BigInt cannot be used as an object literal property const a = {1n: 123}; ~~ !!! error TS1136: Property assignment expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~ !!! error TS1005: ';' expected. ~ @@ -54,6 +64,8 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be const b = {[1n]: 456}; ~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const c = {[bigNum]: 789}; ~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 993f43d5a05..7ae0be26a21 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,15 +1,30 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. +tests/cases/compiler/bigintWithLib.ts(15,35): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(15,39): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(15,43): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. +tests/cases/compiler/bigintWithLib.ts(27,37): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(27,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(27,45): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. +tests/cases/compiler/bigintWithLib.ts(38,27): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(39,27): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. +tests/cases/compiler/bigintWithLib.ts(41,29): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(42,29): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. +tests/cases/compiler/bigintWithLib.ts(50,13): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(51,14): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(52,12): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(52,18): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot follow a numeric literal. -==== tests/cases/compiler/bigintWithLib.ts (7 errors) ==== +==== tests/cases/compiler/bigintWithLib.ts (22 errors) ==== // Test BigInt functions let bigintVal: bigint = BigInt(123); bigintVal = BigInt("456"); @@ -27,6 +42,12 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 let bigIntArray: BigInt64Array = new BigInt64Array(); bigIntArray = new BigInt64Array(10); bigIntArray = new BigInt64Array([1n, 2n, 3n]); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~ !!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. @@ -44,6 +65,12 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 let bigUintArray: BigUint64Array = new BigUint64Array(); bigUintArray = new BigUint64Array(10); bigUintArray = new BigUint64Array([1n, 2n, 3n]); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~ !!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. @@ -60,12 +87,20 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 // Test added DataView methods const dataView = new DataView(new ArrayBuffer(80)); dataView.setBigInt64(1, -1n); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1n, true); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1); // should error ~~ !!! error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. dataView.setBigUint64(2, 123n); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123n, true); + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123); // should error ~~~ !!! error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -76,6 +111,16 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 // Test emitted declarations files const w = 12n; // should emit as const w = 12n + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const x = -12n; // should emit as const x = -12n + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const y: 12n = 12n; // should emit type 12n - let z = 12n; // should emit type bigint in declaration file \ No newline at end of file + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + let z = 12n; // should emit type bigint in declaration file + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. \ No newline at end of file diff --git a/tests/baselines/reference/bigintWithoutLib.errors.txt b/tests/baselines/reference/bigintWithoutLib.errors.txt index 7d2c38b29df..3210ce58042 100644 --- a/tests/baselines/reference/bigintWithoutLib.errors.txt +++ b/tests/baselines/reference/bigintWithoutLib.errors.txt @@ -2,18 +2,16 @@ tests/cases/compiler/bigintWithoutLib.ts(4,25): error TS2304: Cannot find name ' tests/cases/compiler/bigintWithoutLib.ts(5,13): error TS2304: Cannot find name 'BigInt'. tests/cases/compiler/bigintWithoutLib.ts(6,5): error TS2304: Cannot find name 'BigInt'. tests/cases/compiler/bigintWithoutLib.ts(7,13): error TS2304: Cannot find name 'BigInt'. -tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2304: Cannot find name 'BigInt'. -tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(9,1): error TS2322: Type 'Object' is not assignable to type 'bigint'. tests/cases/compiler/bigintWithoutLib.ts(11,13): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/bigintWithoutLib.ts(15,18): error TS2304: Cannot find name 'BigInt64Array'. tests/cases/compiler/bigintWithoutLib.ts(15,38): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(16,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(17,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? -tests/cases/compiler/bigintWithoutLib.ts(17,34): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigintWithoutLib.ts(17,38): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigintWithoutLib.ts(17,42): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(17,35): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(17,39): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(17,43): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(18,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(19,19): error TS2304: Cannot find name 'BigInt64Array'. tests/cases/compiler/bigintWithoutLib.ts(20,19): error TS2304: Cannot find name 'BigInt64Array'. @@ -22,22 +20,22 @@ tests/cases/compiler/bigintWithoutLib.ts(27,19): error TS2304: Cannot find name tests/cases/compiler/bigintWithoutLib.ts(27,40): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(28,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(29,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(29,36): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigintWithoutLib.ts(29,40): error TS2737: BigInt literals are not available when targeting lower than ESNext. -tests/cases/compiler/bigintWithoutLib.ts(29,44): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(29,37): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(29,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(29,45): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(30,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(31,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(32,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(33,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(40,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(40,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(40,27): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(41,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(41,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(41,27): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(42,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(43,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(43,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(43,29): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(44,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(44,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(44,29): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithoutLib.ts(45,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(46,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(47,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. @@ -45,7 +43,7 @@ tests/cases/compiler/bigintWithoutLib.ts(48,22): error TS2339: Property 'getBigU tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. -==== tests/cases/compiler/bigintWithoutLib.ts (45 errors) ==== +==== tests/cases/compiler/bigintWithoutLib.ts (43 errors) ==== // Every line should error because these builtins are not declared // Test BigInt functions @@ -61,13 +59,9 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU bigintVal = BigInt.asIntN(8, 0xFFFFn); ~~~~~~ !!! error TS2304: Cannot find name 'BigInt'. - ~~~~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigintVal = BigInt.asUintN(8, 0xFFFFn); ~~~~~~ !!! error TS2304: Cannot find name 'BigInt'. - ~~~~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigintVal = bigintVal.valueOf(); // should error - bigintVal inferred as {} ~~~~~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'bigint'. @@ -92,12 +86,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU ~~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? !!! related TS2728 tests/cases/compiler/bigintWithoutLib.ts:15:5: 'bigIntArray' is declared here. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigIntArray = new BigInt64Array([1, 2, 3]); ~~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? @@ -127,12 +121,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU bigUintArray = new BigUint64Array([1n, 2n, 3n]); ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'BigUint64Array'. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigUintArray = new BigUint64Array([1, 2, 3]); ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'BigUint64Array'. @@ -154,26 +148,26 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU dataView.setBigInt64(1, -1n); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1n, true); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. - ~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. dataView.setBigUint64(2, 123n); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. - ~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123n, true); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. - ~~~~ -!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt new file mode 100644 index 00000000000..03e408a6486 --- /dev/null +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt @@ -0,0 +1,74 @@ +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(1,16): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS2538: Type 'null' cannot be used as an index type. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,3): error TS2304: Cannot find name 'n'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS2304: Cannot find name 'e'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,3): error TS1005: ';' expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS2304: Cannot find name 'a'. + + +==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (19 errors) ==== + let valueIn = 3in[null]; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + + 3a[null] + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS2304: Cannot find name 'a'. + 3e[null] + +!!! error TS1124: Digit expected. + ~~~~ +!!! error TS2538: Type 'null' cannot be used as an index type. + 3in[null] + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + 3en[null] + +!!! error TS1124: Digit expected. + ~ +!!! error TS2304: Cannot find name 'n'. + 1a + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS2304: Cannot find name 'a'. + 1e + +!!! error TS1124: Digit expected. + 1e9 + 1ee + +!!! error TS1124: Digit expected. + ~ +!!! error TS2304: Cannot find name 'e'. + 1n + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + 2n2 + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1005: ';' expected. + 2na + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS2304: Cannot find name 'a'. + \ No newline at end of file diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.js b/tests/baselines/reference/identifierStartAfterNumericLiteral.js new file mode 100644 index 00000000000..0ec84716c2c --- /dev/null +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.js @@ -0,0 +1,35 @@ +//// [identifierStartAfterNumericLiteral.ts] +let valueIn = 3in[null]; + +3a[null] +3e[null] +3in[null] +3en[null] +1a +1e +1e9 +1ee +1n +2n2 +2na + + +//// [identifierStartAfterNumericLiteral.js] +var valueIn = 3 in [null]; +3; +a[null]; +3e[null]; +3 in [null]; +3e; +n[null]; +1; +a; +1e; +1e9; +1e; +e; +1n; +2n; +2; +2n; +a; diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols b/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols new file mode 100644 index 00000000000..71b253dbecc --- /dev/null +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/identifierStartAfterNumericLiteral.ts === +let valueIn = 3in[null]; +>valueIn : Symbol(valueIn, Decl(identifierStartAfterNumericLiteral.ts, 0, 3)) + +3a[null] +3e[null] +3in[null] +3en[null] +1a +1e +1e9 +1ee +1n +2n2 +2na + diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.types b/tests/baselines/reference/identifierStartAfterNumericLiteral.types new file mode 100644 index 00000000000..b31c9ee8d11 --- /dev/null +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.types @@ -0,0 +1,56 @@ +=== tests/cases/compiler/identifierStartAfterNumericLiteral.ts === +let valueIn = 3in[null]; +>valueIn : boolean +>3in[null] : boolean +>3 : 3 +>[null] : null[] +>null : null + +3a[null] +>3 : 3 +>a[null] : any +>a : any +>null : null + +3e[null] +>3e[null] : any +>3e : 3 +>null : null + +3in[null] +>3in[null] : boolean +>3 : 3 +>[null] : null[] +>null : null + +3en[null] +>3e : 3 +>n[null] : any +>n : any +>null : null + +1a +>1 : 1 +>a : any + +1e +>1e : 1 + +1e9 +>1e9 : 1000000000 + +1ee +>1e : 1 +>e : any + +1n +>1n : 1n + +2n2 +>2n : 2n +>2 : 2 + +2na +>2n : 2n +>a : any + diff --git a/tests/baselines/reference/numberVsBigIntOperations.errors.txt b/tests/baselines/reference/numberVsBigIntOperations.errors.txt index fbd49ddd091..7f97bcc78a6 100644 --- a/tests/baselines/reference/numberVsBigIntOperations.errors.txt +++ b/tests/baselines/reference/numberVsBigIntOperations.errors.txt @@ -1,51 +1,124 @@ +tests/cases/compiler/numberVsBigIntOperations.ts(2,15): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(3,11): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(3,14): error TS2322: Type '2' is not assignable to type 'bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(3,26): error TS2322: Type '1n' is not assignable to type 'number'. +tests/cases/compiler/numberVsBigIntOperations.ts(3,33): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(4,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(4,15): error TS2365: Operator '+=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(4,28): error TS2365: Operator '+=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(4,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(5,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(5,15): error TS2365: Operator '-=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(5,28): error TS2365: Operator '-=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(5,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(6,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(6,15): error TS2365: Operator '*=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(6,28): error TS2365: Operator '*=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(6,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(7,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(7,15): error TS2365: Operator '/=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(7,28): error TS2365: Operator '/=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(7,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(8,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(8,15): error TS2365: Operator '%=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(8,28): error TS2365: Operator '%=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(8,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(9,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(9,16): error TS2365: Operator '**=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(9,30): error TS2365: Operator '**=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(9,39): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(10,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(10,16): error TS2365: Operator '<<=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(10,30): error TS2365: Operator '<<=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(10,39): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(11,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(11,16): error TS2365: Operator '>>=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(11,30): error TS2365: Operator '>>=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(11,39): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(12,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(12,15): error TS2365: Operator '&=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(12,28): error TS2365: Operator '&=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(12,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(13,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(13,15): error TS2365: Operator '^=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(13,28): error TS2365: Operator '^=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(13,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(14,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(14,15): error TS2365: Operator '|=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(14,28): error TS2365: Operator '|=' cannot be applied to types 'number' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(14,36): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(15,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(15,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(15,32): error TS2365: Operator '+' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(15,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(15,40): error TS2365: Operator '+' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(15,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(16,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(16,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(16,32): error TS2365: Operator '-' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(16,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(16,40): error TS2365: Operator '-' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(16,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(17,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(17,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(17,32): error TS2365: Operator '*' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(17,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(17,40): error TS2365: Operator '*' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(17,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(18,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(18,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(18,32): error TS2365: Operator '/' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(18,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(18,40): error TS2365: Operator '/' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(18,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(19,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(19,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(19,32): error TS2365: Operator '%' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(19,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(19,40): error TS2365: Operator '%' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(19,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(20,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(20,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(20,34): error TS2365: Operator '**' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(20,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(20,43): error TS2365: Operator '**' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(20,44): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(21,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(21,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(21,32): error TS2365: Operator '&' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(21,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(21,40): error TS2365: Operator '&' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(21,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(22,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(22,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(22,32): error TS2365: Operator '|' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(22,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(22,40): error TS2365: Operator '|' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(22,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(23,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(23,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(23,32): error TS2365: Operator '^' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(23,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(23,40): error TS2365: Operator '^' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(23,41): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(24,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(24,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(24,34): error TS2365: Operator '<<' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(24,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(24,43): error TS2365: Operator '<<' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(24,44): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(25,11): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(25,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(25,34): error TS2365: Operator '>>' cannot be applied to types '1' and '2n'. +tests/cases/compiler/numberVsBigIntOperations.ts(25,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(25,43): error TS2365: Operator '>>' cannot be applied to types '1n' and '2'. +tests/cases/compiler/numberVsBigIntOperations.ts(25,44): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(29,37): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(29,68): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(38,1): error TS2365: Operator '>>>=' cannot be applied to types 'bigint' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(38,14): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(39,10): error TS2365: Operator '>>>' cannot be applied to types 'bigint' and '1n'. +tests/cases/compiler/numberVsBigIntOperations.ts(39,22): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(40,8): error TS2736: Operator '+' cannot be applied to type 'bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(50,10): error TS2367: This condition will always return 'false' since the types 'bigint' and 'number' have no overlap. tests/cases/compiler/numberVsBigIntOperations.ts(51,10): error TS2367: This condition will always return 'true' since the types 'bigint' and 'number' have no overlap. @@ -55,137 +128,286 @@ tests/cases/compiler/numberVsBigIntOperations.ts(56,7): error TS2362: The left-h tests/cases/compiler/numberVsBigIntOperations.ts(56,27): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(57,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(57,1): error TS2365: Operator '&' cannot be applied to types '"3"' and '5n'. +tests/cases/compiler/numberVsBigIntOperations.ts(57,8): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(57,11): error TS2365: Operator '**' cannot be applied to types '2n' and 'false'. +tests/cases/compiler/numberVsBigIntOperations.ts(57,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(57,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(60,1): error TS2365: Operator '+' cannot be applied to types 'number | bigint' and 'number | bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(61,1): error TS2365: Operator '<<' cannot be applied to types 'number | bigint' and 'number | bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(70,2): error TS2736: Operator '+' cannot be applied to type 'number | bigint'. -tests/cases/compiler/numberVsBigIntOperations.ts(86,7): error TS1155: 'const' declarations must be initialized. -tests/cases/compiler/numberVsBigIntOperations.ts(93,7): error TS1155: 'const' declarations must be initialized. +tests/cases/compiler/numberVsBigIntOperations.ts(84,22): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(84,27): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(84,47): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(84,52): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(86,26): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(91,24): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(93,22): error TS1351: An identifier cannot follow a numeric literal. -==== tests/cases/compiler/numberVsBigIntOperations.ts (64 errors) ==== +==== tests/cases/compiler/numberVsBigIntOperations.ts (144 errors) ==== // Cannot mix bigints and numbers let bigInt = 1n, num = 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n; bigInt = 2; num = 1n; num = 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2322: Type '2' is not assignable to type 'bigint'. ~~~ !!! error TS2322: Type '1n' is not assignable to type 'number'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt += 1n; bigInt += 2; num += 1n; num += 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt -= 1n; bigInt -= 2; num -= 1n; num -= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '-=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '-=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt *= 1n; bigInt *= 2; num *= 1n; num *= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '*=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '*=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt /= 1n; bigInt /= 2; num /= 1n; num /= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '/=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '/=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt %= 1n; bigInt %= 2; num %= 1n; num %= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '%=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '%=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt **= 1n; bigInt **= 2; num **= 1n; num **= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '**=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '**=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt <<= 1n; bigInt <<= 2; num <<= 1n; num <<= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '<<=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '<<=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt >>= 1n; bigInt >>= 2; num >>= 1n; num >>= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '>>=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '>>=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt &= 1n; bigInt &= 2; num &= 1n; num &= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '&=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '&=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt ^= 1n; bigInt ^= 2; num ^= 1n; num ^= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '^=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '^=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt |= 1n; bigInt |= 2; num |= 1n; num |= 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '|=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '|=' cannot be applied to types 'number' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n + 2n; num = 1 + 2; 1 + 2n; 1n + 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n - 2n; num = 1 - 2; 1 - 2n; 1n - 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '-' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '-' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n * 2n; num = 1 * 2; 1 * 2n; 1n * 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '*' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '*' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n / 2n; num = 1 / 2; 1 / 2n; 1n / 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '/' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '/' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n % 2n; num = 1 % 2; 1 % 2n; 1n % 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '%' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '%' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n ** 2n; num = 1 ** 2; 1 ** 2n; 1n ** 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n & 2n; num = 1 & 2; 1 & 2n; 1n & 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n | 2n; num = 1 | 2; 1 | 2n; 1n | 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '|' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '|' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n ^ 2n; num = 1 ^ 2; 1 ^ 2n; 1n ^ 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '^' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '^' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n << 2n; num = 1 << 2; 1 << 2n; 1n << 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '<<' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '<<' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n >> 2n; num = 1 >> 2; 1 >> 2n; 1n >> 2; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '>>' cannot be applied to types '1' and '2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '>>' cannot be applied to types '1n' and '2'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Plus should still coerce to strings let str: string; str = "abc" + 123; str = "abc" + 123n; str = 123 + "abc"; str = 123n + "abc"; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Unary operations allowed on bigints and numbers bigInt = bigInt++; bigInt = ++bigInt; num = num++; num = ++num; @@ -197,9 +419,13 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,7): error TS1155: 'const' de bigInt >>>= 1n; num >>>= 2; ~~~~~~~~~~~~~~ !!! error TS2365: Operator '>>>=' cannot be applied to types 'bigint' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = bigInt >>> 1n; num = num >>> 2; ~~~~~~~~~~~~~ !!! error TS2365: Operator '>>>' cannot be applied to types 'bigint' and '1n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. num = +bigInt; num = +num; num = +"3"; ~~~~~~ !!! error TS2736: Operator '+' cannot be applied to type 'bigint'. @@ -236,8 +462,12 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,7): error TS1155: 'const' de !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. ~~~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '"3"' and '5n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '2n' and 'false'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. num = ~"3"; num = -false; // should infer number @@ -273,17 +503,27 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,7): error TS1155: 'const' de // Distinguishing numbers from bigints with typeof const isBigInt: (x: 0n | 1n) => bigint = (x: 0n | 1n) => x; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const isNumber: (x: 0 | 1) => number = (x: 0 | 1) => x; const zeroOrBigOne: 0 | 1n; - ~~~~~~~~~~~~ -!!! error TS1155: 'const' declarations must be initialized. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. if (typeof zeroOrBigOne === "bigint") isBigInt(zeroOrBigOne); else isNumber(zeroOrBigOne); // Distinguishing truthy from falsy const isOne = (x: 1 | 1n) => x; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. if (zeroOrBigOne) isOne(zeroOrBigOne); const bigZeroOrOne: 0n | 1; - ~~~~~~~~~~~~ -!!! error TS1155: 'const' declarations must be initialized. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. if (bigZeroOrOne) isOne(bigZeroOrOne); \ No newline at end of file diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt index ca85c992fa4..42561707d56 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1005: ';' expected. -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1005: ',' expected. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,23): error TS1005: ',' expected. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error TS1109: Expression expected. @@ -8,16 +8,16 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error 1..toString(); 1.0.toString(); 1.toString(); - ~~~~~~~~ -!!! error TS1005: ';' expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. 1.+2.0 + 3. ; // Preserve whitespace where important for JS compatibility var i: number = 1; var test1 = i.toString(); var test2 = 2.toString(); - ~~~~~~~~ -!!! error TS1005: ',' expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index 9c273542c0b..df4d9dce4aa 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,40 +1,65 @@ +tests/cases/compiler/parseBigInt.ts(5,32): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(11,38): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(17,33): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(42,17): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(43,18): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(46,17): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(46,23): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(47,22): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'. +tests/cases/compiler/parseBigInt.ts(51,23): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(57,25): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(58,22): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(59,28): error TS1005: ',' expected. +tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(58,22): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(59,28): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(60,23): error TS1177: Binary digit expected. tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected. tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected. tests/cases/compiler/parseBigInt.ts(63,26): error TS2304: Cannot find name '_123n'. tests/cases/compiler/parseBigInt.ts(64,30): error TS6188: Numeric separators are not allowed here. +tests/cases/compiler/parseBigInt.ts(64,31): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(65,33): error TS6189: Multiple consecutive numeric separators are not permitted. +tests/cases/compiler/parseBigInt.ts(65,37): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(68,28): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(68,33): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(68,38): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(68,58): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(69,15): error TS2345: Argument of type '0n' is not assignable to parameter of type '1n | 3n | 2n'. +tests/cases/compiler/parseBigInt.ts(69,16): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(69,35): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(69,54): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(69,73): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(70,15): error TS2345: Argument of type '0' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,34): error TS2345: Argument of type '1' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,53): error TS2345: Argument of type '2' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' is not assignable to parameter of type '1n | 3n | 2n'. -==== tests/cases/compiler/parseBigInt.ts (17 errors) ==== +==== tests/cases/compiler/parseBigInt.ts (36 errors) ==== // All bases should allow "n" suffix const bin = 0b101, binBig = 0b101n; // 5, 5n const oct = 0o567, octBig = 0o567n; // 375, 375n const hex = 0xC0B, hexBig = 0xC0Bn; // 3083, 3083n const dec = 123, decBig = 123n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Test literals whose values overflow a 53-bit integer // These should be represented exactly in the emitted JS const largeBin = 0b10101010101010101010101010101010101010101010101010101010101n; // 384307168202282325n const largeOct = 0o123456712345671234567n; // 1505852261029722487n const largeDec = 12345678091234567890n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const largeHex = 0x1234567890abcdefn; // 1311768467294899695n // Test literals with separators const separatedBin = 0b010_10_1n; // 21n const separatedOct = 0o1234_567n; // 342391n const separatedDec = 123_456_789n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const separatedHex = 0x0_abcdefn; // 11259375n // Test parsing literals of different bit sizes @@ -60,17 +85,29 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i // Test negative literals const neg = -123n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const negHex: -16n = -0x10n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Test normalization of bigints -- all of these should succeed const negZero: 0n = -0n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const baseChange: 255n = 0xFFn; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const leadingZeros: 0xFFn = 0x000000FFn; // Plus not allowed on literals const unaryPlus = +123n; ~~~~ !!! error TS2736: Operator '+' cannot be applied to type '123n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const unaryPlusHex = +0x123n; ~~~~~~ !!! error TS2736: Operator '+' cannot be applied to type '291n'. @@ -82,13 +119,13 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i !!! error TS1005: ',' expected. { const scientific = 1e2n; } ~ -!!! error TS1005: ',' expected. +!!! error TS1351: An identifier cannot follow a numeric literal. { const decimal = 4.1n; } ~ -!!! error TS1005: ',' expected. +!!! error TS1351: An identifier cannot follow a numeric literal. { const leadingDecimal = .1n; } ~ -!!! error TS1005: ',' expected. +!!! error TS1351: An identifier cannot follow a numeric literal. const emptyBinary = 0bn; // should error but infer 0n !!! error TS1177: Binary digit expected. @@ -104,15 +141,35 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i const trailingSeparator = 123_n; ~ !!! error TS6188: Numeric separators are not allowed here. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. const doubleSeparator = 123_456__789n; ~ !!! error TS6189: Multiple consecutive numeric separators are not permitted. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. // Using literals as types const oneTwoOrThree = (x: 1n | 2n | 3n): bigint => x ** 2n; + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. oneTwoOrThree(0n); oneTwoOrThree(1n); oneTwoOrThree(2n); oneTwoOrThree(3n); ~~ !!! error TS2345: Argument of type '0n' is not assignable to parameter of type '1n | 3n | 2n'. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. oneTwoOrThree(0); oneTwoOrThree(1); oneTwoOrThree(2); oneTwoOrThree(3); ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '1n | 3n | 2n'. diff --git a/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt index 15e08088b1e..bff028ba704 100644 --- a/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'B0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_B0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~~~~~ -!!! error TS1005: ';' expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'B0101'. diff --git a/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt index 2fe62bc06d3..3aca519e572 100644 --- a/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'X0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_X0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~~~~~ -!!! error TS1005: ';' expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'X0101'. diff --git a/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt index e4c05472106..58c1363b7ba 100644 --- a/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'O0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_O0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~~~~~ -!!! error TS1005: ';' expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'O0101'. diff --git a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt index e83b588ef76..65b2fc23803 100644 --- a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt +++ b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt @@ -1,4 +1,5 @@ tests/cases/conformance/jsx/file.tsx(10,8): error TS1003: Identifier expected. +tests/cases/conformance/jsx/file.tsx(10,10): error TS1351: An identifier cannot follow a numeric literal. tests/cases/conformance/jsx/file.tsx(10,10): error TS1005: ';' expected. tests/cases/conformance/jsx/file.tsx(10,10): error TS2304: Cannot find name 'data'. tests/cases/conformance/jsx/file.tsx(10,15): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -12,7 +13,7 @@ tests/cases/conformance/jsx/file.tsx(11,13): error TS1005: ';' expected. tests/cases/conformance/jsx/file.tsx(11,20): error TS1161: Unterminated regular expression literal. -==== tests/cases/conformance/jsx/file.tsx (12 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (13 errors) ==== declare module JSX { interface Element { } interface IntrinsicElements { @@ -25,6 +26,8 @@ tests/cases/conformance/jsx/file.tsx(11,20): error TS1161: Unterminated regular ; ~~ !!! error TS1003: Identifier expected. + ~ +!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~ !!! error TS1005: ';' expected. ~~~~ diff --git a/tests/cases/compiler/identifierStartAfterNumericLiteral.ts b/tests/cases/compiler/identifierStartAfterNumericLiteral.ts new file mode 100644 index 00000000000..80e4760e11b --- /dev/null +++ b/tests/cases/compiler/identifierStartAfterNumericLiteral.ts @@ -0,0 +1,13 @@ +let valueIn = 3in[null]; + +3a[null] +3e[null] +3in[null] +3en[null] +1a +1e +1e9 +1ee +1n +2n2 +2na From 51d10ee4a0acc3afbb8815cdf4e5fcac312c8c6b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 4 Dec 2018 18:29:58 -0800 Subject: [PATCH 102/322] Removed excess new check --- src/compiler/scanner.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 3762eaa91fa..1589cca8357 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -975,9 +975,8 @@ namespace ts { result = text.substring(start, end); // No need to use all the fragments; no _ removal needed } - checkForIdentifierAfterNumericLiteral(); if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { - checkForIdentifierAfterNumericLiteral(); + checkForIdentifierStartAfterNumericLiteral(); return { type: SyntaxKind.NumericLiteral, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -986,12 +985,12 @@ namespace ts { else { tokenValue = result; const type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint - checkForIdentifierAfterNumericLiteral(); + checkForIdentifierStartAfterNumericLiteral(); return { type, value: tokenValue }; } } - function checkForIdentifierAfterNumericLiteral() { + function checkForIdentifierStartAfterNumericLiteral() { if (isIdentifierStart(text.charCodeAt(pos), languageVersion)) { error(Diagnostics.An_identifier_cannot_follow_a_numeric_literal, pos, 1); } From 31fca3af4d432112516d699163456fc070a590f8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 4 Dec 2018 18:33:06 -0800 Subject: [PATCH 103/322] Accepted new baselines --- .../reference/bigIntWithTargetES3.errors.txt | 23 +- .../reference/bigintIndex.errors.txt | 22 +- .../reference/bigintWithLib.errors.txt | 49 +--- .../reference/bigintWithoutLib.errors.txt | 68 ++--- ...ntifierStartAfterNumericLiteral.errors.txt | 11 +- .../numberVsBigIntOperations.errors.txt | 254 +----------------- .../reference/parseBigInt.errors.txt | 59 +--- 7 files changed, 66 insertions(+), 420 deletions(-) diff --git a/tests/baselines/reference/bigIntWithTargetES3.errors.txt b/tests/baselines/reference/bigIntWithTargetES3.errors.txt index ed65939999a..6fa938535f1 100644 --- a/tests/baselines/reference/bigIntWithTargetES3.errors.txt +++ b/tests/baselines/reference/bigIntWithTargetES3.errors.txt @@ -1,18 +1,21 @@ -tests/cases/compiler/bigIntWithTargetES3.ts(3,27): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigIntWithTargetES3.ts(4,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigIntWithTargetES3.ts(5,25): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ESNext. -==== tests/cases/compiler/bigIntWithTargetES3.ts (3 errors) ==== +==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ==== const normalNumber = 123; // should not error let bigintType: bigint; // should not error let bigintLiteralType: 123n; // should not error when used as type - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. let bigintNegativeLiteralType: -123n; // should not error when used as type - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~~~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. \ No newline at end of file diff --git a/tests/baselines/reference/bigintIndex.errors.txt b/tests/baselines/reference/bigintIndex.errors.txt index 628e2b683be..50e360a1905 100644 --- a/tests/baselines/reference/bigintIndex.errors.txt +++ b/tests/baselines/reference/bigintIndex.errors.txt @@ -1,21 +1,19 @@ +tests/cases/compiler/a.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'. tests/cases/compiler/a.ts(8,11): error TS2538: Type '1n' cannot be used as an index type. -tests/cases/compiler/a.ts(8,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/a.ts(14,1): error TS2322: Type '123n' is not assignable to type 'string | number | symbol'. -tests/cases/compiler/a.ts(14,10): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/a.ts(17,25): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/a.ts(19,12): error TS2538: Type 'bigint' cannot be used as an index type. tests/cases/compiler/b.ts(2,12): error TS1136: Property assignment expected. -tests/cases/compiler/b.ts(2,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/b.ts(2,14): error TS1005: ';' expected. tests/cases/compiler/b.ts(2,19): error TS1128: Declaration or statement expected. tests/cases/compiler/b.ts(3,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -tests/cases/compiler/b.ts(3,14): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. -==== tests/cases/compiler/a.ts (6 errors) ==== +==== tests/cases/compiler/a.ts (4 errors) ==== interface BigIntIndex { [index: bigint]: E; // should error + ~~~~~ +!!! error TS1023: An index signature parameter type must be 'string' or 'number'. } const arr: number[] = [1, 2, 3]; @@ -24,8 +22,6 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be num = arr[1n]; // should error ~~ !!! error TS2538: Type '1n' cannot be used as an index type. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. let key: keyof any; // should be type "string | number | symbol" key = 123; @@ -34,13 +30,9 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be key = 123n; // should error ~~~ !!! error TS2322: Type '123n' is not assignable to type 'string | number | symbol'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Show correct usage of bigint index: explicitly convert to string const bigNum: bigint = 0n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const typedArray = new Uint8Array(3); typedArray[bigNum] = 0xAA; // should error ~~~~~~ @@ -50,13 +42,11 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be typedArray[2] = 0xCC; // {1n: 123} is a syntax error; must go in separate file so BigIntIndex error is shown -==== tests/cases/compiler/b.ts (7 errors) ==== +==== tests/cases/compiler/b.ts (5 errors) ==== // BigInt cannot be used as an object literal property const a = {1n: 123}; ~~ !!! error TS1136: Property assignment expected. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~ !!! error TS1005: ';' expected. ~ @@ -64,8 +54,6 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be const b = {[1n]: 456}; ~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const c = {[bigNum]: 789}; ~~~~~~~~ !!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 7ae0be26a21..993f43d5a05 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,30 +1,15 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. -tests/cases/compiler/bigintWithLib.ts(15,35): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(15,39): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(15,43): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(27,37): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(27,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(27,45): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. -tests/cases/compiler/bigintWithLib.ts(38,27): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(39,27): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. -tests/cases/compiler/bigintWithLib.ts(41,29): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(42,29): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. -tests/cases/compiler/bigintWithLib.ts(50,13): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(51,14): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(52,12): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(52,18): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot follow a numeric literal. -==== tests/cases/compiler/bigintWithLib.ts (22 errors) ==== +==== tests/cases/compiler/bigintWithLib.ts (7 errors) ==== // Test BigInt functions let bigintVal: bigint = BigInt(123); bigintVal = BigInt("456"); @@ -42,12 +27,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot let bigIntArray: BigInt64Array = new BigInt64Array(); bigIntArray = new BigInt64Array(10); bigIntArray = new BigInt64Array([1n, 2n, 3n]); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigIntArray = new BigInt64Array([1, 2, 3]); // should error ~~~~~~~~~ !!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. @@ -65,12 +44,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot let bigUintArray: BigUint64Array = new BigUint64Array(); bigUintArray = new BigUint64Array(10); bigUintArray = new BigUint64Array([1n, 2n, 3n]); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigUintArray = new BigUint64Array([1, 2, 3]); // should error ~~~~~~~~~ !!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. @@ -87,20 +60,12 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot // Test added DataView methods const dataView = new DataView(new ArrayBuffer(80)); dataView.setBigInt64(1, -1n); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1n, true); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigInt64(1, -1); // should error ~~ !!! error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. dataView.setBigUint64(2, 123n); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123n, true); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. dataView.setBigUint64(2, 123); // should error ~~~ !!! error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -111,16 +76,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot // Test emitted declarations files const w = 12n; // should emit as const w = 12n - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const x = -12n; // should emit as const x = -12n - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const y: 12n = 12n; // should emit type 12n - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - let z = 12n; // should emit type bigint in declaration file - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. \ No newline at end of file + let z = 12n; // should emit type bigint in declaration file \ No newline at end of file diff --git a/tests/baselines/reference/bigintWithoutLib.errors.txt b/tests/baselines/reference/bigintWithoutLib.errors.txt index 3210ce58042..7d2c38b29df 100644 --- a/tests/baselines/reference/bigintWithoutLib.errors.txt +++ b/tests/baselines/reference/bigintWithoutLib.errors.txt @@ -2,16 +2,18 @@ tests/cases/compiler/bigintWithoutLib.ts(4,25): error TS2304: Cannot find name ' tests/cases/compiler/bigintWithoutLib.ts(5,13): error TS2304: Cannot find name 'BigInt'. tests/cases/compiler/bigintWithoutLib.ts(6,5): error TS2304: Cannot find name 'BigInt'. tests/cases/compiler/bigintWithoutLib.ts(7,13): error TS2304: Cannot find name 'BigInt'. +tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2304: Cannot find name 'BigInt'. +tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(9,1): error TS2322: Type 'Object' is not assignable to type 'bigint'. tests/cases/compiler/bigintWithoutLib.ts(11,13): error TS2554: Expected 0 arguments, but got 1. tests/cases/compiler/bigintWithoutLib.ts(15,18): error TS2304: Cannot find name 'BigInt64Array'. tests/cases/compiler/bigintWithoutLib.ts(15,38): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(16,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(17,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? -tests/cases/compiler/bigintWithoutLib.ts(17,35): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithoutLib.ts(17,39): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithoutLib.ts(17,43): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(17,34): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(17,38): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(17,42): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(18,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? tests/cases/compiler/bigintWithoutLib.ts(19,19): error TS2304: Cannot find name 'BigInt64Array'. tests/cases/compiler/bigintWithoutLib.ts(20,19): error TS2304: Cannot find name 'BigInt64Array'. @@ -20,22 +22,22 @@ tests/cases/compiler/bigintWithoutLib.ts(27,19): error TS2304: Cannot find name tests/cases/compiler/bigintWithoutLib.ts(27,40): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(28,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(29,20): error TS2304: Cannot find name 'BigUint64Array'. -tests/cases/compiler/bigintWithoutLib.ts(29,37): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithoutLib.ts(29,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/bigintWithoutLib.ts(29,45): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(29,36): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(29,40): error TS2737: BigInt literals are not available when targeting lower than ESNext. +tests/cases/compiler/bigintWithoutLib.ts(29,44): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(30,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(31,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(32,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(33,20): error TS2304: Cannot find name 'BigUint64Array'. tests/cases/compiler/bigintWithoutLib.ts(40,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(40,27): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(40,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(41,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(41,27): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(41,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(42,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(43,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(43,29): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(43,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(44,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. -tests/cases/compiler/bigintWithoutLib.ts(44,29): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/bigintWithoutLib.ts(44,26): error TS2737: BigInt literals are not available when targeting lower than ESNext. tests/cases/compiler/bigintWithoutLib.ts(45,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(46,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. tests/cases/compiler/bigintWithoutLib.ts(47,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'. @@ -43,7 +45,7 @@ tests/cases/compiler/bigintWithoutLib.ts(48,22): error TS2339: Property 'getBigU tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigUint64' does not exist on type 'DataView'. -==== tests/cases/compiler/bigintWithoutLib.ts (43 errors) ==== +==== tests/cases/compiler/bigintWithoutLib.ts (45 errors) ==== // Every line should error because these builtins are not declared // Test BigInt functions @@ -59,9 +61,13 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU bigintVal = BigInt.asIntN(8, 0xFFFFn); ~~~~~~ !!! error TS2304: Cannot find name 'BigInt'. + ~~~~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigintVal = BigInt.asUintN(8, 0xFFFFn); ~~~~~~ !!! error TS2304: Cannot find name 'BigInt'. + ~~~~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigintVal = bigintVal.valueOf(); // should error - bigintVal inferred as {} ~~~~~~~~~ !!! error TS2322: Type 'Object' is not assignable to type 'bigint'. @@ -86,12 +92,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU ~~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? !!! related TS2728 tests/cases/compiler/bigintWithoutLib.ts:15:5: 'bigIntArray' is declared here. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigIntArray = new BigInt64Array([1, 2, 3]); ~~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'? @@ -121,12 +127,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU bigUintArray = new BigUint64Array([1n, 2n, 3n]); ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'BigUint64Array'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. bigUintArray = new BigUint64Array([1, 2, 3]); ~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'BigUint64Array'. @@ -148,26 +154,26 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU dataView.setBigInt64(1, -1n); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. dataView.setBigInt64(1, -1n, true); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. dataView.setBigInt64(1, -1); ~~~~~~~~~~~ !!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'. dataView.setBigUint64(2, 123n); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. dataView.setBigUint64(2, 123n, true); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~ +!!! error TS2737: BigInt literals are not available when targeting lower than ESNext. dataView.setBigUint64(2, 123); ~~~~~~~~~~~~ !!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'. diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt index 03e408a6486..130e676d0d1 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt @@ -11,15 +11,12 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS2304: C tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,3): error TS1124: Digit expected. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS1124: Digit expected. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS2304: Cannot find name 'e'. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,2): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,3): error TS1005: ';' expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,2): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS2304: Cannot find name 'a'. -==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (19 errors) ==== +==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (16 errors) ==== let valueIn = 3in[null]; ~ !!! error TS1351: An identifier cannot follow a numeric literal. @@ -57,16 +54,10 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS2304: ~ !!! error TS2304: Cannot find name 'e'. 1n - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. 2n2 - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~ !!! error TS1005: ';' expected. 2na - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~ !!! error TS1351: An identifier cannot follow a numeric literal. ~ diff --git a/tests/baselines/reference/numberVsBigIntOperations.errors.txt b/tests/baselines/reference/numberVsBigIntOperations.errors.txt index 7f97bcc78a6..fbd49ddd091 100644 --- a/tests/baselines/reference/numberVsBigIntOperations.errors.txt +++ b/tests/baselines/reference/numberVsBigIntOperations.errors.txt @@ -1,124 +1,51 @@ -tests/cases/compiler/numberVsBigIntOperations.ts(2,15): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(3,11): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(3,14): error TS2322: Type '2' is not assignable to type 'bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(3,26): error TS2322: Type '1n' is not assignable to type 'number'. -tests/cases/compiler/numberVsBigIntOperations.ts(3,33): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(4,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(4,15): error TS2365: Operator '+=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(4,28): error TS2365: Operator '+=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(4,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(5,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(5,15): error TS2365: Operator '-=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(5,28): error TS2365: Operator '-=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(5,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(6,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(6,15): error TS2365: Operator '*=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(6,28): error TS2365: Operator '*=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(6,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(7,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(7,15): error TS2365: Operator '/=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(7,28): error TS2365: Operator '/=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(7,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(8,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(8,15): error TS2365: Operator '%=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(8,28): error TS2365: Operator '%=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(8,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(9,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(9,16): error TS2365: Operator '**=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(9,30): error TS2365: Operator '**=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(9,39): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(10,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(10,16): error TS2365: Operator '<<=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(10,30): error TS2365: Operator '<<=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(10,39): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(11,13): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(11,16): error TS2365: Operator '>>=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(11,30): error TS2365: Operator '>>=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(11,39): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(12,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(12,15): error TS2365: Operator '&=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(12,28): error TS2365: Operator '&=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(12,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(13,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(13,15): error TS2365: Operator '^=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(13,28): error TS2365: Operator '^=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(13,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(14,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(14,15): error TS2365: Operator '|=' cannot be applied to types 'bigint' and '2'. tests/cases/compiler/numberVsBigIntOperations.ts(14,28): error TS2365: Operator '|=' cannot be applied to types 'number' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(14,36): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(15,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(15,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(15,32): error TS2365: Operator '+' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(15,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(15,40): error TS2365: Operator '+' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(15,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(16,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(16,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(16,32): error TS2365: Operator '-' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(16,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(16,40): error TS2365: Operator '-' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(16,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(17,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(17,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(17,32): error TS2365: Operator '*' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(17,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(17,40): error TS2365: Operator '*' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(17,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(18,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(18,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(18,32): error TS2365: Operator '/' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(18,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(18,40): error TS2365: Operator '/' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(18,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(19,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(19,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(19,32): error TS2365: Operator '%' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(19,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(19,40): error TS2365: Operator '%' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(19,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(20,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(20,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(20,34): error TS2365: Operator '**' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(20,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(20,43): error TS2365: Operator '**' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(20,44): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(21,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(21,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(21,32): error TS2365: Operator '&' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(21,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(21,40): error TS2365: Operator '&' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(21,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(22,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(22,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(22,32): error TS2365: Operator '|' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(22,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(22,40): error TS2365: Operator '|' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(22,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(23,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(23,16): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(23,32): error TS2365: Operator '^' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(23,37): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(23,40): error TS2365: Operator '^' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(23,41): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(24,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(24,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(24,34): error TS2365: Operator '<<' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(24,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(24,43): error TS2365: Operator '<<' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(24,44): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(25,11): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(25,17): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(25,34): error TS2365: Operator '>>' cannot be applied to types '1' and '2n'. -tests/cases/compiler/numberVsBigIntOperations.ts(25,40): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(25,43): error TS2365: Operator '>>' cannot be applied to types '1n' and '2'. -tests/cases/compiler/numberVsBigIntOperations.ts(25,44): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(29,37): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(29,68): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(38,1): error TS2365: Operator '>>>=' cannot be applied to types 'bigint' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(38,14): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(39,10): error TS2365: Operator '>>>' cannot be applied to types 'bigint' and '1n'. -tests/cases/compiler/numberVsBigIntOperations.ts(39,22): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(40,8): error TS2736: Operator '+' cannot be applied to type 'bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(50,10): error TS2367: This condition will always return 'false' since the types 'bigint' and 'number' have no overlap. tests/cases/compiler/numberVsBigIntOperations.ts(51,10): error TS2367: This condition will always return 'true' since the types 'bigint' and 'number' have no overlap. @@ -128,286 +55,137 @@ tests/cases/compiler/numberVsBigIntOperations.ts(56,7): error TS2362: The left-h tests/cases/compiler/numberVsBigIntOperations.ts(56,27): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(57,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(57,1): error TS2365: Operator '&' cannot be applied to types '"3"' and '5n'. -tests/cases/compiler/numberVsBigIntOperations.ts(57,8): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(57,11): error TS2365: Operator '**' cannot be applied to types '2n' and 'false'. -tests/cases/compiler/numberVsBigIntOperations.ts(57,12): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/numberVsBigIntOperations.ts(57,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/compiler/numberVsBigIntOperations.ts(60,1): error TS2365: Operator '+' cannot be applied to types 'number | bigint' and 'number | bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(61,1): error TS2365: Operator '<<' cannot be applied to types 'number | bigint' and 'number | bigint'. tests/cases/compiler/numberVsBigIntOperations.ts(70,2): error TS2736: Operator '+' cannot be applied to type 'number | bigint'. -tests/cases/compiler/numberVsBigIntOperations.ts(84,22): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(84,27): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(84,47): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(84,52): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(86,26): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(91,24): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numberVsBigIntOperations.ts(93,22): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numberVsBigIntOperations.ts(86,7): error TS1155: 'const' declarations must be initialized. +tests/cases/compiler/numberVsBigIntOperations.ts(93,7): error TS1155: 'const' declarations must be initialized. -==== tests/cases/compiler/numberVsBigIntOperations.ts (144 errors) ==== +==== tests/cases/compiler/numberVsBigIntOperations.ts (64 errors) ==== // Cannot mix bigints and numbers let bigInt = 1n, num = 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n; bigInt = 2; num = 1n; num = 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2322: Type '2' is not assignable to type 'bigint'. ~~~ !!! error TS2322: Type '1n' is not assignable to type 'number'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt += 1n; bigInt += 2; num += 1n; num += 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt -= 1n; bigInt -= 2; num -= 1n; num -= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '-=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '-=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt *= 1n; bigInt *= 2; num *= 1n; num *= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '*=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '*=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt /= 1n; bigInt /= 2; num /= 1n; num /= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '/=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '/=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt %= 1n; bigInt %= 2; num %= 1n; num %= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '%=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '%=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt **= 1n; bigInt **= 2; num **= 1n; num **= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '**=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '**=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt <<= 1n; bigInt <<= 2; num <<= 1n; num <<= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '<<=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '<<=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt >>= 1n; bigInt >>= 2; num >>= 1n; num >>= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~~ !!! error TS2365: Operator '>>=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~~ !!! error TS2365: Operator '>>=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt &= 1n; bigInt &= 2; num &= 1n; num &= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '&=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '&=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt ^= 1n; bigInt ^= 2; num ^= 1n; num ^= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '^=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '^=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt |= 1n; bigInt |= 2; num |= 1n; num |= 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '|=' cannot be applied to types 'bigint' and '2'. ~~~~~~~~~ !!! error TS2365: Operator '|=' cannot be applied to types 'number' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n + 2n; num = 1 + 2; 1 + 2n; 1n + 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n - 2n; num = 1 - 2; 1 - 2n; 1n - 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '-' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '-' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n * 2n; num = 1 * 2; 1 * 2n; 1n * 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '*' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '*' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n / 2n; num = 1 / 2; 1 / 2n; 1n / 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '/' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '/' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n % 2n; num = 1 % 2; 1 % 2n; 1n % 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '%' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '%' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n ** 2n; num = 1 ** 2; 1 ** 2n; 1n ** 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n & 2n; num = 1 & 2; 1 & 2n; 1n & 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n | 2n; num = 1 | 2; 1 | 2n; 1n | 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '|' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '|' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n ^ 2n; num = 1 ^ 2; 1 ^ 2n; 1n ^ 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '^' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~ !!! error TS2365: Operator '^' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n << 2n; num = 1 << 2; 1 << 2n; 1n << 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '<<' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '<<' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = 1n >> 2n; num = 1 >> 2; 1 >> 2n; 1n >> 2; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '>>' cannot be applied to types '1' and '2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~ !!! error TS2365: Operator '>>' cannot be applied to types '1n' and '2'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Plus should still coerce to strings let str: string; str = "abc" + 123; str = "abc" + 123n; str = 123 + "abc"; str = 123n + "abc"; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Unary operations allowed on bigints and numbers bigInt = bigInt++; bigInt = ++bigInt; num = num++; num = ++num; @@ -419,13 +197,9 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,22): error TS1351: An identi bigInt >>>= 1n; num >>>= 2; ~~~~~~~~~~~~~~ !!! error TS2365: Operator '>>>=' cannot be applied to types 'bigint' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. bigInt = bigInt >>> 1n; num = num >>> 2; ~~~~~~~~~~~~~ !!! error TS2365: Operator '>>>' cannot be applied to types 'bigint' and '1n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. num = +bigInt; num = +num; num = +"3"; ~~~~~~ !!! error TS2736: Operator '+' cannot be applied to type 'bigint'. @@ -462,12 +236,8 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,22): error TS1351: An identi !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. ~~~~~~~~ !!! error TS2365: Operator '&' cannot be applied to types '"3"' and '5n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~~~~~~~ !!! error TS2365: Operator '**' cannot be applied to types '2n' and 'false'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. num = ~"3"; num = -false; // should infer number @@ -503,27 +273,17 @@ tests/cases/compiler/numberVsBigIntOperations.ts(93,22): error TS1351: An identi // Distinguishing numbers from bigints with typeof const isBigInt: (x: 0n | 1n) => bigint = (x: 0n | 1n) => x; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const isNumber: (x: 0 | 1) => number = (x: 0 | 1) => x; const zeroOrBigOne: 0 | 1n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~~~~~~~~ +!!! error TS1155: 'const' declarations must be initialized. if (typeof zeroOrBigOne === "bigint") isBigInt(zeroOrBigOne); else isNumber(zeroOrBigOne); // Distinguishing truthy from falsy const isOne = (x: 1 | 1n) => x; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. if (zeroOrBigOne) isOne(zeroOrBigOne); const bigZeroOrOne: 0n | 1; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~~~~~~~~ +!!! error TS1155: 'const' declarations must be initialized. if (bigZeroOrOne) isOne(bigZeroOrOne); \ No newline at end of file diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index df4d9dce4aa..77d8b55ed98 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,13 +1,4 @@ -tests/cases/compiler/parseBigInt.ts(5,32): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(11,38): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(17,33): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(42,17): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(43,18): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(46,17): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(46,23): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(47,22): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'. -tests/cases/compiler/parseBigInt.ts(51,23): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier cannot follow a numeric literal. @@ -18,48 +9,32 @@ tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected. tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected. tests/cases/compiler/parseBigInt.ts(63,26): error TS2304: Cannot find name '_123n'. tests/cases/compiler/parseBigInt.ts(64,30): error TS6188: Numeric separators are not allowed here. -tests/cases/compiler/parseBigInt.ts(64,31): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(65,33): error TS6189: Multiple consecutive numeric separators are not permitted. -tests/cases/compiler/parseBigInt.ts(65,37): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(68,28): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(68,33): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(68,38): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(68,58): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(69,15): error TS2345: Argument of type '0n' is not assignable to parameter of type '1n | 3n | 2n'. -tests/cases/compiler/parseBigInt.ts(69,16): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(69,35): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(69,54): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(69,73): error TS1351: An identifier cannot follow a numeric literal. tests/cases/compiler/parseBigInt.ts(70,15): error TS2345: Argument of type '0' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,34): error TS2345: Argument of type '1' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,53): error TS2345: Argument of type '2' is not assignable to parameter of type '1n | 3n | 2n'. tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' is not assignable to parameter of type '1n | 3n | 2n'. -==== tests/cases/compiler/parseBigInt.ts (36 errors) ==== +==== tests/cases/compiler/parseBigInt.ts (17 errors) ==== // All bases should allow "n" suffix const bin = 0b101, binBig = 0b101n; // 5, 5n const oct = 0o567, octBig = 0o567n; // 375, 375n const hex = 0xC0B, hexBig = 0xC0Bn; // 3083, 3083n const dec = 123, decBig = 123n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Test literals whose values overflow a 53-bit integer // These should be represented exactly in the emitted JS const largeBin = 0b10101010101010101010101010101010101010101010101010101010101n; // 384307168202282325n const largeOct = 0o123456712345671234567n; // 1505852261029722487n const largeDec = 12345678091234567890n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const largeHex = 0x1234567890abcdefn; // 1311768467294899695n // Test literals with separators const separatedBin = 0b010_10_1n; // 21n const separatedOct = 0o1234_567n; // 342391n const separatedDec = 123_456_789n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const separatedHex = 0x0_abcdefn; // 11259375n // Test parsing literals of different bit sizes @@ -85,29 +60,17 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i // Test negative literals const neg = -123n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const negHex: -16n = -0x10n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Test normalization of bigints -- all of these should succeed const negZero: 0n = -0n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const baseChange: 255n = 0xFFn; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const leadingZeros: 0xFFn = 0x000000FFn; // Plus not allowed on literals const unaryPlus = +123n; ~~~~ !!! error TS2736: Operator '+' cannot be applied to type '123n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const unaryPlusHex = +0x123n; ~~~~~~ !!! error TS2736: Operator '+' cannot be applied to type '291n'. @@ -141,35 +104,15 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i const trailingSeparator = 123_n; ~ !!! error TS6188: Numeric separators are not allowed here. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. const doubleSeparator = 123_456__789n; ~ !!! error TS6189: Multiple consecutive numeric separators are not permitted. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. // Using literals as types const oneTwoOrThree = (x: 1n | 2n | 3n): bigint => x ** 2n; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. oneTwoOrThree(0n); oneTwoOrThree(1n); oneTwoOrThree(2n); oneTwoOrThree(3n); ~~ !!! error TS2345: Argument of type '0n' is not assignable to parameter of type '1n | 3n | 2n'. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. oneTwoOrThree(0); oneTwoOrThree(1); oneTwoOrThree(2); oneTwoOrThree(3); ~ !!! error TS2345: Argument of type '0' is not assignable to parameter of type '1n | 3n | 2n'. From 676d8af43acb38a5519d3db00dd7ec7e33c02b78 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 5 Dec 2018 11:46:06 -0800 Subject: [PATCH 104/322] Only infer from constituents with matching discriminants in unions --- src/compiler/checker.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ed44d8b4140..f76f1b318e9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12473,10 +12473,10 @@ namespace ts { return propertiesIdenticalTo(source, target); } const requireOptionalProperties = relation === subtypeRelation && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source); - const unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties); + const unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false); if (unmatchedProperty) { if (reportErrors) { - const props = arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties)); + const props = arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false)); if (!headMessage || (headMessage.code !== Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)) { suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it @@ -13900,7 +13900,7 @@ namespace ts { return getTypeFromInference(inference); } - function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean) { + function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean) { const properties = target.flags & TypeFlags.Intersection ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); for (const targetProp of properties) { if (requireOptionalProperties || !(targetProp.flags & SymbolFlags.Optional)) { @@ -13908,12 +13908,21 @@ namespace ts { if (!sourceProp) { yield targetProp; } + else if (matchDiscriminantProperties) { + const targetType = getTypeOfSymbol(targetProp); + if (targetType.flags & TypeFlags.Unit) { + const sourceType = getTypeOfSymbol(sourceProp); + if (!(sourceType.flags & TypeFlags.Any || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { + yield targetProp; + } + } + } } } } - function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean): Symbol | undefined { - return getUnmatchedProperties(source, target, requireOptionalProperties).next().value; + function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean, matchDiscriminantProperties: boolean): Symbol | undefined { + return getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next().value; } function tupleTypesDefinitelyUnrelated(source: TupleTypeReference, target: TupleTypeReference) { @@ -13925,7 +13934,8 @@ namespace ts { // Two tuple types with incompatible arities are definitely unrelated. // Two object types that each have a property that is unmatched in the other are definitely unrelated. return isTupleType(source) && isTupleType(target) && tupleTypesDefinitelyUnrelated(source, target) || - !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false) && !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false); + !!getUnmatchedProperty(source, target, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true) && + !!getUnmatchedProperty(target, source, /*requireOptionalProperties*/ false, /*matchDiscriminantProperties*/ true); } function getTypeFromInference(inference: InferenceInfo) { From 3fe72631ce6293a9b8336ff6a913b4f275e079bb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 5 Dec 2018 15:02:00 -0800 Subject: [PATCH 105/322] Added test case for trivia preceding dot in numeric LHS in property accesses. --- .../cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts index b24b174db2c..4e8e3529f3a 100644 --- a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts +++ b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts @@ -16,3 +16,4 @@ var test7 = 3 .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3. +var test10 = 0 /* any comment */.toString(); From 87e45f9e04ea19cb6d6d8fbd6074eced98dbc96e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 5 Dec 2018 15:02:15 -0800 Subject: [PATCH 106/322] Accepted baselines. --- .../numericLiteralsWithTrailingDecimalPoints01.errors.txt | 1 + .../numericLiteralsWithTrailingDecimalPoints01.js | 2 ++ .../numericLiteralsWithTrailingDecimalPoints01.symbols | 5 +++++ .../numericLiteralsWithTrailingDecimalPoints01.types | 7 +++++++ 4 files changed, 15 insertions(+) diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt index ca85c992fa4..c1484b2da66 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt @@ -30,4 +30,5 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3. + var test10 = 0 /* any comment */.toString(); \ No newline at end of file diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js index efa7ae96cf2..62e40a94e22 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js @@ -16,6 +16,7 @@ var test7 = 3 .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3. +var test10 = 0 /* any comment */.toString(); //// [numericLiteralsWithTrailingDecimalPoints01.js] @@ -37,3 +38,4 @@ var test7 = 3 .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3.; +var test10 = 0 /* any comment */..toString(); diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols index 76bbea5a195..39ef3b1c0be 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols @@ -61,3 +61,8 @@ var test8 = new Number(4).toString(); var test9 = 3. + 3. >test9 : Symbol(test9, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 16, 3)) +var test10 = 0 /* any comment */.toString(); +>test10 : Symbol(test10, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 17, 3)) +>0 /* any comment */.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types index f9fe9b49280..839f03ce420 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types @@ -94,3 +94,10 @@ var test9 = 3. + 3. >3. : 3 >3. : 3 +var test10 = 0 /* any comment */.toString(); +>test10 : string +>0 /* any comment */.toString() : string +>0 /* any comment */.toString : (radix?: number) => string +>0 : 0 +>toString : (radix?: number) => string + From 2f7cf9e26c2d29dc48041e1f1122159c03e4f19e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 5 Dec 2018 15:20:12 -0800 Subject: [PATCH 107/322] Accept new baselines --- .../baselines/reference/genericRestParameters3.errors.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/genericRestParameters3.errors.txt b/tests/baselines/reference/genericRestParameters3.errors.txt index f9af3c54555..cd9f677c549 100644 --- a/tests/baselines/reference/genericRestParameters3.errors.txt +++ b/tests/baselines/reference/genericRestParameters3.errors.txt @@ -22,8 +22,8 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(31,21): error TS234 Property '0' is missing in type 'CoolArray' but required in type '[(...args: any[]) => void]'. tests/cases/conformance/types/rest/genericRestParameters3.ts(38,32): error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray'. Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray'. -tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray'. - Property 'hello' is missing in type '[]' but required in type 'CoolArray'. +tests/cases/conformance/types/rest/genericRestParameters3.ts(43,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'. + Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'. tests/cases/conformance/types/rest/genericRestParameters3.ts(44,5): error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<{}>'. Property 'hello' is missing in type '[number]' but required in type 'CoolArray<{}>'. tests/cases/conformance/types/rest/genericRestParameters3.ts(45,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<{}>'. @@ -115,8 +115,8 @@ tests/cases/conformance/types/rest/genericRestParameters3.ts(53,5): error TS2345 baz(); // Error ~~~~~ -!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray'. -!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray'. +!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<{}>'. +!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray<{}>'. !!! related TS2728 tests/cases/conformance/types/rest/genericRestParameters3.ts:24:5: 'hello' is declared here. baz(1); // Error ~ From 4ae0848bd4acc1e26b97ca39bd2c3fae4ed08ac3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 5 Dec 2018 15:20:21 -0800 Subject: [PATCH 108/322] Add tests --- .../discriminatedUnionInference.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts b/tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts new file mode 100644 index 00000000000..8009ae23537 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts @@ -0,0 +1,21 @@ +// @strict: true + +// Repro from #28862 + +type Foo = { type: "foo", (): A[] }; +type Bar = { type: "bar", (): A }; + +type FooBar = Foo | Bar; + +type InferA = T extends FooBar ? A : never; + +type FooA = InferA>; // number + +// Repro from #28862 + +type Item = { kind: 'a', data: T } | { kind: 'b', data: T[] }; + +declare function foo(item: Item): T; + +let x1 = foo({ kind: 'a', data: 42 }); // number +let x2 = foo({ kind: 'b', data: [1, 2] }); // number From 1896248ff23aaf10a3d438752453ab7ba2046cc9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 5 Dec 2018 15:20:31 -0800 Subject: [PATCH 109/322] Accept new baselines --- .../reference/discriminatedUnionInference.js | 27 ++++++++ .../discriminatedUnionInference.symbols | 68 +++++++++++++++++++ .../discriminatedUnionInference.types | 55 +++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 tests/baselines/reference/discriminatedUnionInference.js create mode 100644 tests/baselines/reference/discriminatedUnionInference.symbols create mode 100644 tests/baselines/reference/discriminatedUnionInference.types diff --git a/tests/baselines/reference/discriminatedUnionInference.js b/tests/baselines/reference/discriminatedUnionInference.js new file mode 100644 index 00000000000..df45edeb237 --- /dev/null +++ b/tests/baselines/reference/discriminatedUnionInference.js @@ -0,0 +1,27 @@ +//// [discriminatedUnionInference.ts] +// Repro from #28862 + +type Foo = { type: "foo", (): A[] }; +type Bar = { type: "bar", (): A }; + +type FooBar = Foo | Bar; + +type InferA = T extends FooBar ? A : never; + +type FooA = InferA>; // number + +// Repro from #28862 + +type Item = { kind: 'a', data: T } | { kind: 'b', data: T[] }; + +declare function foo(item: Item): T; + +let x1 = foo({ kind: 'a', data: 42 }); // number +let x2 = foo({ kind: 'b', data: [1, 2] }); // number + + +//// [discriminatedUnionInference.js] +"use strict"; +// Repro from #28862 +var x1 = foo({ kind: 'a', data: 42 }); // number +var x2 = foo({ kind: 'b', data: [1, 2] }); // number diff --git a/tests/baselines/reference/discriminatedUnionInference.symbols b/tests/baselines/reference/discriminatedUnionInference.symbols new file mode 100644 index 00000000000..d8643b7ba6a --- /dev/null +++ b/tests/baselines/reference/discriminatedUnionInference.symbols @@ -0,0 +1,68 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts === +// Repro from #28862 + +type Foo = { type: "foo", (): A[] }; +>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 2, 9)) +>type : Symbol(type, Decl(discriminatedUnionInference.ts, 2, 15)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 2, 9)) + +type Bar = { type: "bar", (): A }; +>Bar : Symbol(Bar, Decl(discriminatedUnionInference.ts, 2, 39)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 3, 9)) +>type : Symbol(type, Decl(discriminatedUnionInference.ts, 3, 15)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 3, 9)) + +type FooBar = Foo | Bar; +>FooBar : Symbol(FooBar, Decl(discriminatedUnionInference.ts, 3, 37)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12)) +>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12)) +>Bar : Symbol(Bar, Decl(discriminatedUnionInference.ts, 2, 39)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 5, 12)) + +type InferA = T extends FooBar ? A : never; +>InferA : Symbol(InferA, Decl(discriminatedUnionInference.ts, 5, 33)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 7, 12)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 7, 12)) +>FooBar : Symbol(FooBar, Decl(discriminatedUnionInference.ts, 3, 37)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 7, 39)) +>A : Symbol(A, Decl(discriminatedUnionInference.ts, 7, 39)) + +type FooA = InferA>; // number +>FooA : Symbol(FooA, Decl(discriminatedUnionInference.ts, 7, 55)) +>InferA : Symbol(InferA, Decl(discriminatedUnionInference.ts, 5, 33)) +>Foo : Symbol(Foo, Decl(discriminatedUnionInference.ts, 0, 0)) + +// Repro from #28862 + +type Item = { kind: 'a', data: T } | { kind: 'b', data: T[] }; +>Item : Symbol(Item, Decl(discriminatedUnionInference.ts, 9, 32)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10)) +>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 13, 16)) +>data : Symbol(data, Decl(discriminatedUnionInference.ts, 13, 27)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10)) +>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 13, 41)) +>data : Symbol(data, Decl(discriminatedUnionInference.ts, 13, 52)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 13, 10)) + +declare function foo(item: Item): T; +>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21)) +>item : Symbol(item, Decl(discriminatedUnionInference.ts, 15, 24)) +>Item : Symbol(Item, Decl(discriminatedUnionInference.ts, 9, 32)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21)) +>T : Symbol(T, Decl(discriminatedUnionInference.ts, 15, 21)) + +let x1 = foo({ kind: 'a', data: 42 }); // number +>x1 : Symbol(x1, Decl(discriminatedUnionInference.ts, 17, 3)) +>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65)) +>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 17, 14)) +>data : Symbol(data, Decl(discriminatedUnionInference.ts, 17, 25)) + +let x2 = foo({ kind: 'b', data: [1, 2] }); // number +>x2 : Symbol(x2, Decl(discriminatedUnionInference.ts, 18, 3)) +>foo : Symbol(foo, Decl(discriminatedUnionInference.ts, 13, 65)) +>kind : Symbol(kind, Decl(discriminatedUnionInference.ts, 18, 14)) +>data : Symbol(data, Decl(discriminatedUnionInference.ts, 18, 25)) + diff --git a/tests/baselines/reference/discriminatedUnionInference.types b/tests/baselines/reference/discriminatedUnionInference.types new file mode 100644 index 00000000000..65e3db1510a --- /dev/null +++ b/tests/baselines/reference/discriminatedUnionInference.types @@ -0,0 +1,55 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/discriminatedUnionInference.ts === +// Repro from #28862 + +type Foo = { type: "foo", (): A[] }; +>Foo : Foo +>type : "foo" + +type Bar = { type: "bar", (): A }; +>Bar : Bar +>type : "bar" + +type FooBar = Foo | Bar; +>FooBar : FooBar + +type InferA = T extends FooBar ? A : never; +>InferA : InferA + +type FooA = InferA>; // number +>FooA : number + +// Repro from #28862 + +type Item = { kind: 'a', data: T } | { kind: 'b', data: T[] }; +>Item : Item +>kind : "a" +>data : T +>kind : "b" +>data : T[] + +declare function foo(item: Item): T; +>foo : (item: Item) => T +>item : Item + +let x1 = foo({ kind: 'a', data: 42 }); // number +>x1 : number +>foo({ kind: 'a', data: 42 }) : number +>foo : (item: Item) => T +>{ kind: 'a', data: 42 } : { kind: "a"; data: number; } +>kind : "a" +>'a' : "a" +>data : number +>42 : 42 + +let x2 = foo({ kind: 'b', data: [1, 2] }); // number +>x2 : number +>foo({ kind: 'b', data: [1, 2] }) : number +>foo : (item: Item) => T +>{ kind: 'b', data: [1, 2] } : { kind: "b"; data: number[]; } +>kind : "b" +>'b' : "b" +>data : number[] +>[1, 2] : number[] +>1 : 1 +>2 : 2 + From 8a77e85fa43e4b3b4e457cd92d7d4c3f4a02b93f Mon Sep 17 00:00:00 2001 From: typescript-bot Date: Thu, 6 Dec 2018 14:26:06 +0000 Subject: [PATCH 110/322] Update user baselines --- tests/baselines/reference/user/antd.log | 7 +++++++ .../baselines/reference/user/chrome-devtools-frontend.log | 4 ++-- tests/baselines/reference/user/puppeteer.log | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/user/antd.log diff --git a/tests/baselines/reference/user/antd.log b/tests/baselines/reference/user/antd.log new file mode 100644 index 00000000000..f0d7570b578 --- /dev/null +++ b/tests/baselines/reference/user/antd.log @@ -0,0 +1,7 @@ +Exit Code: 1 +Standard output: +node_modules/antd/lib/input/TextArea.d.ts(20,21): error TS2304: Cannot find name 'ResizeObserver'. + + + +Standard error: diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index e515fb02779..2422fdab79b 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -7661,7 +7661,7 @@ node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(271 node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(272,52): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(274,52): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(288,74): error TS2345: Argument of type '{ min: number; max: number; count: number; }' is not assignable to parameter of type 'number | { min: number; max: number; }'. - Object literal may only specify known properties, and 'count' does not exist in type 'number | { min: number; max: number; }'. + Object literal may only specify known properties, and 'count' does not exist in type '{ min: number; max: number; }'. node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(290,29): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(307,34): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/network/RequestTimingView.js(315,37): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -13639,7 +13639,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(75,15): error TS70 node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(82,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(89,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(100,79): error TS2345: Argument of type '{ passive: boolean; capture: false; }' is not assignable to parameter of type 'boolean | EventListenerOptions'. - Object literal may only specify known properties, and 'passive' does not exist in type 'boolean | EventListenerOptions'. + Object literal may only specify known properties, and 'passive' does not exist in type 'EventListenerOptions'. node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(108,19): error TS2551: Property '_scrollTop' does not exist on type 'Element'. Did you mean 'scrollTop'? node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(109,37): error TS2551: Property '_scrollTop' does not exist on type 'Element'. Did you mean 'scrollTop'? node_modules/chrome-devtools-frontend/front_end/ui/XWidget.js(110,19): error TS2551: Property '_scrollLeft' does not exist on type 'Element'. Did you mean 'scrollLeft'? diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index b799b7125ab..9d6c2b26482 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -8,9 +8,9 @@ lib/Browser.js(71,49): error TS2322: Type 'Promise' is not assignabl Type 'T' is not assignable to type 'string | symbol'. Type 'string | number | symbol' is not assignable to type 'string | symbol'. Type 'number' is not assignable to type 'string | symbol'. - Type 'T' is not assignable to type 'string'. - Type 'string | number | symbol' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. + Type 'T' is not assignable to type 'symbol'. + Type 'string | number | symbol' is not assignable to type 'symbol'. + Type 'string' is not assignable to type 'symbol'. lib/BrowserFetcher.js(100,15): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. lib/BrowserFetcher.js(195,13): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. lib/Connection.js(91,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. From a2111843479cbae191eac29b58fd016069fc53e2 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 6 Dec 2018 11:17:06 -0800 Subject: [PATCH 111/322] Clarified error message; extended error to identifier end Lengthening the reported error length to include all of the identifier necessitates scanning for all of the identifier. I also reset the `pos` after so other identifier scanning still happens. --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/scanner.ts | 9 +- ...ntifierStartAfterNumericLiteral.errors.txt | 116 ++++++++++++++---- .../identifierStartAfterNumericLiteral.js | 34 +++++ ...identifierStartAfterNumericLiteral.symbols | 13 ++ .../identifierStartAfterNumericLiteral.types | 56 +++++++++ ...ralsWithTrailingDecimalPoints01.errors.txt | 12 +- .../reference/parseBigInt.errors.txt | 12 +- ...umericSeparators.binaryNegative.errors.txt | 6 +- ...r.numericSeparators.hexNegative.errors.txt | 6 +- ...numericSeparators.octalNegative.errors.txt | 6 +- .../tsxAttributeInvalidNames.errors.txt | 6 +- .../identifierStartAfterNumericLiteral.ts | 13 ++ 13 files changed, 241 insertions(+), 50 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index b7aaaf02742..cde7516f047 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1011,7 +1011,7 @@ "category": "Message", "code": 1350 }, - "An identifier cannot follow a numeric literal.": { + "An identifier or keyword cannot immediately follow a numeric literal.": { "category": "Error", "code": 1351 }, diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 1589cca8357..a9438110593 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -991,9 +991,14 @@ namespace ts { } function checkForIdentifierStartAfterNumericLiteral() { - if (isIdentifierStart(text.charCodeAt(pos), languageVersion)) { - error(Diagnostics.An_identifier_cannot_follow_a_numeric_literal, pos, 1); + if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) { + return; } + + const identifierStart = pos; + const { length } = scanIdentifierParts(); + error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + pos = identifierStart; } function scanOctalDigits(): number { diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt index 130e676d0d1..2b4884f7303 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt @@ -1,65 +1,135 @@ -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(1,16): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(1,16): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(3,2): error TS2304: Cannot find name 'a'. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,3): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS2538: Type 'null' cannot be used as an index type. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,2): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,3): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,3): error TS2304: Cannot find name 'n'. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS2304: Cannot find name 'a'. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,3): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,3): error TS2304: Cannot find name 'e'. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,3): error TS1005: ';' expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,3): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(4,4): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(5,4): error TS2538: Type 'null' cannot be used as an index type. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,5): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,6): error TS2538: Type 'null' cannot be used as an index type. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS2304: Cannot find name 'n'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS2304: Cannot find name 'n'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,4): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(13,4): error TS2304: Cannot find name 'abc'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(14,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(15,5): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(18,3): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(18,3): error TS2304: Cannot find name 'e'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(19,5): error TS1124: Digit expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(19,5): error TS2304: Cannot find name 'e'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(22,3): error TS1005: ';' expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(23,5): error TS1005: ';' expected. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(24,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(24,3): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(25,5): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(25,5): error TS2304: Cannot find name 'a'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS2304: Cannot find name 'abc'. -==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (16 errors) ==== +==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (35 errors) ==== let valueIn = 3in[null]; - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. 3a[null] ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~ +!!! error TS2304: Cannot find name 'a'. + 123a[null] + ~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~ !!! error TS2304: Cannot find name 'a'. 3e[null] !!! error TS1124: Digit expected. ~~~~ +!!! error TS2538: Type 'null' cannot be used as an index type. + 123e[null] + +!!! error TS1124: Digit expected. + ~~~~ !!! error TS2538: Type 'null' cannot be used as an index type. 3in[null] - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + 123in[null] + ~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. 3en[null] !!! error TS1124: Digit expected. ~ +!!! error TS2304: Cannot find name 'n'. + 123en[null] + +!!! error TS1124: Digit expected. + ~ !!! error TS2304: Cannot find name 'n'. 1a ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~ !!! error TS2304: Cannot find name 'a'. + 123a + ~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~ +!!! error TS2304: Cannot find name 'a'. + 123abc + ~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~~~ +!!! error TS2304: Cannot find name 'abc'. 1e +!!! error TS1124: Digit expected. + 123e + !!! error TS1124: Digit expected. 1e9 + 123e9 1ee !!! error TS1124: Digit expected. ~ +!!! error TS2304: Cannot find name 'e'. + 123ee + +!!! error TS1124: Digit expected. + ~ !!! error TS2304: Cannot find name 'e'. 1n + 123n 2n2 ~ +!!! error TS1005: ';' expected. + 123n2 + ~ !!! error TS1005: ';' expected. 2na ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~ !!! error TS2304: Cannot find name 'a'. + 123na + ~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~ +!!! error TS2304: Cannot find name 'a'. + 123nabc + ~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~~~ +!!! error TS2304: Cannot find name 'abc'. \ No newline at end of file diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.js b/tests/baselines/reference/identifierStartAfterNumericLiteral.js index 0ec84716c2c..59ece3e1c7e 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.js +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.js @@ -2,34 +2,68 @@ let valueIn = 3in[null]; 3a[null] +123a[null] 3e[null] +123e[null] 3in[null] +123in[null] 3en[null] +123en[null] 1a +123a +123abc 1e +123e 1e9 +123e9 1ee +123ee 1n +123n 2n2 +123n2 2na +123na +123nabc //// [identifierStartAfterNumericLiteral.js] var valueIn = 3 in [null]; 3; a[null]; +123; +a[null]; 3e[null]; +123e[null]; 3 in [null]; +123 in [null]; 3e; n[null]; +123e; +n[null]; 1; a; +123; +a; +123; +abc; 1e; +123e; 1e9; +123e9; 1e; e; +123e; +e; 1n; +123n; 2n; 2; +123n; +2; 2n; a; +123n; +a; +123n; +abc; diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols b/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols index 71b253dbecc..8237191eee4 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.symbols @@ -3,14 +3,27 @@ let valueIn = 3in[null]; >valueIn : Symbol(valueIn, Decl(identifierStartAfterNumericLiteral.ts, 0, 3)) 3a[null] +123a[null] 3e[null] +123e[null] 3in[null] +123in[null] 3en[null] +123en[null] 1a +123a +123abc 1e +123e 1e9 +123e9 1ee +123ee 1n +123n 2n2 +123n2 2na +123na +123nabc diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.types b/tests/baselines/reference/identifierStartAfterNumericLiteral.types index b31c9ee8d11..af3399a6d13 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.types +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.types @@ -12,45 +12,101 @@ let valueIn = 3in[null]; >a : any >null : null +123a[null] +>123 : 123 +>a[null] : any +>a : any +>null : null + 3e[null] >3e[null] : any >3e : 3 >null : null +123e[null] +>123e[null] : any +>123e : 123 +>null : null + 3in[null] >3in[null] : boolean >3 : 3 >[null] : null[] >null : null +123in[null] +>123in[null] : boolean +>123 : 123 +>[null] : null[] +>null : null + 3en[null] >3e : 3 >n[null] : any >n : any >null : null +123en[null] +>123e : 123 +>n[null] : any +>n : any +>null : null + 1a >1 : 1 >a : any +123a +>123 : 123 +>a : any + +123abc +>123 : 123 +>abc : any + 1e >1e : 1 +123e +>123e : 123 + 1e9 >1e9 : 1000000000 +123e9 +>123e9 : 123000000000 + 1ee >1e : 1 >e : any +123ee +>123e : 123 +>e : any + 1n >1n : 1n +123n +>123n : 123n + 2n2 >2n : 2n >2 : 2 +123n2 +>123n : 123n +>2 : 2 + 2na >2n : 2n >a : any +123na +>123n : 123n +>a : any + +123nabc +>123n : 123n +>abc : any + diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt index 42561707d56..ac319184f8a 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(3,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,15): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,23): error TS1005: ',' expected. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error TS1109: Expression expected. @@ -8,16 +8,16 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error 1..toString(); 1.0.toString(); 1.toString(); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. 1.+2.0 + 3. ; // Preserve whitespace where important for JS compatibility var i: number = 1; var test1 = i.toString(); var test2 = 2.toString(); - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index 77d8b55ed98..16878e75fe9 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(58,22): error TS1351: An identifier cannot follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(59,28): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(58,22): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(59,28): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/parseBigInt.ts(60,23): error TS1177: Binary digit expected. tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected. tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected. @@ -82,13 +82,13 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i !!! error TS1005: ',' expected. { const scientific = 1e2n; } ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. { const decimal = 4.1n; } ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. { const leadingDecimal = .1n; } ~ -!!! error TS1351: An identifier cannot follow a numeric literal. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. const emptyBinary = 0bn; // should error but infer 0n !!! error TS1177: Binary digit expected. diff --git a/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt index bff028ba704..93118bc9c7f 100644 --- a/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'B0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_B0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'B0101'. diff --git a/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt index 3aca519e572..c6048a1bbfb 100644 --- a/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.hexNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'X0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_X0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'X0101'. diff --git a/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt b/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt index 58c1363b7ba..ebdec3371aa 100644 --- a/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt +++ b/tests/baselines/reference/parser.numericSeparators.octalNegative.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. -tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier cannot follow a numeric literal. +tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'O0101'. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6189: Multiple consecutive numeric separators are not permitted. tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6189: Multiple consecutive numeric separators are not permitted. @@ -24,8 +24,8 @@ tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error 0_O0101 ~ !!! error TS6188: Numeric separators are not allowed here. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. + ~~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~~~~~ !!! error TS2304: Cannot find name 'O0101'. diff --git a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt index 65b2fc23803..d0b521d0454 100644 --- a/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt +++ b/tests/baselines/reference/tsxAttributeInvalidNames.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsx/file.tsx(10,8): error TS1003: Identifier expected. -tests/cases/conformance/jsx/file.tsx(10,10): error TS1351: An identifier cannot follow a numeric literal. tests/cases/conformance/jsx/file.tsx(10,10): error TS1005: ';' expected. +tests/cases/conformance/jsx/file.tsx(10,10): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/conformance/jsx/file.tsx(10,10): error TS2304: Cannot find name 'data'. tests/cases/conformance/jsx/file.tsx(10,15): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/jsx/file.tsx(10,18): error TS1005: ':' expected. @@ -26,11 +26,11 @@ tests/cases/conformance/jsx/file.tsx(11,20): error TS1161: Unterminated regular ; ~~ !!! error TS1003: Identifier expected. - ~ -!!! error TS1351: An identifier cannot follow a numeric literal. ~~~~ !!! error TS1005: ';' expected. ~~~~ +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. + ~~~~ !!! error TS2304: Cannot find name 'data'. ~~~~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. diff --git a/tests/cases/compiler/identifierStartAfterNumericLiteral.ts b/tests/cases/compiler/identifierStartAfterNumericLiteral.ts index 80e4760e11b..14e5cca0e25 100644 --- a/tests/cases/compiler/identifierStartAfterNumericLiteral.ts +++ b/tests/cases/compiler/identifierStartAfterNumericLiteral.ts @@ -1,13 +1,26 @@ let valueIn = 3in[null]; 3a[null] +123a[null] 3e[null] +123e[null] 3in[null] +123in[null] 3en[null] +123en[null] 1a +123a +123abc 1e +123e 1e9 +123e9 1ee +123ee 1n +123n 2n2 +123n2 2na +123na +123nabc From c65e43e85e3a4e5b0e4384189d9a3837038e3fce Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Nov 2018 10:17:00 -0800 Subject: [PATCH 112/322] Do not close over program in getSourceFileLike --- src/services/sourcemaps.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 92ebcc8c261..9de8557cd19 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -39,9 +39,10 @@ namespace ts { // obviously invalid map return file.sourceMapper = identitySourceMapConsumer; } - const program = getProgram(); + return file.sourceMapper = createDocumentPositionMapper({ getSourceFileLike: s => { + const program = getProgram(); // Lookup file in program, if provided const file = program && program.getSourceFileByPath(s); // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file From 86857d5b09d6723b6f9043d96abfe6f553f6e7cf Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Nov 2018 10:40:59 -0800 Subject: [PATCH 113/322] Use program directly to get the sourceFile of source position --- src/services/sourcemaps.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 9de8557cd19..9b8f97a6640 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -93,8 +93,9 @@ namespace ts { function tryGetSourcePosition(info: DocumentPosition): DocumentPosition | undefined { if (!isDeclarationFileName(info.fileName)) return undefined; - const file = getFile(info.fileName); + const file = getSourceFile(info.fileName); if (!file) return undefined; + const newLoc = getSourceMapper(info.fileName, file).getSourcePosition(info); return newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; } @@ -103,27 +104,31 @@ namespace ts { const program = getProgram(); const options = program.getCompilerOptions(); const outPath = options.outFile || options.out; + const declarationPath = outPath ? removeFileExtension(outPath) + Extension.Dts : getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - const declarationFile = getFile(declarationPath); + + const declarationFile = getGeneratedFile(declarationPath); if (!declarationFile) return undefined; + const newLoc = getSourceMapper(declarationPath, declarationFile).getGeneratedPosition(info); return newLoc === info ? undefined : newLoc; } - function getFile(fileName: string): SourceFileLike | undefined { - const path = toPath(fileName); - const file = getProgram().getSourceFileByPath(path); - if (file && file.resolvedPath === path) { - return file; - } - return sourcemappedFileCache.get(path); + function getSourceFile(fileName: string) { + const program = getProgram(); + return program && program.getSourceFileByPath(toPath(fileName)); + } + + function getGeneratedFile(fileName: string) { + return sourcemappedFileCache.get(toPath(fileName)); // TODO: should ask host instead? } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { - const file = getFile(fileName)!; // TODO: GH#18217 + const sourceFile = getSourceFile(fileName); + const file = sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getGeneratedFile(fileName)!; // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } From 0a8c47bd45fb4265c9d783a5492bdf86d91e5ddd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Nov 2018 11:29:04 -0800 Subject: [PATCH 114/322] Refactoring to createSourceMapperHost --- src/compiler/types.ts | 2 +- src/services/services.ts | 29 ++++++---- src/services/sourcemaps.ts | 107 +++++++++++++++++-------------------- src/services/utilities.ts | 4 +- 4 files changed, 72 insertions(+), 70 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 495465f7032..f52d82a8a2f 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5530,7 +5530,7 @@ namespace ts { export interface DocumentPositionMapperHost { getSourceFileLike(path: Path): SourceFileLike | undefined; getCanonicalFileName(path: string): string; - log?(text: string): void; + log(text: string): void; } /** diff --git a/src/services/services.ts b/src/services/services.ts index 20400a3ec47..67f9e537574 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1139,7 +1139,14 @@ namespace ts { const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); - const sourceMapper = getSourceMapper(useCaseSensitiveFileNames, currentDirectory, log, host, () => program); + const sourceMapper = getSourceMapper({ + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, + getCurrentDirectory: () => currentDirectory, + getProgram, + fileExists: host.fileExists ? f => host.fileExists!(f) : returnFalse, + readFile: host.readFile ? (f, encoding) => host.readFile!(f, encoding) : () => undefined, + log + }); function getValidSourceFile(fileName: string): SourceFile { const sourceFile = program.getSourceFile(fileName); @@ -1203,15 +1210,7 @@ namespace ts { writeFile: noop, getCurrentDirectory: () => currentDirectory, fileExists, - readFile(fileName) { - // stub missing host functionality - const path = toPath(fileName, currentDirectory, getCanonicalFileName); - const entry = hostCache && hostCache.getEntryByPath(path); - if (entry) { - return isString(entry) ? undefined : getSnapshotText(entry.scriptSnapshot); - } - return host.readFile && host.readFile(fileName); - }, + readFile, realpath: host.realpath && (path => host.realpath!(path)), directoryExists: directoryName => { return directoryProbablyExists(directoryName, host); @@ -1272,6 +1271,16 @@ namespace ts { (!!host.fileExists && host.fileExists(fileName)); } + function readFile(fileName: string) { + // stub missing host functionality + const path = toPath(fileName, currentDirectory, getCanonicalFileName); + const entry = hostCache && hostCache.getEntryByPath(path); + if (entry) { + return isString(entry) ? undefined : getSnapshotText(entry.scriptSnapshot); + } + return host.readFile && host.readFile(fileName); + } + // Release any files we have acquired in the old program but are // not part of the new program. function onReleaseOldSourceFile(oldSourceFile: SourceFile, oldOptions: CompilerOptions) { diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 9b8f97a6640..c2b9dbfb46a 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -9,15 +9,21 @@ namespace ts { clearCache(): void; } + export interface SourceMapperHost { + useCaseSensitiveFileNames(): boolean; + getCurrentDirectory(): string; + getProgram(): Program | undefined; + fileExists(path: string): boolean; + readFile(path: string, encoding?: string): string | undefined; + log(s: string): void; + } + export function getSourceMapper( - useCaseSensitiveFileNames: boolean, - currentDirectory: string, - log: (message: string) => void, - host: LanguageServiceHost, - getProgram: () => Program, + host: SourceMapperHost ): SourceMapper { - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); - let sourcemappedFileCache: SourceFileLikeCache; + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + const currentDirectory = host.getCurrentDirectory(); + const generatedFileCache = createMap(); return { tryGetSourcePosition, tryGetGeneratedPosition, toLineColumnOffset, clearCache }; function toPath(fileName: string) { @@ -25,7 +31,7 @@ namespace ts { } function scanForSourcemapURL(fileName: string) { - const mappedFile = sourcemappedFileCache.get(toPath(fileName)); + const mappedFile = generatedFileCache.get(toPath(fileName)); if (!mappedFile) { return; } @@ -41,26 +47,13 @@ namespace ts { } return file.sourceMapper = createDocumentPositionMapper({ - getSourceFileLike: s => { - const program = getProgram(); - // Lookup file in program, if provided - const file = program && program.getSourceFileByPath(s); - // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file - if (file === undefined || file.resolvedPath !== s) { - // Otherwise check the cache (which may hit disk) - return sourcemappedFileCache.get(s); - } - return file; - }, + getSourceFileLike, getCanonicalFileName, - log, + log: s => host.log(s), }, map, mapFileName); } function getSourceMapper(fileName: string, file: SourceFileLike): DocumentPositionMapper { - if (!host.readFile || !host.fileExists) { - return file.sourceMapper = identitySourceMapConsumer; - } if (file.sourceMapper) { return file.sourceMapper; } @@ -101,7 +94,9 @@ namespace ts { } function tryGetGeneratedPosition(info: DocumentPosition): DocumentPosition | undefined { - const program = getProgram(); + const program = host.getProgram(); + if (!program) return undefined; + const options = program.getCompilerOptions(); const outPath = options.outFile || options.out; @@ -118,49 +113,47 @@ namespace ts { } function getSourceFile(fileName: string) { - const program = getProgram(); + const program = host.getProgram(); return program && program.getSourceFileByPath(toPath(fileName)); } - function getGeneratedFile(fileName: string) { - return sourcemappedFileCache.get(toPath(fileName)); // TODO: should ask host instead? + function getGeneratedFile(fileName: string): SourceFileLike | undefined { + const path = toPath(fileName); + const fileFromCache = generatedFileCache.get(path); + if (fileFromCache !== undefined) return fileFromCache ? fileFromCache : undefined; + + // TODO: should ask host instead? + if (!host.fileExists(path)) { + generatedFileCache.set(path, false); + return undefined; + } + + // And failing that, check the disk + const text = host.readFile(path); + const file: SourceFileLike | false = text ? { + text, + lineMap: undefined, + getLineAndCharacterOfPosition(pos: number) { + return computeLineAndCharacterOfPosition(getLineStarts(this as SourceFileLike), pos); + } + } : false; + generatedFileCache.set(path, file); + return file ? file : undefined; + } + + function getSourceFileLike(fileName: string) { + const sourceFile = getSourceFile(fileName); + // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file + return sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getGeneratedFile(fileName); } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { - const sourceFile = getSourceFile(fileName); - const file = sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getGeneratedFile(fileName)!; // TODO: GH#18217 + const file = getSourceFileLike(fileName)!; // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } function clearCache(): void { - sourcemappedFileCache = createSourceFileLikeCache(host); + generatedFileCache.clear(); } } - - interface SourceFileLikeCache { - get(path: Path): SourceFileLike | undefined; - } - - function createSourceFileLikeCache(host: { readFile?: (path: string) => string | undefined, fileExists?: (path: string) => boolean }): SourceFileLikeCache { - const cached = createMap(); - return { - get(path: Path) { - if (cached.has(path)) { - return cached.get(path); - } - if (!host.fileExists || !host.readFile || !host.fileExists(path)) return; - // And failing that, check the disk - const text = host.readFile(path)!; // TODO: GH#18217 - const file = { - text, - lineMap: undefined, - getLineAndCharacterOfPosition(pos: number) { - return computeLineAndCharacterOfPosition(getLineStarts(this), pos); - } - } as SourceFileLike; - cached.set(path, file); - return file; - } - }; - } } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 22e6b31b55c..2f78ef2324b 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1282,11 +1282,11 @@ namespace ts { return !!compilerOptions.module || compilerOptions.target! >= ScriptTarget.ES2015 || !!compilerOptions.noEmit; } - export function hostUsesCaseSensitiveFileNames(host: LanguageServiceHost): boolean { + export function hostUsesCaseSensitiveFileNames(host: { useCaseSensitiveFileNames?(): boolean; }): boolean { return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; } - export function hostGetCanonicalFileName(host: LanguageServiceHost): GetCanonicalFileName { + export function hostGetCanonicalFileName(host: { useCaseSensitiveFileNames?(): boolean; }): GetCanonicalFileName { return createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host)); } From 1db8bb062c1fda1f901352471d90816656abc9ee Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Nov 2018 11:49:54 -0800 Subject: [PATCH 115/322] Use file names instead of paths for reading files --- src/compiler/sourcemap.ts | 9 +++------ src/compiler/types.ts | 2 +- src/services/sourcemaps.ts | 27 ++++++++++++++------------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 9b74fb22d58..b3b4e1fbb5e 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -592,11 +592,9 @@ namespace ts { const mapDirectory = getDirectoryPath(mapPath); const sourceRoot = map.sourceRoot ? getNormalizedAbsolutePath(map.sourceRoot, mapDirectory) : mapDirectory; const generatedAbsoluteFilePath = getNormalizedAbsolutePath(map.file, mapDirectory); - const generatedCanonicalFilePath = host.getCanonicalFileName(generatedAbsoluteFilePath) as Path; - const generatedFile = host.getSourceFileLike(generatedCanonicalFilePath); + const generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); const sourceFileAbsolutePaths = map.sources.map(source => getNormalizedAbsolutePath(source, sourceRoot)); - const sourceFileCanonicalPaths = sourceFileAbsolutePaths.map(source => host.getCanonicalFileName(source) as Path); - const sourceToSourceIndexMap = createMapFromEntries(sourceFileCanonicalPaths.map((source, i) => [source, i] as [string, number])); + const sourceToSourceIndexMap = createMapFromEntries(sourceFileAbsolutePaths.map((source, i) => [host.getCanonicalFileName(source), i] as [string, number])); let decodedMappings: ReadonlyArray | undefined; let generatedMappings: SortedReadonlyArray | undefined; let sourceMappings: ReadonlyArray> | undefined; @@ -613,8 +611,7 @@ namespace ts { let source: string | undefined; let sourcePosition: number | undefined; if (isSourceMapping(mapping)) { - const sourceFilePath = sourceFileCanonicalPaths[mapping.sourceIndex]; - const sourceFile = host.getSourceFileLike(sourceFilePath); + const sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined ? getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f52d82a8a2f..4da96730a93 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5528,7 +5528,7 @@ namespace ts { /* @internal */ export interface DocumentPositionMapperHost { - getSourceFileLike(path: Path): SourceFileLike | undefined; + getSourceFileLike(fileName: string): SourceFileLike | undefined; getCanonicalFileName(path: string): string; log(text: string): void; } diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index c2b9dbfb46a..47f39d85136 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -23,7 +23,7 @@ namespace ts { ): SourceMapper { const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const currentDirectory = host.getCurrentDirectory(); - const generatedFileCache = createMap(); + const sourceFileLike = createMap(); return { tryGetSourcePosition, tryGetGeneratedPosition, toLineColumnOffset, clearCache }; function toPath(fileName: string) { @@ -31,7 +31,7 @@ namespace ts { } function scanForSourcemapURL(fileName: string) { - const mappedFile = generatedFileCache.get(toPath(fileName)); + const mappedFile = sourceFileLike.get(toPath(fileName)); if (!mappedFile) { return; } @@ -39,7 +39,7 @@ namespace ts { return tryGetSourceMappingURL(mappedFile.text, getLineStarts(mappedFile)); } - function convertDocumentToSourceMapper(file: { sourceMapper?: DocumentPositionMapper }, contents: string, mapFileName: string) { + function convertDocumentToSourceMapper(file: SourceFileLike, contents: string, mapFileName: string) { const map = tryParseRawSourceMap(contents); if (!map || !map.sources || !map.file || !map.mappings) { // obviously invalid map @@ -75,9 +75,9 @@ namespace ts { } possibleMapLocations.push(fileName + ".map"); for (const location of possibleMapLocations) { - const mapPath = ts.toPath(location, getDirectoryPath(fileName), getCanonicalFileName); - if (host.fileExists(mapPath)) { - return convertDocumentToSourceMapper(file, host.readFile(mapPath)!, mapPath); // TODO: GH#18217 + const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(fileName)); + if (host.fileExists(mapFileName)) { + return convertDocumentToSourceMapper(file, host.readFile(mapFileName)!, mapFileName); // TODO: GH#18217 } } return file.sourceMapper = identitySourceMapConsumer; @@ -105,7 +105,7 @@ namespace ts { getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - const declarationFile = getGeneratedFile(declarationPath); + const declarationFile = getSourceFileLikeFromCache(declarationPath); if (!declarationFile) return undefined; const newLoc = getSourceMapper(declarationPath, declarationFile).getGeneratedPosition(info); @@ -117,14 +117,14 @@ namespace ts { return program && program.getSourceFileByPath(toPath(fileName)); } - function getGeneratedFile(fileName: string): SourceFileLike | undefined { + function getSourceFileLikeFromCache(fileName: string): SourceFileLike | undefined { const path = toPath(fileName); - const fileFromCache = generatedFileCache.get(path); + const fileFromCache = sourceFileLike.get(path); if (fileFromCache !== undefined) return fileFromCache ? fileFromCache : undefined; // TODO: should ask host instead? if (!host.fileExists(path)) { - generatedFileCache.set(path, false); + sourceFileLike.set(path, false); return undefined; } @@ -137,14 +137,15 @@ namespace ts { return computeLineAndCharacterOfPosition(getLineStarts(this as SourceFileLike), pos); } } : false; - generatedFileCache.set(path, file); + sourceFileLike.set(path, file); return file ? file : undefined; } + // This can be called from source mapper in either source program or program that includes generated file function getSourceFileLike(fileName: string) { const sourceFile = getSourceFile(fileName); // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file - return sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getGeneratedFile(fileName); + return sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getSourceFileLikeFromCache(fileName); } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { @@ -153,7 +154,7 @@ namespace ts { } function clearCache(): void { - generatedFileCache.clear(); + sourceFileLike.clear(); } } } From 0dad79e8b3c077ef8b1870091ac61025b57d51ae Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 15 Nov 2018 12:02:03 -0800 Subject: [PATCH 116/322] Handle source and generated files more gracefully --- src/services/sourcemaps.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 47f39d85136..7b51c9ecff9 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -18,9 +18,7 @@ namespace ts { log(s: string): void; } - export function getSourceMapper( - host: SourceMapperHost - ): SourceMapper { + export function getSourceMapper(host: SourceMapperHost): SourceMapper { const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const currentDirectory = host.getCurrentDirectory(); const sourceFileLike = createMap(); @@ -94,9 +92,12 @@ namespace ts { } function tryGetGeneratedPosition(info: DocumentPosition): DocumentPosition | undefined { - const program = host.getProgram(); - if (!program) return undefined; + if (isDeclarationFileName(info.fileName)) return undefined; + const sourceFile = getSourceFile(info.fileName); + if (!sourceFile) return undefined; + + const program = host.getProgram()!; const options = program.getCompilerOptions(); const outPath = options.outFile || options.out; @@ -114,7 +115,12 @@ namespace ts { function getSourceFile(fileName: string) { const program = host.getProgram(); - return program && program.getSourceFileByPath(toPath(fileName)); + if (!program) return undefined; + + const path = toPath(fileName); + // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file + const file = program.getSourceFileByPath(path); + return file && file.resolvedPath === path ? file : undefined; } function getSourceFileLikeFromCache(fileName: string): SourceFileLike | undefined { @@ -143,9 +149,7 @@ namespace ts { // This can be called from source mapper in either source program or program that includes generated file function getSourceFileLike(fileName: string) { - const sourceFile = getSourceFile(fileName); - // file returned here could be .d.ts when asked for .ts file if projectReferences and module resolution created this source file - return sourceFile && sourceFile.resolvedPath === toPath(fileName) ? sourceFile : getSourceFileLikeFromCache(fileName); + return getSourceFile(fileName) || getSourceFileLikeFromCache(fileName); } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { From 12428d45c02c46b38d76009774700be840ad63dc Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Nov 2018 10:15:51 -0800 Subject: [PATCH 117/322] Add method on host to get DocumentPositionMapper so it can be cached. --- src/compiler/scanner.ts | 8 +- src/compiler/sourcemap.ts | 20 ++- src/compiler/types.ts | 2 + src/harness/sourceMapRecorder.ts | 2 +- src/server/project.ts | 60 +++++++ src/server/scriptInfo.ts | 31 +++- src/server/scriptVersionCache.ts | 14 +- src/server/session.ts | 2 +- src/services/services.ts | 8 +- src/services/sourcemaps.ts | 151 ++++++++++-------- src/services/types.ts | 6 +- src/testRunner/unittests/textStorage.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- 13 files changed, 219 insertions(+), 89 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index a9438110593..e9ccc23d6eb 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -338,12 +338,16 @@ namespace ts { } export function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); + return sourceFile.getPositionOfLineAndCharacter ? + sourceFile.getPositionOfLineAndCharacter(line, character) : + computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); } /* @internal */ export function getPositionOfLineAndCharacterWithEdits(sourceFile: SourceFileLike, line: number, character: number): number { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + return sourceFile.getPositionOfLineAndCharacter ? + sourceFile.getPositionOfLineAndCharacter(line, character) : + computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); } /* @internal */ diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index b3b4e1fbb5e..190cac3b761 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -266,14 +266,24 @@ namespace ts { const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\s*$/; const whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; + export interface LineInfo { + getLineCount(): number; + getLineText(line: number): string; + } + + export function getLineInfo(text: string, lineStarts: ReadonlyArray): LineInfo { + return { + getLineCount: () => lineStarts.length, + getLineText: line => text.substring(lineStarts[line], lineStarts[line + 1]) + }; + } + /** * Tries to find the sourceMappingURL comment at the end of a file. - * @param text The source text of the file. - * @param lineStarts The line starts of the file. */ - export function tryGetSourceMappingURL(text: string, lineStarts: ReadonlyArray = computeLineStarts(text)) { - for (let index = lineStarts.length - 1; index >= 0; index--) { - const line = text.substring(lineStarts[index], lineStarts[index + 1]); + export function tryGetSourceMappingURL(lineInfo: LineInfo) { + for (let index = lineInfo.getLineCount() - 1; index >= 0; index--) { + const line = lineInfo.getLineText(index); const comment = sourceMapCommentRegExp.exec(line); if (comment) { return comment[1]; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4da96730a93..e654f4faab7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2614,6 +2614,8 @@ namespace ts { export interface SourceFileLike { readonly text: string; lineMap?: ReadonlyArray; + /* @internal */ + getPositionOfLineAndCharacter?(line: number, character: number): number; } diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index 92c3e2d4a94..d16aca21d66 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -69,7 +69,7 @@ namespace Harness.SourceMapRecorder { SourceMapDecoder.initializeSourceMapDecoding(sourceMapData); sourceMapRecorder.WriteLine("==================================================================="); sourceMapRecorder.WriteLine("JsFile: " + sourceMapData.sourceMap.file); - sourceMapRecorder.WriteLine("mapUrl: " + ts.tryGetSourceMappingURL(jsFile.text, jsLineMap)); + sourceMapRecorder.WriteLine("mapUrl: " + ts.tryGetSourceMappingURL(ts.getLineInfo(jsFile.text, jsLineMap))); sourceMapRecorder.WriteLine("sourceRoot: " + sourceMapData.sourceMap.sourceRoot); sourceMapRecorder.WriteLine("sources: " + sourceMapData.sourceMap.sources); if (sourceMapData.sourceMap.sourcesContent) { diff --git a/src/server/project.ts b/src/server/project.ts index fa39aa4abe9..566a2b9abe9 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -503,6 +503,66 @@ namespace ts.server { return this.getLanguageService().getSourceMapper(); } + /*@internal*/ + getDocumentPositionMapper(fileName: string): DocumentPositionMapper | undefined { + const declarationInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); + if (!declarationInfo) return undefined; + + declarationInfo.getSnapshot(); // Ensure synchronized + const existingMapper = declarationInfo.textStorage.mapper; + if (existingMapper !== undefined) { + return existingMapper ? existingMapper : undefined; + } + + // Create the mapper + declarationInfo.mapInfo = undefined; + + const mapper = getDocumentPositionMapper({ + getCanonicalFileName: this.projectService.toCanonicalFileName, + log: s => this.log(s), + readMapFile: f => this.readMapFile(f, declarationInfo), + getSourceFileLike: f => this.getSourceFileLike(f) + }, declarationInfo.fileName, declarationInfo.textStorage.getLineInfo()); + declarationInfo.textStorage.mapper = mapper || false; + return mapper; + } + + private readMapFile(fileName: string, declarationInfo: ScriptInfo) { + const mapInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); + if (!mapInfo) return undefined; + declarationInfo.mapInfo = mapInfo; + const snap = mapInfo.getSnapshot(); + return snap.getText(0, snap.getLength()); + } + + /*@internal*/ + getSourceFileLike(fileName: string) { + const path = this.toPath(fileName); + const sourceFile = this.getSourceFile(path); + if (sourceFile && sourceFile.resolvedPath === path) return sourceFile; + + // Need to look for other files. + const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); + if (!info) return undefined; + + // Key doesnt matter since its only for text and lines + if (info.cacheSourceFile) return info.cacheSourceFile.sourceFile; + if (info.textStorage.sourceFileLike) return info.textStorage.sourceFileLike; + + info.textStorage.sourceFileLike = { + get text() { + Debug.fail("shouldnt need text"); + return ""; + }, + getLineAndCharacterOfPosition: pos => { + const lineOffset = info.positionToLineOffset(pos); + return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; + }, + getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) + }; + return info.textStorage.sourceFileLike; + } + private shouldEmitFile(scriptInfo: ScriptInfo) { return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent(); } diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index c090b4b14d0..3502fff1556 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -46,6 +46,9 @@ namespace ts.server { */ private pendingReloadFromDisk = false; + mapper: DocumentPositionMapper | false | undefined = false; + sourceFileLike: SourceFileLike | undefined; + constructor(private readonly host: ServerHost, private readonly fileName: NormalizedPath, initialVersion: ScriptInfoVersion | undefined, private readonly info: ScriptInfo) { this.version = initialVersion || { svc: 0, text: 0 }; } @@ -70,6 +73,8 @@ namespace ts.server { this.text = newText; this.lineMap = undefined; this.fileSize = undefined; + this.mapper = undefined; + this.sourceFileLike = undefined; this.version.text++; } @@ -79,6 +84,8 @@ namespace ts.server { this.text = undefined; this.lineMap = undefined; this.fileSize = undefined; + this.mapper = undefined; + this.sourceFileLike = undefined; } /** @@ -156,8 +163,8 @@ namespace ts.server { : ScriptSnapshot.fromString(this.getOrLoadText()); } - public getLineInfo(line: number): AbsolutePositionAndLineText { - return this.switchToScriptVersionCache().getLineInfo(line); + public getAbsolutePositionAndLineText(line: number): AbsolutePositionAndLineText { + return this.switchToScriptVersionCache().getAbsolutePositionAndLineText(line); } /** * @param line 0 based index @@ -246,6 +253,17 @@ namespace ts.server { Debug.assert(!this.svc, "ScriptVersionCache should not be set"); return this.lineMap || (this.lineMap = computeLineStarts(this.getOrLoadText())); } + + getLineInfo(): LineInfo { + if (this.svc) { + return { + getLineCount: () => this.svc!.getLineCount(), + getLineText: line => this.svc!.getAbsolutePositionAndLineText(line + 1).lineText! + }; + } + const lineMap = this.getLineMap(); + return getLineInfo(this.text!, lineMap); + } } /*@internal*/ @@ -269,7 +287,7 @@ namespace ts.server { /* @internal */ fileWatcher: FileWatcher | undefined; - private textStorage: TextStorage; + /* @internal */ textStorage: TextStorage; /*@internal*/ readonly isDynamic: boolean; @@ -284,6 +302,9 @@ namespace ts.server { /*@internal*/ mTime?: number; + /*@internal*/ + mapInfo?: ScriptInfo; + constructor( private readonly host: ServerHost, readonly fileName: NormalizedPath, @@ -521,8 +542,8 @@ namespace ts.server { } /*@internal*/ - getLineInfo(line: number): AbsolutePositionAndLineText { - return this.textStorage.getLineInfo(line); + getAbsolutePositionAndLineText(line: number): AbsolutePositionAndLineText { + return this.textStorage.getAbsolutePositionAndLineText(line); } editContent(start: number, end: number, newText: string): void { diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index a350ed99f71..afd8f67ecbe 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -308,8 +308,8 @@ namespace ts.server { return this._getSnapshot().version; } - getLineInfo(line: number): AbsolutePositionAndLineText { - return this._getSnapshot().index.lineNumberToInfo(line); + getAbsolutePositionAndLineText(oneBasedLine: number): AbsolutePositionAndLineText { + return this._getSnapshot().index.lineNumberToInfo(oneBasedLine); } lineOffsetToPosition(line: number, column: number): number { @@ -348,6 +348,10 @@ namespace ts.server { } } + getLineCount() { + return this._getSnapshot().index.getLineCount(); + } + static fromString(script: string) { const svc = new ScriptVersionCache(); const snap = new LineIndexSnapshot(0, svc, new LineIndex()); @@ -400,8 +404,12 @@ namespace ts.server { return this.root.charOffsetToLineInfo(1, position); } + getLineCount() { + return this.root.lineCount(); + } + lineNumberToInfo(oneBasedLine: number): AbsolutePositionAndLineText { - const lineCount = this.root.lineCount(); + const lineCount = this.getLineCount(); if (oneBasedLine <= lineCount) { const { position, leaf } = this.root.lineNumberToInfo(oneBasedLine, 0); return { absolutePosition: position, lineText: leaf && leaf.text }; diff --git a/src/server/session.ts b/src/server/session.ts index 0b9ad913f8a..d534f445ee3 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1474,7 +1474,7 @@ namespace ts.server { // only to the previous line. If all this is true, then // add edits necessary to properly indent the current line. if ((args.key === "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) { - const { lineText, absolutePosition } = scriptInfo.getLineInfo(args.line); + const { lineText, absolutePosition } = scriptInfo.getAbsolutePositionAndLineText(args.line); if (lineText && lineText.search("\\S") < 0) { const preferredIndent = languageService.getIndentationAtPosition(file, position, formatOptions); let hasIndent = 0; diff --git a/src/services/services.ts b/src/services/services.ts index 67f9e537574..a0c41ffe94d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -603,7 +603,7 @@ namespace ts { } public getPositionOfLineAndCharacter(line: number, character: number): number { - return getPositionOfLineAndCharacter(this, line, character); + return computePositionOfLineAndCharacter(getLineStarts(this), line, character, this.text); } public getLineEndOfPosition(pos: number): number { @@ -1143,8 +1143,10 @@ namespace ts { useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getCurrentDirectory: () => currentDirectory, getProgram, - fileExists: host.fileExists ? f => host.fileExists!(f) : returnFalse, - readFile: host.readFile ? (f, encoding) => host.readFile!(f, encoding) : () => undefined, + fileExists: host.fileExists && (f => host.fileExists!(f)), + readFile: host.readFile && ((f, encoding) => host.readFile!(f, encoding)), + getDocumentPositionMapper: host.getDocumentPositionMapper && (f => host.getDocumentPositionMapper!(f)), + getSourceFileLike: host.getSourceFileLike && (f => host.getSourceFileLike!(f)), log }); diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 7b51c9ecff9..c679688e6c0 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -13,8 +13,10 @@ namespace ts { useCaseSensitiveFileNames(): boolean; getCurrentDirectory(): string; getProgram(): Program | undefined; - fileExists(path: string): boolean; - readFile(path: string, encoding?: string): string | undefined; + fileExists?(path: string): boolean; + readFile?(path: string, encoding?: string): string | undefined; + getSourceFileLike?(fileName: string): SourceFileLike | undefined; + getDocumentPositionMapper?(fileName: string): DocumentPositionMapper | undefined; log(s: string): void; } @@ -22,63 +24,33 @@ namespace ts { const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); const currentDirectory = host.getCurrentDirectory(); const sourceFileLike = createMap(); + const documentPositionMappers = createMap(); return { tryGetSourcePosition, tryGetGeneratedPosition, toLineColumnOffset, clearCache }; function toPath(fileName: string) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } - function scanForSourcemapURL(fileName: string) { - const mappedFile = sourceFileLike.get(toPath(fileName)); - if (!mappedFile) { - return; - } + function getDocumentPositionMapper(fileName: string) { + const path = toPath(fileName); + const value = documentPositionMappers.get(path); + if (value) return value; - return tryGetSourceMappingURL(mappedFile.text, getLineStarts(mappedFile)); - } - - function convertDocumentToSourceMapper(file: SourceFileLike, contents: string, mapFileName: string) { - const map = tryParseRawSourceMap(contents); - if (!map || !map.sources || !map.file || !map.mappings) { - // obviously invalid map - return file.sourceMapper = identitySourceMapConsumer; + let mapper: DocumentPositionMapper | undefined; + if (host.getDocumentPositionMapper) { + mapper = host.getDocumentPositionMapper(fileName); } - - return file.sourceMapper = createDocumentPositionMapper({ - getSourceFileLike, - getCanonicalFileName, - log: s => host.log(s), - }, map, mapFileName); - } - - function getSourceMapper(fileName: string, file: SourceFileLike): DocumentPositionMapper { - if (file.sourceMapper) { - return file.sourceMapper; + else if (host.readFile) { + const file = getSourceFileLike(fileName); + mapper = file && ts.getDocumentPositionMapper({ + getSourceFileLike, + getCanonicalFileName, + log: s => host.log(s), + readMapFile: f => !host.fileExists || host.fileExists(f) ? host.readFile!(f) : undefined + }, fileName, getLineInfo(file.text, getLineStarts(file))); } - let mapFileName = scanForSourcemapURL(fileName); - if (mapFileName) { - const match = base64UrlRegExp.exec(mapFileName); - if (match) { - if (match[1]) { - const base64Object = match[1]; - return convertDocumentToSourceMapper(file, base64decode(sys, base64Object), fileName); - } - // Not a data URL we can parse, skip it - mapFileName = undefined; - } - } - const possibleMapLocations: string[] = []; - if (mapFileName) { - possibleMapLocations.push(mapFileName); - } - possibleMapLocations.push(fileName + ".map"); - for (const location of possibleMapLocations) { - const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(fileName)); - if (host.fileExists(mapFileName)) { - return convertDocumentToSourceMapper(file, host.readFile(mapFileName)!, mapFileName); // TODO: GH#18217 - } - } - return file.sourceMapper = identitySourceMapConsumer; + documentPositionMappers.set(path, mapper || identitySourceMapConsumer); + return mapper || identitySourceMapConsumer; } function tryGetSourcePosition(info: DocumentPosition): DocumentPosition | undefined { @@ -87,8 +59,8 @@ namespace ts { const file = getSourceFile(info.fileName); if (!file) return undefined; - const newLoc = getSourceMapper(info.fileName, file).getSourcePosition(info); - return newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; + const newLoc = getDocumentPositionMapper(info.fileName).getSourcePosition(info); + return !newLoc || newLoc === info ? undefined : tryGetSourcePosition(newLoc) || newLoc; } function tryGetGeneratedPosition(info: DocumentPosition): DocumentPosition | undefined { @@ -106,10 +78,7 @@ namespace ts { getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - const declarationFile = getSourceFileLikeFromCache(declarationPath); - if (!declarationFile) return undefined; - - const newLoc = getSourceMapper(declarationPath, declarationFile).getGeneratedPosition(info); + const newLoc = getDocumentPositionMapper(declarationPath).getGeneratedPosition(info); return newLoc === info ? undefined : newLoc; } @@ -123,42 +92,92 @@ namespace ts { return file && file.resolvedPath === path ? file : undefined; } - function getSourceFileLikeFromCache(fileName: string): SourceFileLike | undefined { + function getOrCreateSourceFileLike(fileName: string): SourceFileLike | undefined { const path = toPath(fileName); const fileFromCache = sourceFileLike.get(path); if (fileFromCache !== undefined) return fileFromCache ? fileFromCache : undefined; // TODO: should ask host instead? - if (!host.fileExists(path)) { + if (!host.readFile || host.fileExists && !host.fileExists(path)) { sourceFileLike.set(path, false); return undefined; } // And failing that, check the disk const text = host.readFile(path); - const file: SourceFileLike | false = text ? { - text, - lineMap: undefined, - getLineAndCharacterOfPosition(pos: number) { - return computeLineAndCharacterOfPosition(getLineStarts(this as SourceFileLike), pos); - } - } : false; + const file = text ? createSourceFileLike(text) : false; sourceFileLike.set(path, file); return file ? file : undefined; } // This can be called from source mapper in either source program or program that includes generated file function getSourceFileLike(fileName: string) { - return getSourceFile(fileName) || getSourceFileLikeFromCache(fileName); + return !host.getSourceFileLike ? + getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : + host.getSourceFileLike(fileName); } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { + // TODO:: shkamat const file = getSourceFileLike(fileName)!; // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } function clearCache(): void { sourceFileLike.clear(); + documentPositionMappers.clear(); } } + + export interface GetDocumentPositionMapperHost extends DocumentPositionMapperHost { + readMapFile(fileName: string): string | undefined; + } + + export function getDocumentPositionMapper(host: GetDocumentPositionMapperHost, generatedFileName: string, generatedFileLineInfo: LineInfo) { + let mapFileName = tryGetSourceMappingURL(generatedFileLineInfo); + if (mapFileName) { + const match = base64UrlRegExp.exec(mapFileName); + if (match) { + if (match[1]) { + const base64Object = match[1]; + return convertDocumentToSourceMapper(host, base64decode(sys, base64Object), generatedFileName); + } + // Not a data URL we can parse, skip it + mapFileName = undefined; + } + } + const possibleMapLocations: string[] = []; + if (mapFileName) { + possibleMapLocations.push(mapFileName); + } + possibleMapLocations.push(generatedFileName + ".map"); + for (const location of possibleMapLocations) { + const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName)); + const mapFileContents = host.readMapFile(mapFileName); + if (mapFileContents) { + return convertDocumentToSourceMapper(host, mapFileContents, mapFileName); + } + } + return undefined; + } + + function convertDocumentToSourceMapper(host: DocumentPositionMapperHost, contents: string, mapFileName: string) { + const map = tryParseRawSourceMap(contents); + if (!map || !map.sources || !map.file || !map.mappings) { + // obviously invalid map + return undefined; + } + + return createDocumentPositionMapper(host, map, mapFileName); + } + + function createSourceFileLike(text: string, lineMap?: SourceFileLike["lineMap"]): SourceFileLike { + return { + text, + lineMap, + getLineAndCharacterOfPosition(pos: number) { + return computeLineAndCharacterOfPosition(getLineStarts(this), pos); + } + }; + } } diff --git a/src/services/types.ts b/src/services/types.ts index 69f07b705a7..d3a8f8cdd52 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -91,7 +91,6 @@ namespace ts { export interface SourceFileLike { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - /*@internal*/ sourceMapper?: DocumentPositionMapper; } export interface SourceMapSource { @@ -233,6 +232,11 @@ namespace ts { installPackage?(options: InstallPackageOptions): Promise; /* @internal */ inspectValue?(options: InspectValueOptions): Promise; writeFile?(fileName: string, content: string): void; + + /* @internal */ + getDocumentPositionMapper?(fileName: string): DocumentPositionMapper | undefined; + /* @internal */ + getSourceFileLike?(fileName: string): SourceFileLike | undefined; } /* @internal */ diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/textStorage.ts index 5dce083120b..f5fbb512e52 100644 --- a/src/testRunner/unittests/textStorage.ts +++ b/src/testRunner/unittests/textStorage.ts @@ -60,7 +60,7 @@ namespace ts.textStorage { ts1.useText(); assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 2"); - ts1.getLineInfo(0); + ts1.getAbsolutePositionAndLineText(0); assert.isTrue(ts1.hasScriptVersionCache_TestOnly(), "have script version cache - 2"); }); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2b78178587e..b788d46ac9f 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8046,7 +8046,6 @@ declare namespace ts.server { readonly containingProjects: Project[]; private formatSettings; private preferences; - private textStorage; constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion); isScriptOpen(): boolean; open(newText: string): void; @@ -8211,6 +8210,7 @@ declare namespace ts.server { getGlobalProjectErrors(): ReadonlyArray; getAllProjectErrors(): ReadonlyArray; getLanguageService(ensureSynchronized?: boolean): LanguageService; + private readMapFile; private shouldEmitFile; getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; /** From afdf1e90ecd9c438cc860860fcb676af8c78d8d5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Nov 2018 11:24:01 -0800 Subject: [PATCH 118/322] Dont depend on project in document position mapper so that we can unload or remove projects independently --- src/server/editorServices.ts | 64 +++++++++++++++++++ src/server/project.ts | 54 +--------------- src/services/sourcemaps.ts | 25 ++++---- .../reference/api/tsserverlibrary.d.ts | 1 - 4 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 90b516dadfc..dd05b562cff 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2195,6 +2195,70 @@ namespace ts.server { return this.filenameToScriptInfo.get(fileName); } + /*@internal*/ + getDocumentPositionMapper(fileName: string, project: Project): DocumentPositionMapper | undefined { + const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); + if (!declarationInfo) return undefined; + + declarationInfo.getSnapshot(); // Ensure synchronized + const existingMapper = declarationInfo.textStorage.mapper; + if (existingMapper !== undefined) { + return existingMapper ? existingMapper : undefined; + } + + // Create the mapper + declarationInfo.mapInfo = undefined; + + let readMapFile: ((fileName: string) => string | undefined) | undefined = fileName => { + const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); + if (!mapInfo) return undefined; + declarationInfo.mapInfo = mapInfo; + const snap = mapInfo.getSnapshot(); + return snap.getText(0, snap.getLength()); + }; + const projectName = project.projectName; + const mapper = getDocumentPositionMapper( + { getCanonicalFileName: this.toCanonicalFileName, log: s => this.logger.info(s), getSourceFileLike: f => this.getSourceFileLike(f, projectName) }, + declarationInfo.fileName, + declarationInfo.textStorage.getLineInfo(), + readMapFile + ); + readMapFile = undefined; // Remove ref to project + declarationInfo.textStorage.mapper = mapper || false; + return mapper; + } + + /*@internal*/ + getSourceFileLike(fileName: string, projectName: string | Project) { + const project = (projectName as Project).projectName ? projectName as Project : this.findProject(projectName as string); + if (project) { + const path = project.toPath(fileName); + const sourceFile = project.getSourceFile(path); + if (sourceFile && sourceFile.resolvedPath === path) return sourceFile; + } + + // Need to look for other files. + const info = this.getOrCreateScriptInfoNotOpenedByClient(fileName, (project || this).currentDirectory, project ? project.directoryStructureHost : this.host); + if (!info) return undefined; + + // Key doesnt matter since its only for text and lines + if (info.cacheSourceFile) return info.cacheSourceFile.sourceFile; + if (info.textStorage.sourceFileLike) return info.textStorage.sourceFileLike; + + info.textStorage.sourceFileLike = { + get text() { + Debug.fail("shouldnt need text"); + return ""; + }, + getLineAndCharacterOfPosition: pos => { + const lineOffset = info.positionToLineOffset(pos); + return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; + }, + getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) + }; + return info.textStorage.sourceFileLike; + } + setHostConfiguration(args: protocol.ConfigureRequestArguments) { if (args.file) { const info = this.getScriptInfoForNormalizedPath(toNormalizedPath(args.file)); diff --git a/src/server/project.ts b/src/server/project.ts index 566a2b9abe9..6ea9589cb4b 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -505,62 +505,12 @@ namespace ts.server { /*@internal*/ getDocumentPositionMapper(fileName: string): DocumentPositionMapper | undefined { - const declarationInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); - if (!declarationInfo) return undefined; - - declarationInfo.getSnapshot(); // Ensure synchronized - const existingMapper = declarationInfo.textStorage.mapper; - if (existingMapper !== undefined) { - return existingMapper ? existingMapper : undefined; - } - - // Create the mapper - declarationInfo.mapInfo = undefined; - - const mapper = getDocumentPositionMapper({ - getCanonicalFileName: this.projectService.toCanonicalFileName, - log: s => this.log(s), - readMapFile: f => this.readMapFile(f, declarationInfo), - getSourceFileLike: f => this.getSourceFileLike(f) - }, declarationInfo.fileName, declarationInfo.textStorage.getLineInfo()); - declarationInfo.textStorage.mapper = mapper || false; - return mapper; - } - - private readMapFile(fileName: string, declarationInfo: ScriptInfo) { - const mapInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); - if (!mapInfo) return undefined; - declarationInfo.mapInfo = mapInfo; - const snap = mapInfo.getSnapshot(); - return snap.getText(0, snap.getLength()); + return this.projectService.getDocumentPositionMapper(fileName, this); } /*@internal*/ getSourceFileLike(fileName: string) { - const path = this.toPath(fileName); - const sourceFile = this.getSourceFile(path); - if (sourceFile && sourceFile.resolvedPath === path) return sourceFile; - - // Need to look for other files. - const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); - if (!info) return undefined; - - // Key doesnt matter since its only for text and lines - if (info.cacheSourceFile) return info.cacheSourceFile.sourceFile; - if (info.textStorage.sourceFileLike) return info.textStorage.sourceFileLike; - - info.textStorage.sourceFileLike = { - get text() { - Debug.fail("shouldnt need text"); - return ""; - }, - getLineAndCharacterOfPosition: pos => { - const lineOffset = info.positionToLineOffset(pos); - return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; - }, - getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) - }; - return info.textStorage.sourceFileLike; + return this.projectService.getSourceFileLike(fileName, this); } private shouldEmitFile(scriptInfo: ScriptInfo) { diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index c679688e6c0..00d2696abf5 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -42,12 +42,12 @@ namespace ts { } else if (host.readFile) { const file = getSourceFileLike(fileName); - mapper = file && ts.getDocumentPositionMapper({ - getSourceFileLike, - getCanonicalFileName, - log: s => host.log(s), - readMapFile: f => !host.fileExists || host.fileExists(f) ? host.readFile!(f) : undefined - }, fileName, getLineInfo(file.text, getLineStarts(file))); + mapper = file && ts.getDocumentPositionMapper( + { getSourceFileLike, getCanonicalFileName, log: s => host.log(s) }, + fileName, + getLineInfo(file.text, getLineStarts(file)), + f => !host.fileExists || host.fileExists(f) ? host.readFile!(f) : undefined + ); } documentPositionMappers.set(path, mapper || identitySourceMapConsumer); return mapper || identitySourceMapConsumer; @@ -118,7 +118,6 @@ namespace ts { } function toLineColumnOffset(fileName: string, position: number): LineAndCharacter { - // TODO:: shkamat const file = getSourceFileLike(fileName)!; // TODO: GH#18217 return file.getLineAndCharacterOfPosition(position); } @@ -129,11 +128,11 @@ namespace ts { } } - export interface GetDocumentPositionMapperHost extends DocumentPositionMapperHost { - readMapFile(fileName: string): string | undefined; - } - - export function getDocumentPositionMapper(host: GetDocumentPositionMapperHost, generatedFileName: string, generatedFileLineInfo: LineInfo) { + export function getDocumentPositionMapper( + host: DocumentPositionMapperHost, + generatedFileName: string, + generatedFileLineInfo: LineInfo, + readMapFile: (fileName: string) => string | undefined) { let mapFileName = tryGetSourceMappingURL(generatedFileLineInfo); if (mapFileName) { const match = base64UrlRegExp.exec(mapFileName); @@ -153,7 +152,7 @@ namespace ts { possibleMapLocations.push(generatedFileName + ".map"); for (const location of possibleMapLocations) { const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName)); - const mapFileContents = host.readMapFile(mapFileName); + const mapFileContents = readMapFile(mapFileName); if (mapFileContents) { return convertDocumentToSourceMapper(host, mapFileContents, mapFileName); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index b788d46ac9f..1a104716c28 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8210,7 +8210,6 @@ declare namespace ts.server { getGlobalProjectErrors(): ReadonlyArray; getAllProjectErrors(): ReadonlyArray; getLanguageService(ensureSynchronized?: boolean): LanguageService; - private readMapFile; private shouldEmitFile; getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; /** From 5c920f336812ef910b75a9ad3a325d713a7b9ef9 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Nov 2018 12:31:23 -0800 Subject: [PATCH 119/322] Dont unnecessarily make textStorage internal --- src/server/editorServices.ts | 34 ++++++++++--------- src/server/scriptInfo.ts | 22 +++++++----- src/testRunner/unittests/textStorage.ts | 14 ++++---- .../reference/api/tsserverlibrary.d.ts | 1 + 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index dd05b562cff..49f94f3fc95 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2201,7 +2201,7 @@ namespace ts.server { if (!declarationInfo) return undefined; declarationInfo.getSnapshot(); // Ensure synchronized - const existingMapper = declarationInfo.textStorage.mapper; + const existingMapper = declarationInfo.mapper; if (existingMapper !== undefined) { return existingMapper ? existingMapper : undefined; } @@ -2220,11 +2220,11 @@ namespace ts.server { const mapper = getDocumentPositionMapper( { getCanonicalFileName: this.toCanonicalFileName, log: s => this.logger.info(s), getSourceFileLike: f => this.getSourceFileLike(f, projectName) }, declarationInfo.fileName, - declarationInfo.textStorage.getLineInfo(), + declarationInfo.getLineInfo(), readMapFile ); readMapFile = undefined; // Remove ref to project - declarationInfo.textStorage.mapper = mapper || false; + declarationInfo.mapper = mapper || false; return mapper; } @@ -2243,20 +2243,22 @@ namespace ts.server { // Key doesnt matter since its only for text and lines if (info.cacheSourceFile) return info.cacheSourceFile.sourceFile; - if (info.textStorage.sourceFileLike) return info.textStorage.sourceFileLike; - info.textStorage.sourceFileLike = { - get text() { - Debug.fail("shouldnt need text"); - return ""; - }, - getLineAndCharacterOfPosition: pos => { - const lineOffset = info.positionToLineOffset(pos); - return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; - }, - getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) - }; - return info.textStorage.sourceFileLike; + // Create sourceFileLike + if (!info.sourceFileLike) { + info.sourceFileLike = { + get text() { + Debug.fail("shouldnt need text"); + return ""; + }, + getLineAndCharacterOfPosition: pos => { + const lineOffset = info.positionToLineOffset(pos); + return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; + }, + getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) + }; + } + return info.sourceFileLike; } setHostConfiguration(args: protocol.ConfigureRequestArguments) { diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 3502fff1556..71b8fe2f2b5 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -46,9 +46,6 @@ namespace ts.server { */ private pendingReloadFromDisk = false; - mapper: DocumentPositionMapper | false | undefined = false; - sourceFileLike: SourceFileLike | undefined; - constructor(private readonly host: ServerHost, private readonly fileName: NormalizedPath, initialVersion: ScriptInfoVersion | undefined, private readonly info: ScriptInfo) { this.version = initialVersion || { svc: 0, text: 0 }; } @@ -73,8 +70,8 @@ namespace ts.server { this.text = newText; this.lineMap = undefined; this.fileSize = undefined; - this.mapper = undefined; - this.sourceFileLike = undefined; + this.info.mapper = undefined; + this.info.sourceFileLike = undefined; this.version.text++; } @@ -84,8 +81,8 @@ namespace ts.server { this.text = undefined; this.lineMap = undefined; this.fileSize = undefined; - this.mapper = undefined; - this.sourceFileLike = undefined; + this.info.mapper = undefined; + this.info.sourceFileLike = undefined; } /** @@ -287,7 +284,7 @@ namespace ts.server { /* @internal */ fileWatcher: FileWatcher | undefined; - /* @internal */ textStorage: TextStorage; + private textStorage: TextStorage; /*@internal*/ readonly isDynamic: boolean; @@ -304,6 +301,10 @@ namespace ts.server { /*@internal*/ mapInfo?: ScriptInfo; + /*@internal*/ + mapper: DocumentPositionMapper | false | undefined = false; + /*@internal*/ + sourceFileLike: SourceFileLike | undefined; constructor( private readonly host: ServerHost, @@ -583,5 +584,10 @@ namespace ts.server { public isJavaScript() { return this.scriptKind === ScriptKind.JS || this.scriptKind === ScriptKind.JSX; } + + /*@internal*/ + getLineInfo(): LineInfo { + return this.textStorage.getLineInfo(); + } } } diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/textStorage.ts index f5fbb512e52..724dc8e4ed3 100644 --- a/src/testRunner/unittests/textStorage.ts +++ b/src/testRunner/unittests/textStorage.ts @@ -14,8 +14,8 @@ namespace ts.textStorage { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); - const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); ts1.useScriptVersionCache_TestOnly(); ts2.useText(); @@ -49,7 +49,7 @@ namespace ts.textStorage { it("should switch to script version cache if necessary", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); ts1.getSnapshot(); assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 1"); @@ -67,7 +67,7 @@ namespace ts.textStorage { it("should be able to return the file size immediately after construction", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); }); @@ -75,7 +75,7 @@ namespace ts.textStorage { it("should be able to return the file size when backed by text", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); ts1.useText(f.content); assert.isFalse(ts1.hasScriptVersionCache_TestOnly()); @@ -86,7 +86,7 @@ namespace ts.textStorage { it("should be able to return the file size when backed by a script version cache", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); ts1.useScriptVersionCache_TestOnly(); assert.isTrue(ts1.hasScriptVersionCache_TestOnly()); @@ -126,7 +126,7 @@ namespace ts.textStorage { const host = projectSystem.createServerHost([changingFile]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(changingFile.path), /*initialVersion*/ undefined, /*info*/undefined!); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(changingFile.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); assert.isTrue(ts1.reloadFromDisk()); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1a104716c28..2b78178587e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8046,6 +8046,7 @@ declare namespace ts.server { readonly containingProjects: Project[]; private formatSettings; private preferences; + private textStorage; constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion); isScriptOpen(): boolean; open(newText: string): void; From 0aa4da43adc0f73012a59942d03f2df04954d6be Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Nov 2018 11:52:29 -0800 Subject: [PATCH 120/322] Life time of declaration, sources and map infos Map Info and sources is not ideal and need to revisited since we need to update mapper and projects correctly // TODO: lifetime of source project and declaration map --- src/server/editorServices.ts | 44 ++++++--- src/server/scriptInfo.ts | 2 + .../unittests/tsserverProjectSystem.ts | 95 +++++++++++++++---- .../reference/api/tsserverlibrary.d.ts | 4 - 4 files changed, 112 insertions(+), 33 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 49f94f3fc95..d98aa948113 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -437,7 +437,8 @@ namespace ts.server { /** * Container of all known scripts */ - private readonly filenameToScriptInfo = createMap(); + /*@internal*/ + readonly filenameToScriptInfo = createMap(); private readonly scriptInfoInNodeModulesWatchers = createMap (); /** * Contains all the deleted script info's version information so that @@ -2209,6 +2210,7 @@ namespace ts.server { // Create the mapper declarationInfo.mapInfo = undefined; + // TODO: shkamat Lifetime of declarationInfo and mapInfo let readMapFile: ((fileName: string) => string | undefined) | undefined = fileName => { const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); if (!mapInfo) return undefined; @@ -2218,7 +2220,7 @@ namespace ts.server { }; const projectName = project.projectName; const mapper = getDocumentPositionMapper( - { getCanonicalFileName: this.toCanonicalFileName, log: s => this.logger.info(s), getSourceFileLike: f => this.getSourceFileLike(f, projectName) }, + { getCanonicalFileName: this.toCanonicalFileName, log: s => this.logger.info(s), getSourceFileLike: f => this.getSourceFileLike(f, projectName, declarationInfo) }, declarationInfo.fileName, declarationInfo.getLineInfo(), readMapFile @@ -2229,8 +2231,8 @@ namespace ts.server { } /*@internal*/ - getSourceFileLike(fileName: string, projectName: string | Project) { - const project = (projectName as Project).projectName ? projectName as Project : this.findProject(projectName as string); + getSourceFileLike(fileName: string, projectNameOrProject: string | Project, declarationInfo?: ScriptInfo) { + const project = (projectNameOrProject as Project).projectName ? projectNameOrProject as Project : this.findProject(projectNameOrProject as string); if (project) { const path = project.toPath(fileName); const sourceFile = project.getSourceFile(path); @@ -2241,6 +2243,11 @@ namespace ts.server { const info = this.getOrCreateScriptInfoNotOpenedByClient(fileName, (project || this).currentDirectory, project ? project.directoryStructureHost : this.host); if (!info) return undefined; + // Attach as source + if (declarationInfo && declarationInfo.mapInfo && info !== declarationInfo) { + (declarationInfo.mapInfo.sourceInfos || (declarationInfo.mapInfo.sourceInfos = createMap())).set(info.path, true); + } + // Key doesnt matter since its only for text and lines if (info.cacheSourceFile) return info.cacheSourceFile.sourceFile; @@ -2556,13 +2563,7 @@ namespace ts.server { // when some file/s were closed which resulted in project removal. // It was then postponed to cleanup these script infos so that they can be reused if // the file from that old project is reopened because of opening file from here. - this.filenameToScriptInfo.forEach(info => { - if (!info.isScriptOpen() && info.isOrphan()) { - // if there are not projects that include this script info - delete it - this.stopWatchingScriptInfo(info); - this.deleteScriptInfo(info); - } - }); + this.removeOrphanScriptInfos(); this.printProjects(); @@ -2605,6 +2606,27 @@ namespace ts.server { } } + private removeOrphanScriptInfos() { + const toRemoveScriptInfos = cloneMap(this.filenameToScriptInfo); + this.filenameToScriptInfo.forEach(info => { + if (info.isScriptOpen() || !info.isOrphan()) { + toRemoveScriptInfos.delete(info.path); + if (info.mapInfo) { + toRemoveScriptInfos.delete(info.mapInfo.path); + if (info.mapInfo.sourceInfos) { + info.mapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); + } + } + } + }); + + toRemoveScriptInfos.forEach(info => { + // if there are not projects that include this script info - delete it + this.stopWatchingScriptInfo(info); + this.deleteScriptInfo(info); + }); + } + private telemetryOnOpenFile(scriptInfo: ScriptInfo): void { if (this.syntaxOnly || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) { return; diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 71b8fe2f2b5..3d8c737064f 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -302,6 +302,8 @@ namespace ts.server { /*@internal*/ mapInfo?: ScriptInfo; /*@internal*/ + sourceInfos?: Map; + /*@internal*/ mapper: DocumentPositionMapper | false | undefined = false; /*@internal*/ sourceFileLike: SourceFileLike | undefined; diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 6681b4bfa54..217149efd88 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -475,6 +475,10 @@ namespace ts.projectSystem { checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); } + function checkScriptInfos(projectService: server.ProjectService, expectedFiles: ReadonlyArray) { + checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles); + } + function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { const start = str.indexOf(substring); Debug.assert(start !== -1); @@ -10667,7 +10671,7 @@ declare class TestLib { }); }); - it("can go to definition correctly", () => { + describe("with main and depedency project", () => { const projectLocation = "/user/username/projects/myproject"; const dependecyLocation = `${projectLocation}/dependency`; const mainLocation = `${projectLocation}/main`; @@ -10704,24 +10708,79 @@ fn5();` }) }; - const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile]; - const host = createHost(files, [mainConfig.path]); - const session = createSession(host); - const service = session.getProjectService(); - openFilesForSession([mainTs], session); - checkNumberOfProjects(service, { configuredProjects: 1 }); - checkProjectActualFiles(service.configuredProjects.get(mainConfig.path)!, [mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`]); - for (let i = 0; i < 5; i++) { - const startSpan = { line: i + 5, offset: 1 }; - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.DefinitionAndBoundSpan, - arguments: { file: mainTs.path, ...startSpan } - }).response as protocol.DefinitionInfoAndBoundSpan; - assert.deepEqual(response, { - definitions: [{ file: dependencyTs.path, start: { line: i + 1, offset: 17 }, end: { line: i + 1, offset: 20 } }], - textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } - }); + const randomFile: File = { + path: `${projectLocation}/random/random.ts`, + content: "let a = 10;" + }; + const randomConfig: File = { + path: `${projectLocation}/random/tsconfig.json`, + content: "{}" + }; + + const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; + + function verifyInfos(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + checkScriptInfos(service, openInfos.concat(closedInfos)); + checkWatchedFiles(host, closedInfos.concat(otherWatchedFiles).map(f => f.toLowerCase())); } + + it("can go to definition correctly", () => { + const host = createHost(files, [mainConfig.path]); + const session = createSession(host); + const service = session.getProjectService(); + openFilesForSession([mainTs], session); + checkNumberOfProjects(service, { configuredProjects: 1 }); + checkProjectActualFiles(service.configuredProjects.get(mainConfig.path)!, [mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`]); + for (let i = 0; i < 5; i++) { + const startSpan = { line: i + 5, offset: 1 }; + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.DefinitionAndBoundSpan, + arguments: { file: mainTs.path, ...startSpan } + }).response as protocol.DefinitionInfoAndBoundSpan; + assert.deepEqual(response, { + definitions: [{ file: dependencyTs.path, start: { line: i + 1, offset: 17 }, end: { line: i + 1, offset: 20 } }], + textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } + }); + } + checkNumberOfProjects(service, { configuredProjects: 1 }); + const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + verifyInfos(service, host, [mainTs.path], closedInfos, [mainConfig.path]); + + openFilesForSession([randomFile], session); + verifyInfos(service, host, [mainTs.path, randomFile.path], closedInfos, [mainConfig.path, randomConfig.path]); + }); + + it("rename locations from depedency", () => { + const host = createHost(files, [mainConfig.path]); + const session = createSession(host); + const service = session.getProjectService(); + openFilesForSession([dependencyTs, randomFile], session); + checkNumberOfProjects(service, { configuredProjects: 2 }); + checkProjectActualFiles(service.configuredProjects.get(dependencyConfig.path)!, [dependencyTs.path, libFile.path, dependencyConfig.path]); + debugger; + for (let i = 0; i < 5; i++) { + const startSpan = { line: i + 1, offset: 17 }; + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.Rename, + arguments: { file: dependencyTs.path, ...startSpan } + }).response as protocol.RenameResponseBody; + assert.deepEqual(response.locs, [{ + file: dependencyTs.path, + locs: [{ start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }] + }]); + } + checkNumberOfProjects(service, { configuredProjects: 2 }); + const openInfos = [dependencyTs.path, randomFile.path]; + const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + const otherWatchedFiles = [dependencyConfig.path, randomConfig.path]; + verifyInfos(service, host, openInfos, closedInfos, otherWatchedFiles); + + // Collect the orphan projects and infos + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + + verifyInfos(service, host, openInfos, closedInfos, otherWatchedFiles); + }); }); }); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2b78178587e..2bf91fac4f4 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8497,10 +8497,6 @@ declare namespace ts.server { syntaxOnly?: boolean; } class ProjectService { - /** - * Container of all known scripts - */ - private readonly filenameToScriptInfo; private readonly scriptInfoInNodeModulesWatchers; /** * Contains all the deleted script info's version information so that From 56a39b754c655f726ff7efbaebf8cec8c9c2452d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 29 Nov 2018 14:14:45 -0800 Subject: [PATCH 121/322] Keep alive declaration script info and map file info if source file info is alive --- src/server/editorServices.ts | 36 +++++++++++++------ src/server/project.ts | 4 +-- src/server/scriptInfo.ts | 15 +++++--- src/services/services.ts | 2 +- src/services/sourcemaps.ts | 14 ++++---- src/services/types.ts | 2 +- .../unittests/tsserverProjectSystem.ts | 1 - 7 files changed, 47 insertions(+), 27 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index d98aa948113..5c70c7be8bf 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2197,8 +2197,8 @@ namespace ts.server { } /*@internal*/ - getDocumentPositionMapper(fileName: string, project: Project): DocumentPositionMapper | undefined { - const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); + getDocumentPositionMapper(project: Project, generatedFileName: string, sourceFileName?: string): DocumentPositionMapper | undefined { + const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, project.directoryStructureHost); if (!declarationInfo) return undefined; declarationInfo.getSnapshot(); // Ensure synchronized @@ -2210,7 +2210,6 @@ namespace ts.server { // Create the mapper declarationInfo.mapInfo = undefined; - // TODO: shkamat Lifetime of declarationInfo and mapInfo let readMapFile: ((fileName: string) => string | undefined) | undefined = fileName => { const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); if (!mapInfo) return undefined; @@ -2227,6 +2226,11 @@ namespace ts.server { ); readMapFile = undefined; // Remove ref to project declarationInfo.mapper = mapper || false; + if (sourceFileName && mapper) { + // Attach as source + const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; + (declarationInfo.mapInfo!.sourceInfos || (declarationInfo.mapInfo!.sourceInfos = createMap())).set(sourceInfo.path, true); + } return mapper; } @@ -2609,13 +2613,25 @@ namespace ts.server { private removeOrphanScriptInfos() { const toRemoveScriptInfos = cloneMap(this.filenameToScriptInfo); this.filenameToScriptInfo.forEach(info => { - if (info.isScriptOpen() || !info.isOrphan()) { - toRemoveScriptInfos.delete(info.path); - if (info.mapInfo) { - toRemoveScriptInfos.delete(info.mapInfo.path); - if (info.mapInfo.sourceInfos) { - info.mapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); - } + // If script info is open or orphan, retain it and its dependencies + if (!info.isScriptOpen() && info.isOrphan()) { + // Otherwise if there is any source info that is alive, this alive too + if (!info.mapInfo || !info.mapInfo.sourceInfos) return; + if (!forEachKey(info.mapInfo.sourceInfos, path => { + const info = this.getScriptInfoForPath(path as Path)!; + return info.isScriptOpen() || !info.isOrphan(); + })) { + return; + } + } + + // Retain this script info + toRemoveScriptInfos.delete(info.path); + if (info.mapInfo) { + // And map file info and source infos + toRemoveScriptInfos.delete(info.mapInfo.path); + if (info.mapInfo.sourceInfos) { + info.mapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); } } }); diff --git a/src/server/project.ts b/src/server/project.ts index 6ea9589cb4b..a28e9c35be5 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -504,8 +504,8 @@ namespace ts.server { } /*@internal*/ - getDocumentPositionMapper(fileName: string): DocumentPositionMapper | undefined { - return this.projectService.getDocumentPositionMapper(fileName, this); + getDocumentPositionMapper(generatedFileName: string, sourceFileName?: string): DocumentPositionMapper | undefined { + return this.projectService.getDocumentPositionMapper(this, generatedFileName, sourceFileName); } /*@internal*/ diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 3d8c737064f..d2f230178d3 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -64,14 +64,20 @@ namespace ts.server { this.switchToScriptVersionCache(); } + private resetSourceMapInfo() { + this.info.mapper = undefined; + this.info.sourceFileLike = undefined; + this.info.mapInfo = undefined; + this.info.sourceInfos = undefined; + } + /** Public for testing */ public useText(newText?: string) { this.svc = undefined; this.text = newText; this.lineMap = undefined; this.fileSize = undefined; - this.info.mapper = undefined; - this.info.sourceFileLike = undefined; + this.resetSourceMapInfo(); this.version.text++; } @@ -81,8 +87,7 @@ namespace ts.server { this.text = undefined; this.lineMap = undefined; this.fileSize = undefined; - this.info.mapper = undefined; - this.info.sourceFileLike = undefined; + this.resetSourceMapInfo(); } /** @@ -304,7 +309,7 @@ namespace ts.server { /*@internal*/ sourceInfos?: Map; /*@internal*/ - mapper: DocumentPositionMapper | false | undefined = false; + mapper?: DocumentPositionMapper | false; /*@internal*/ sourceFileLike: SourceFileLike | undefined; diff --git a/src/services/services.ts b/src/services/services.ts index a0c41ffe94d..e8dfb8640e0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1145,7 +1145,7 @@ namespace ts { getProgram, fileExists: host.fileExists && (f => host.fileExists!(f)), readFile: host.readFile && ((f, encoding) => host.readFile!(f, encoding)), - getDocumentPositionMapper: host.getDocumentPositionMapper && (f => host.getDocumentPositionMapper!(f)), + getDocumentPositionMapper: host.getDocumentPositionMapper && ((generatedFileName, sourceFileName) => host.getDocumentPositionMapper!(generatedFileName, sourceFileName)), getSourceFileLike: host.getSourceFileLike && (f => host.getSourceFileLike!(f)), log }); diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 00d2696abf5..ce692fc2184 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -16,7 +16,7 @@ namespace ts { fileExists?(path: string): boolean; readFile?(path: string, encoding?: string): string | undefined; getSourceFileLike?(fileName: string): SourceFileLike | undefined; - getDocumentPositionMapper?(fileName: string): DocumentPositionMapper | undefined; + getDocumentPositionMapper?(generatedFileName: string, sourceFileName?: string): DocumentPositionMapper | undefined; log(s: string): void; } @@ -31,20 +31,20 @@ namespace ts { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } - function getDocumentPositionMapper(fileName: string) { - const path = toPath(fileName); + function getDocumentPositionMapper(generatedFileName: string, sourceFileName?: string) { + const path = toPath(generatedFileName); const value = documentPositionMappers.get(path); if (value) return value; let mapper: DocumentPositionMapper | undefined; if (host.getDocumentPositionMapper) { - mapper = host.getDocumentPositionMapper(fileName); + mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); } else if (host.readFile) { - const file = getSourceFileLike(fileName); + const file = getSourceFileLike(generatedFileName); mapper = file && ts.getDocumentPositionMapper( { getSourceFileLike, getCanonicalFileName, log: s => host.log(s) }, - fileName, + generatedFileName, getLineInfo(file.text, getLineStarts(file)), f => !host.fileExists || host.fileExists(f) ? host.readFile!(f) : undefined ); @@ -78,7 +78,7 @@ namespace ts { getDeclarationEmitOutputFilePathWorker(info.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); if (declarationPath === undefined) return undefined; - const newLoc = getDocumentPositionMapper(declarationPath).getGeneratedPosition(info); + const newLoc = getDocumentPositionMapper(declarationPath, info.fileName).getGeneratedPosition(info); return newLoc === info ? undefined : newLoc; } diff --git a/src/services/types.ts b/src/services/types.ts index d3a8f8cdd52..5100a999306 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -234,7 +234,7 @@ namespace ts { writeFile?(fileName: string, content: string): void; /* @internal */ - getDocumentPositionMapper?(fileName: string): DocumentPositionMapper | undefined; + getDocumentPositionMapper?(generatedFileName: string, sourceFileName?: string): DocumentPositionMapper | undefined; /* @internal */ getSourceFileLike?(fileName: string): SourceFileLike | undefined; } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 217149efd88..59a6f6019d1 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10757,7 +10757,6 @@ fn5();` openFilesForSession([dependencyTs, randomFile], session); checkNumberOfProjects(service, { configuredProjects: 2 }); checkProjectActualFiles(service.configuredProjects.get(dependencyConfig.path)!, [dependencyTs.path, libFile.path, dependencyConfig.path]); - debugger; for (let i = 0; i < 5; i++) { const startSpan = { line: i + 1, offset: 17 }; const response = session.executeCommandSeq({ From 751cb9e2c3e63fdbb7f373427744ce5a266be60f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 30 Nov 2018 16:29:21 -0800 Subject: [PATCH 122/322] Update source and declaration projects on update to declaration file or map file TODO: add tests --- src/server/editorServices.ts | 89 +++++++++++++++---- src/server/scriptInfo.ts | 16 ++-- .../reference/api/tsserverlibrary.d.ts | 4 + 3 files changed, 86 insertions(+), 23 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5c70c7be8bf..5eb009fcb52 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -945,10 +945,39 @@ namespace ts.server { // this file and set of inferred projects info.delayReloadNonMixedContentFile(); this.delayUpdateProjectGraphs(info.containingProjects); + this.handleSourceMapProjects(info); } } } + private handleSourceMapProjects(info: ScriptInfo) { + // Change in d.ts, update source projects as well + if (info.sourceMapFilePath) { + const sourceMapFileInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + if (sourceMapFileInfo && sourceMapFileInfo.sourceInfos) { + this.delayUpdateSourceInfoProjects(sourceMapFileInfo.sourceInfos); + } + } + // Change in mapInfo, update declarationProjects and source projects + if (info.sourceInfos) { + this.delayUpdateSourceInfoProjects(info.sourceInfos); + } + if (info.declarationInfoPath) { + this.delayUpdateProjectsOfScriptInfoPath(info.declarationInfoPath); + } + } + + private delayUpdateSourceInfoProjects(sourceInfos: Map) { + sourceInfos.forEach((_value, path) => this.delayUpdateProjectsOfScriptInfoPath(path as Path)); + } + + private delayUpdateProjectsOfScriptInfoPath(path: Path) { + const info = this.getScriptInfoForPath(path); + if (info) { + this.delayUpdateProjectGraphs(info.containingProjects); + } + } + private handleDeletedFile(info: ScriptInfo) { this.stopWatchingScriptInfo(info); @@ -962,6 +991,7 @@ namespace ts.server { // update projects to make sure that set of referenced files is correct this.delayUpdateProjectGraphs(containingProjects); + this.handleSourceMapProjects(info); } } @@ -2201,19 +2231,30 @@ namespace ts.server { const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, project.directoryStructureHost); if (!declarationInfo) return undefined; + // Try to get from cache declarationInfo.getSnapshot(); // Ensure synchronized - const existingMapper = declarationInfo.mapper; - if (existingMapper !== undefined) { - return existingMapper ? existingMapper : undefined; + if (declarationInfo.sourceMapFilePath !== undefined) { + // Doesnt have sourceMap + if (!declarationInfo.sourceMapFilePath) return undefined; + + // Ensure mapper is synchronized + const mapFileInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (mapFileInfo) { + mapFileInfo.getSnapshot(); + if (mapFileInfo.mapper !== undefined) { + return mapFileInfo.mapper ? mapFileInfo.mapper : undefined; + } + } } // Create the mapper - declarationInfo.mapInfo = undefined; + declarationInfo.sourceMapFilePath = undefined; + let sourceMapFileInfo: ScriptInfo | undefined; let readMapFile: ((fileName: string) => string | undefined) | undefined = fileName => { const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); if (!mapInfo) return undefined; - declarationInfo.mapInfo = mapInfo; + sourceMapFileInfo = mapInfo; const snap = mapInfo.getSnapshot(); return snap.getText(0, snap.getLength()); }; @@ -2225,11 +2266,17 @@ namespace ts.server { readMapFile ); readMapFile = undefined; // Remove ref to project - declarationInfo.mapper = mapper || false; - if (sourceFileName && mapper) { - // Attach as source - const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; - (declarationInfo.mapInfo!.sourceInfos || (declarationInfo.mapInfo!.sourceInfos = createMap())).set(sourceInfo.path, true); + if (sourceMapFileInfo) { + declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; + sourceMapFileInfo.mapper = mapper || false; + if (sourceFileName && mapper) { + // Attach as source + const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; + (sourceMapFileInfo.sourceInfos || (sourceMapFileInfo.sourceInfos = createMap())).set(sourceInfo.path, true); + } + } + else { + declarationInfo.sourceMapFilePath = false; } return mapper; } @@ -2248,8 +2295,11 @@ namespace ts.server { if (!info) return undefined; // Attach as source - if (declarationInfo && declarationInfo.mapInfo && info !== declarationInfo) { - (declarationInfo.mapInfo.sourceInfos || (declarationInfo.mapInfo.sourceInfos = createMap())).set(info.path, true); + if (declarationInfo && declarationInfo.sourceMapFilePath && info !== declarationInfo) { + const sourceMapInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapInfo) { + (sourceMapInfo.sourceInfos || (sourceMapInfo.sourceInfos = createMap())).set(info.path, true); + } } // Key doesnt matter since its only for text and lines @@ -2616,8 +2666,10 @@ namespace ts.server { // If script info is open or orphan, retain it and its dependencies if (!info.isScriptOpen() && info.isOrphan()) { // Otherwise if there is any source info that is alive, this alive too - if (!info.mapInfo || !info.mapInfo.sourceInfos) return; - if (!forEachKey(info.mapInfo.sourceInfos, path => { + if (!info.sourceMapFilePath) return; + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + if (!sourceMapInfo || !sourceMapInfo.sourceInfos) return; + if (!forEachKey(sourceMapInfo.sourceInfos, path => { const info = this.getScriptInfoForPath(path as Path)!; return info.isScriptOpen() || !info.isOrphan(); })) { @@ -2627,11 +2679,12 @@ namespace ts.server { // Retain this script info toRemoveScriptInfos.delete(info.path); - if (info.mapInfo) { + if (info.sourceMapFilePath) { // And map file info and source infos - toRemoveScriptInfos.delete(info.mapInfo.path); - if (info.mapInfo.sourceInfos) { - info.mapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); + toRemoveScriptInfos.delete(info.sourceMapFilePath); + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + if (sourceMapInfo && sourceMapInfo.sourceInfos) { + sourceMapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); } } }); diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index d2f230178d3..29685112188 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -65,10 +65,11 @@ namespace ts.server { } private resetSourceMapInfo() { - this.info.mapper = undefined; this.info.sourceFileLike = undefined; - this.info.mapInfo = undefined; + this.info.sourceMapFilePath = undefined; + this.info.declarationInfoPath = undefined; this.info.sourceInfos = undefined; + this.info.mapper = undefined; } /** Public for testing */ @@ -305,13 +306,18 @@ namespace ts.server { mTime?: number; /*@internal*/ - mapInfo?: ScriptInfo; + sourceFileLike?: SourceFileLike; + + /*@internal*/ + sourceMapFilePath?: Path | false; + + // Present on sourceMapFile info + /*@internal*/ + declarationInfoPath?: Path; /*@internal*/ sourceInfos?: Map; /*@internal*/ mapper?: DocumentPositionMapper | false; - /*@internal*/ - sourceFileLike: SourceFileLike | undefined; constructor( private readonly host: ServerHost, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2bf91fac4f4..fa6990c07f4 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8595,6 +8595,9 @@ declare namespace ts.server { getHostFormatCodeOptions(): FormatCodeSettings; getHostPreferences(): protocol.UserPreferences; private onSourceFileChanged; + private handleSourceMapProjects; + private delayUpdateSourceInfoProjects; + private delayUpdateProjectsOfScriptInfoPath; private handleDeletedFile; private onConfigChangedForConfiguredProject; /** @@ -8722,6 +8725,7 @@ declare namespace ts.server { private findExternalProjectContainingOpenScriptInfo; openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; private removeOrphanConfiguredProjects; + private removeOrphanScriptInfos; private telemetryOnOpenFile; /** * Close file whose contents is managed by the client From 0113f43632b2d3a0de3f25e308b64abed7cf27e6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 3 Dec 2018 12:31:00 -0800 Subject: [PATCH 123/322] Fix the edits clamping from #28583 after rebasing to master --- src/compiler/scanner.ts | 15 ++++++--------- src/compiler/sourcemap.ts | 4 ++-- src/compiler/types.ts | 2 +- src/server/editorServices.ts | 2 +- src/server/scriptInfo.ts | 12 ++++++++---- src/services/services.ts | 4 ++-- src/services/sourcemaps.ts | 1 - 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index e9ccc23d6eb..42589c4228e 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -337,17 +337,14 @@ namespace ts { return result; } - export function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number { - return sourceFile.getPositionOfLineAndCharacter ? - sourceFile.getPositionOfLineAndCharacter(line, character) : - computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text); - } - + export function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number; /* @internal */ - export function getPositionOfLineAndCharacterWithEdits(sourceFile: SourceFileLike, line: number, character: number): number { + // tslint:disable-next-line:unified-signatures + export function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number, allowEdits?: true): number; + export function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number, allowEdits?: true): number { return sourceFile.getPositionOfLineAndCharacter ? - sourceFile.getPositionOfLineAndCharacter(line, character) : - computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, /*allowEdits*/ true); + sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : + computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); } /* @internal */ diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 190cac3b761..00a78b0a93c 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -616,7 +616,7 @@ namespace ts { function processMapping(mapping: Mapping): MappedPosition { const generatedPosition = generatedFile !== undefined - ? getPositionOfLineAndCharacterWithEdits(generatedFile, mapping.generatedLine, mapping.generatedCharacter) + ? getPositionOfLineAndCharacter(generatedFile, mapping.generatedLine, mapping.generatedCharacter, /*allowEdits*/ true) : -1; let source: string | undefined; let sourcePosition: number | undefined; @@ -624,7 +624,7 @@ namespace ts { const sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); source = map.sources[mapping.sourceIndex]; sourcePosition = sourceFile !== undefined - ? getPositionOfLineAndCharacterWithEdits(sourceFile, mapping.sourceLine, mapping.sourceCharacter) + ? getPositionOfLineAndCharacter(sourceFile, mapping.sourceLine, mapping.sourceCharacter, /*allowEdits*/ true) : -1; } return { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e654f4faab7..772c42e5aa7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2615,7 +2615,7 @@ namespace ts { readonly text: string; lineMap?: ReadonlyArray; /* @internal */ - getPositionOfLineAndCharacter?(line: number, character: number): number; + getPositionOfLineAndCharacter?(line: number, character: number, allowEdits?: true): number; } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5eb009fcb52..4d3cf160707 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2316,7 +2316,7 @@ namespace ts.server { const lineOffset = info.positionToLineOffset(pos); return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; }, - getPositionOfLineAndCharacter: (line, character) => info.lineOffsetToPosition(line + 1, character + 1) + getPositionOfLineAndCharacter: (line, character, allowEdits) => info.lineOffsetToPosition(line + 1, character + 1, allowEdits) }; } return info.sourceFileLike; diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 29685112188..326df8c2219 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -186,9 +186,9 @@ namespace ts.server { * @param line 1 based index * @param offset 1 based index */ - lineOffsetToPosition(line: number, offset: number): number { + lineOffsetToPosition(line: number, offset: number, allowEdits?: true): number { if (!this.useScriptVersionCacheIfValidOrOpen()) { - return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text); + return computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits); } // TODO: assert this offset is actually on the line @@ -586,8 +586,12 @@ namespace ts.server { * @param line 1 based index * @param offset 1 based index */ - lineOffsetToPosition(line: number, offset: number): number { - return this.textStorage.lineOffsetToPosition(line, offset); + lineOffsetToPosition(line: number, offset: number): number; + /*@internal*/ + // tslint:disable-next-line:unified-signatures + lineOffsetToPosition(line: number, offset: number, allowEdits?: true): number; + lineOffsetToPosition(line: number, offset: number, allowEdits?: true): number { + return this.textStorage.lineOffsetToPosition(line, offset, allowEdits); } positionToLineOffset(position: number): protocol.Location { diff --git a/src/services/services.ts b/src/services/services.ts index e8dfb8640e0..15f9709cb38 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -602,8 +602,8 @@ namespace ts { return getLineStarts(this); } - public getPositionOfLineAndCharacter(line: number, character: number): number { - return computePositionOfLineAndCharacter(getLineStarts(this), line, character, this.text); + public getPositionOfLineAndCharacter(line: number, character: number, allowEdits?: true): number { + return computePositionOfLineAndCharacter(getLineStarts(this), line, character, this.text, allowEdits); } public getLineEndOfPosition(pos: number): number { diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index ce692fc2184..12991d49802 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -97,7 +97,6 @@ namespace ts { const fileFromCache = sourceFileLike.get(path); if (fileFromCache !== undefined) return fileFromCache ? fileFromCache : undefined; - // TODO: should ask host instead? if (!host.readFile || host.fileExists && !host.fileExists(path)) { sourceFileLike.set(path, false); return undefined; From d0976509c943048ebb30931081b1b110b9aa0b72 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 3 Dec 2018 14:13:09 -0800 Subject: [PATCH 124/322] Add tests and fix DocumentPositionMapper creation on updates to d.ts, source file, map file etc --- src/server/editorServices.ts | 18 +- src/server/scriptInfo.ts | 4 +- src/services/sourcemaps.ts | 13 +- .../unittests/tsserverProjectSystem.ts | 227 +++++++++++++----- 4 files changed, 196 insertions(+), 66 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 4d3cf160707..a3ce0989b0c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2241,8 +2241,8 @@ namespace ts.server { const mapFileInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); if (mapFileInfo) { mapFileInfo.getSnapshot(); - if (mapFileInfo.mapper !== undefined) { - return mapFileInfo.mapper ? mapFileInfo.mapper : undefined; + if (mapFileInfo.documentPositionMapper !== undefined) { + return mapFileInfo.documentPositionMapper ? mapFileInfo.documentPositionMapper : undefined; } } } @@ -2251,15 +2251,16 @@ namespace ts.server { declarationInfo.sourceMapFilePath = undefined; let sourceMapFileInfo: ScriptInfo | undefined; - let readMapFile: ((fileName: string) => string | undefined) | undefined = fileName => { - const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(fileName, project.currentDirectory, project.directoryStructureHost); + let readMapFile: ReadMapFile | undefined = mapFileName => { + const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(mapFileName, project.currentDirectory, project.directoryStructureHost); if (!mapInfo) return undefined; sourceMapFileInfo = mapInfo; const snap = mapInfo.getSnapshot(); + if (mapInfo.documentPositionMapper !== undefined) return mapInfo.documentPositionMapper; return snap.getText(0, snap.getLength()); }; const projectName = project.projectName; - const mapper = getDocumentPositionMapper( + const documentPositionMapper = getDocumentPositionMapper( { getCanonicalFileName: this.toCanonicalFileName, log: s => this.logger.info(s), getSourceFileLike: f => this.getSourceFileLike(f, projectName, declarationInfo) }, declarationInfo.fileName, declarationInfo.getLineInfo(), @@ -2268,8 +2269,9 @@ namespace ts.server { readMapFile = undefined; // Remove ref to project if (sourceMapFileInfo) { declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; - sourceMapFileInfo.mapper = mapper || false; - if (sourceFileName && mapper) { + sourceMapFileInfo.declarationInfoPath = declarationInfo.path; + sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false; + if (sourceFileName && documentPositionMapper) { // Attach as source const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; (sourceMapFileInfo.sourceInfos || (sourceMapFileInfo.sourceInfos = createMap())).set(sourceInfo.path, true); @@ -2278,7 +2280,7 @@ namespace ts.server { else { declarationInfo.sourceMapFilePath = false; } - return mapper; + return documentPositionMapper; } /*@internal*/ diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 326df8c2219..1cd00cdca45 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -69,7 +69,7 @@ namespace ts.server { this.info.sourceMapFilePath = undefined; this.info.declarationInfoPath = undefined; this.info.sourceInfos = undefined; - this.info.mapper = undefined; + this.info.documentPositionMapper = undefined; } /** Public for testing */ @@ -317,7 +317,7 @@ namespace ts.server { /*@internal*/ sourceInfos?: Map; /*@internal*/ - mapper?: DocumentPositionMapper | false; + documentPositionMapper?: DocumentPositionMapper | false; constructor( private readonly host: ServerHost, diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 12991d49802..42b00b8a8d7 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -127,11 +127,17 @@ namespace ts { } } + /** + * string | undefined to contents of map file to create DocumentPositionMapper from it + * DocumentPositionMapper | false to give back cached DocumentPositionMapper + */ + export type ReadMapFile = (mapFileName: string) => string | undefined | DocumentPositionMapper | false; + export function getDocumentPositionMapper( host: DocumentPositionMapperHost, generatedFileName: string, generatedFileLineInfo: LineInfo, - readMapFile: (fileName: string) => string | undefined) { + readMapFile: ReadMapFile) { let mapFileName = tryGetSourceMappingURL(generatedFileLineInfo); if (mapFileName) { const match = base64UrlRegExp.exec(mapFileName); @@ -152,9 +158,12 @@ namespace ts { for (const location of possibleMapLocations) { const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName)); const mapFileContents = readMapFile(mapFileName); - if (mapFileContents) { + if (isString(mapFileContents)) { return convertDocumentToSourceMapper(host, mapFileContents, mapFileName); } + if (mapFileContents !== undefined) { + return mapFileContents || undefined; + } } return undefined; } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 59a6f6019d1..b36783d519f 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10681,7 +10681,8 @@ declare class TestLib { export function fn2() { } export function fn3() { } export function fn4() { } -export function fn5() { }` +export function fn5() { } +` }; const dependencyConfig: File = { path: `${dependecyLocation}/tsconfig.json`, @@ -10698,7 +10699,8 @@ fn1(); fn2(); fn3(); fn4(); -fn5();` +fn5(); +` }; const mainConfig: File = { path: `${mainLocation}/tsconfig.json`, @@ -10719,66 +10721,183 @@ fn5();` const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; - function verifyInfos(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + function verifyScriptInfos(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { checkScriptInfos(service, openInfos.concat(closedInfos)); checkWatchedFiles(host, closedInfos.concat(otherWatchedFiles).map(f => f.toLowerCase())); } - it("can go to definition correctly", () => { - const host = createHost(files, [mainConfig.path]); - const session = createSession(host); - const service = session.getProjectService(); - openFilesForSession([mainTs], session); - checkNumberOfProjects(service, { configuredProjects: 1 }); - checkProjectActualFiles(service.configuredProjects.get(mainConfig.path)!, [mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`]); - for (let i = 0; i < 5; i++) { - const startSpan = { line: i + 5, offset: 1 }; - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.DefinitionAndBoundSpan, - arguments: { file: mainTs.path, ...startSpan } - }).response as protocol.DefinitionInfoAndBoundSpan; - assert.deepEqual(response, { - definitions: [{ file: dependencyTs.path, start: { line: i + 1, offset: 17 }, end: { line: i + 1, offset: 20 } }], - textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } - }); - } - checkNumberOfProjects(service, { configuredProjects: 1 }); - const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; - verifyInfos(service, host, [mainTs.path], closedInfos, [mainConfig.path]); + function verifyInfosWithRandom(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + verifyScriptInfos(service, host, openInfos.concat(randomFile.path), closedInfos, otherWatchedFiles.concat(randomConfig.path)); + } - openFilesForSession([randomFile], session); - verifyInfos(service, host, [mainTs.path, randomFile.path], closedInfos, [mainConfig.path, randomConfig.path]); + function verifyOnlyRandomInfos(service: server.ProjectService, host: TestServerHost) { + verifyScriptInfos(service, host, [randomFile.path], [libFile.path], [randomConfig.path]); + } + + function verifyGotoDefintinionFromMainTs(fn: number, session: TestSession) { + const startSpan = { line: fn + 4, offset: 1 }; + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.DefinitionAndBoundSpan, + arguments: { file: mainTs.path, ...startSpan } + }).response as protocol.DefinitionInfoAndBoundSpan; + assert.deepEqual(response, { + definitions: [{ file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }], + textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } + }); + } + + function verifyRenameFromDependencyTs(fn: number, session: TestSession) { + const startSpan = { line: fn, offset: 17 }; + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.Rename, + arguments: { file: dependencyTs.path, ...startSpan } + }).response as protocol.RenameResponseBody; + assert.deepEqual(response.locs, [{ + file: dependencyTs.path, + locs: [{ start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }] + }]); + } + + function verifyAllFnAction(action: (fn: number, session: TestSession) => void, session: TestSession) { + for (let fn = 1; fn <= 5; fn++) { + action(fn, session); + } + } + + function verifyDocumentPositionMapperUpdates( + mainScenario: string, + openFile: File, + expectedProjectActualFiles: ReadonlyArray, + action: (fn: number, session: TestSession) => void, + closedInfos: ReadonlyArray, + openFileLastLine: number) { + const configFile = `${getDirectoryPath(openFile.path)}/tsconfig.json`; + const openInfos = [openFile.path]; + const otherWatchedFiles = [configFile]; + function openTsFile() { + const host = createHost(files, [mainConfig.path]); + const session = createSession(host); + const service = session.getProjectService(); + openFilesForSession([openFile, randomFile], session); + return { host, session, service }; + } + + function checkProject(service: server.ProjectService) { + checkNumberOfProjects(service, { configuredProjects: 2 }); + checkProjectActualFiles(service.configuredProjects.get(configFile)!, expectedProjectActualFiles); + } + + function verifyInfos(service: server.ProjectService, host: TestServerHost) { + verifyInfosWithRandom(service, host, openInfos, closedInfos, otherWatchedFiles); + } + + function verifyDocumentPositionMapper(service: server.ProjectService, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { + assert.strictEqual(service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`), dependencyMap); + if (notEqual) { + assert.notStrictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); + } + else { + assert.strictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); + } + } + + function verifyScenarioWithChanges( + change: (host: TestServerHost, session: TestSession) => void, + afterActionDocumentPositionMapperNotEquals?: true + ) { + const { host, session, service } = openTsFile(); + + // Create DocumentPositionMapper + action(1, session); + const dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; + const documentPositionMapper = dependencyMap.documentPositionMapper; + + // change + change(host, session); + host.runQueuedTimeoutCallbacks(); + checkProject(service); + verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + + // action + verifyAllFnAction(action, session); + verifyInfos(service, host); + verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper, afterActionDocumentPositionMapperNotEquals); + } + + it(mainScenario, () => { + const { host, session, service } = openTsFile(); + checkProject(service); + + // Main scenario action + verifyAllFnAction(action, session); + checkProject(service); + verifyInfos(service, host); + const dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; + const documentPositionMapper = dependencyMap.documentPositionMapper; + + // Collecting at this point retains dependency.d.ts and map + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfos(service, host); + verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + + // Closing open file, removes dependencies too + closeFilesForSession([openFile, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(service, host); + }); + + it("when usage file changes, document position mapper doesnt change", () => { + // Edit + verifyScenarioWithChanges((_host, session) => session.executeCommandSeq({ + command: protocol.CommandTypes.Change, + arguments: { file: openFile.path, line: openFileLastLine, offset: 1, endLine: openFileLastLine, endOffset: 1, insertString: "const x = 10;" } + })); + }); + + it("when dependency file changes, document position mapper doesnt change", () => { + // Edit dts to add new fn + verifyScenarioWithChanges(host => host.writeFile( + `${dependecyLocation}/fns.d.ts`, + host.readFile(`${dependecyLocation}/fns.d.ts`)!.replace( + "//# sourceMappingURL=FnS.d.ts.map", + `export declare function fn6(): void; +//# sourceMappingURL=FnS.d.ts.map` + ) + )); + }); + + it("when dependency file's map changes", () => { + // Edit map file to represent added new line + verifyScenarioWithChanges(host => host.writeFile( + `${dependecyLocation}/FnS.d.ts.map`, + `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"}` + ), /*afterActionDocumentPositionMapperNotEquals*/ true); + }); + } + + describe("from project that uses dependency", () => { + const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + verifyDocumentPositionMapperUpdates( + "can go to definition correctly", + /*openFile*/ mainTs, + /*expectedProjectActualFiles*/ [mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`], + /*action*/ verifyGotoDefintinionFromMainTs, + closedInfos, + /*openFileLastLine*/ 10 + ); }); - it("rename locations from depedency", () => { - const host = createHost(files, [mainConfig.path]); - const session = createSession(host); - const service = session.getProjectService(); - openFilesForSession([dependencyTs, randomFile], session); - checkNumberOfProjects(service, { configuredProjects: 2 }); - checkProjectActualFiles(service.configuredProjects.get(dependencyConfig.path)!, [dependencyTs.path, libFile.path, dependencyConfig.path]); - for (let i = 0; i < 5; i++) { - const startSpan = { line: i + 1, offset: 17 }; - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.Rename, - arguments: { file: dependencyTs.path, ...startSpan } - }).response as protocol.RenameResponseBody; - assert.deepEqual(response.locs, [{ - file: dependencyTs.path, - locs: [{ start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }] - }]); - } - checkNumberOfProjects(service, { configuredProjects: 2 }); - const openInfos = [dependencyTs.path, randomFile.path]; + describe("from defining project", () => { const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; - const otherWatchedFiles = [dependencyConfig.path, randomConfig.path]; - verifyInfos(service, host, openInfos, closedInfos, otherWatchedFiles); - - // Collect the orphan projects and infos - closeFilesForSession([randomFile], session); - openFilesForSession([randomFile], session); - - verifyInfos(service, host, openInfos, closedInfos, otherWatchedFiles); + verifyDocumentPositionMapperUpdates( + "rename locations from dependency", + /*openFile*/ dependencyTs, + /*expectedProjectActualFiles*/ [dependencyTs.path, libFile.path, dependencyConfig.path], + /*action*/ verifyRenameFromDependencyTs, + closedInfos, + /*openFileLastLine*/ 6 + ); }); }); }); From d86aeb2f004d4ec7be60f5837dae1a6c1de33c54 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 3 Dec 2018 16:18:11 -0800 Subject: [PATCH 125/322] TODOs --- src/testRunner/unittests/tsserverProjectSystem.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index b36783d519f..1f595d95f99 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10899,6 +10899,9 @@ fn5(); /*openFileLastLine*/ 6 ); }); + + // TODO: test project changes when both projects are open + // TODO: project change when dependency is not built }); }); From 60ae299f0cf1d30fd935a9b2307bf30d8e1be1b5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 4 Dec 2018 12:14:33 -0800 Subject: [PATCH 126/322] Add test to verify when depedency and main project is open --- .../unittests/tsserverProjectSystem.ts | 154 ++++++++++++------ 1 file changed, 106 insertions(+), 48 deletions(-) diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 1f595d95f99..4c611ea735c 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10758,33 +10758,34 @@ fn5(); }]); } - function verifyAllFnAction(action: (fn: number, session: TestSession) => void, session: TestSession) { - for (let fn = 1; fn <= 5; fn++) { - action(fn, session); - } - } - + // Open File, expectedProjectActualFiles, action, openFileLastLine + type DocumentPositionMapperVerifier = [File, ReadonlyArray, (fn: number, session: TestSession) => void, number]; function verifyDocumentPositionMapperUpdates( mainScenario: string, - openFile: File, - expectedProjectActualFiles: ReadonlyArray, - action: (fn: number, session: TestSession) => void, - closedInfos: ReadonlyArray, - openFileLastLine: number) { - const configFile = `${getDirectoryPath(openFile.path)}/tsconfig.json`; - const openInfos = [openFile.path]; - const otherWatchedFiles = [configFile]; + verifier: ReadonlyArray, + closedInfos: ReadonlyArray) { + + const openFiles = verifier.map(v => v[0]); + const expectedProjectActualFiles = verifier.map(v => v[1]); + const actions = verifier.map(v => v[2]); + const openFileLastLines = verifier.map(v => v[3]); + + const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); + const openInfos = openFiles.map(f => f.path); + const otherWatchedFiles = configFiles; function openTsFile() { const host = createHost(files, [mainConfig.path]); const session = createSession(host); const service = session.getProjectService(); - openFilesForSession([openFile, randomFile], session); + openFilesForSession([...openFiles, randomFile], session); return { host, session, service }; } function checkProject(service: server.ProjectService) { - checkNumberOfProjects(service, { configuredProjects: 2 }); - checkProjectActualFiles(service.configuredProjects.get(configFile)!, expectedProjectActualFiles); + checkNumberOfProjects(service, { configuredProjects: 1 + verifier.length }); + configFiles.forEach((configFile, index) => { + checkProjectActualFiles(service.configuredProjects.get(configFile)!, expectedProjectActualFiles[index]); + }); } function verifyInfos(service: server.ProjectService, host: TestServerHost) { @@ -10801,27 +10802,74 @@ fn5(); } } - function verifyScenarioWithChanges( + function verifyAllFnAction( + session: TestSession, + service: server.ProjectService, + host: TestServerHost, + firstDocumentPositionMapperNotEquals?: true, + dependencyMap?: server.ScriptInfo, + documentPositionMapper?: server.ScriptInfo["documentPositionMapper"] + ) { + // action + let isFirst = true; + for (const action of actions) { + for (let fn = 1; fn <= 5; fn++) { + action(fn, session); + verifyInfos(service, host); + if (isFirst) { + isFirst = false; + if (dependencyMap) { + verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); + documentPositionMapper = dependencyMap.documentPositionMapper; + } + else { + dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; + documentPositionMapper = dependencyMap.documentPositionMapper; + } + } + else { + verifyDocumentPositionMapper(service, dependencyMap!, documentPositionMapper); + } + } + } + return { dependencyMap: dependencyMap!, documentPositionMapper }; + } + + function verifyScenarioWithChangesWorker( change: (host: TestServerHost, session: TestSession) => void, - afterActionDocumentPositionMapperNotEquals?: true + afterActionDocumentPositionMapperNotEquals: true | undefined, + timeoutBeforeAction: boolean ) { const { host, session, service } = openTsFile(); // Create DocumentPositionMapper - action(1, session); + actions.forEach(action => action(1, session)); const dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; const documentPositionMapper = dependencyMap.documentPositionMapper; // change change(host, session); - host.runQueuedTimeoutCallbacks(); - checkProject(service); - verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + if (timeoutBeforeAction) { + host.runQueuedTimeoutCallbacks(); + checkProject(service); + verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + } // action - verifyAllFnAction(action, session); - verifyInfos(service, host); - verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper, afterActionDocumentPositionMapperNotEquals); + verifyAllFnAction(session, service, host, afterActionDocumentPositionMapperNotEquals, dependencyMap, documentPositionMapper); + } + + function verifyScenarioWithChanges( + change: (host: TestServerHost, session: TestSession) => void, + afterActionDocumentPositionMapperNotEquals?: true + ) { + it("when timeout occurs before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ true); + }); + + it("when timeout does not occur before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ false); + }); } it(mainScenario, () => { @@ -10829,11 +10877,9 @@ fn5(); checkProject(service); // Main scenario action - verifyAllFnAction(action, session); + const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, service, host); checkProject(service); verifyInfos(service, host); - const dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; - const documentPositionMapper = dependencyMap.documentPositionMapper; // Collecting at this point retains dependency.d.ts and map closeFilesForSession([randomFile], session); @@ -10842,20 +10888,20 @@ fn5(); verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); // Closing open file, removes dependencies too - closeFilesForSession([openFile, randomFile], session); + closeFilesForSession([...openFiles, randomFile], session); openFilesForSession([randomFile], session); verifyOnlyRandomInfos(service, host); }); - it("when usage file changes, document position mapper doesnt change", () => { + describe("when usage file changes, document position mapper doesnt change", () => { // Edit - verifyScenarioWithChanges((_host, session) => session.executeCommandSeq({ + verifyScenarioWithChanges((_host, session) => openFiles.forEach((openFile, index) => session.executeCommandSeq({ command: protocol.CommandTypes.Change, - arguments: { file: openFile.path, line: openFileLastLine, offset: 1, endLine: openFileLastLine, endOffset: 1, insertString: "const x = 10;" } - })); + arguments: { file: openFile.path, line: openFileLastLines[index], offset: 1, endLine: openFileLastLines[index], endOffset: 1, insertString: "const x = 10;" } + }))); }); - it("when dependency file changes, document position mapper doesnt change", () => { + describe("when dependency file changes, document position mapper doesnt change", () => { // Edit dts to add new fn verifyScenarioWithChanges(host => host.writeFile( `${dependecyLocation}/fns.d.ts`, @@ -10867,7 +10913,7 @@ fn5(); )); }); - it("when dependency file's map changes", () => { + describe("when dependency file's map changes", () => { // Edit map file to represent added new line verifyScenarioWithChanges(host => host.writeFile( `${dependecyLocation}/FnS.d.ts.map`, @@ -10876,32 +10922,44 @@ fn5(); }); } + const usageVerifier: DocumentPositionMapperVerifier = [ + /*openFile*/ mainTs, + /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`], + /*action*/ verifyGotoDefintinionFromMainTs, + /*openFileLastLine*/ 10 + ]; describe("from project that uses dependency", () => { const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; verifyDocumentPositionMapperUpdates( "can go to definition correctly", - /*openFile*/ mainTs, - /*expectedProjectActualFiles*/ [mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`], - /*action*/ verifyGotoDefintinionFromMainTs, - closedInfos, - /*openFileLastLine*/ 10 + [usageVerifier], + closedInfos ); }); + const definingVerifier: DocumentPositionMapperVerifier = [ + /*openFile*/ dependencyTs, + /*expectedProjectActualFiles*/[dependencyTs.path, libFile.path, dependencyConfig.path], + /*action*/ verifyRenameFromDependencyTs, + /*openFileLastLine*/ 6 + ]; describe("from defining project", () => { const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; verifyDocumentPositionMapperUpdates( "rename locations from dependency", - /*openFile*/ dependencyTs, - /*expectedProjectActualFiles*/ [dependencyTs.path, libFile.path, dependencyConfig.path], - /*action*/ verifyRenameFromDependencyTs, - closedInfos, - /*openFileLastLine*/ 6 + [definingVerifier], + closedInfos ); }); - // TODO: test project changes when both projects are open - // TODO: project change when dependency is not built + describe("when opening depedency and usage project", () => { + const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + verifyDocumentPositionMapperUpdates( + "goto Definition in usage and rename locations from defining project", + [definingVerifier], + closedInfos + ); + }); }); }); From 34a12839ba62511ddd33f29e9bd2078708deddde Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 4 Dec 2018 14:42:48 -0800 Subject: [PATCH 127/322] Test that when map file is created the changes are reflected. --- .../unittests/tsserverProjectSystem.ts | 206 ++++++++++++------ 1 file changed, 135 insertions(+), 71 deletions(-) diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 4c611ea735c..8f7328e6fc4 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10718,48 +10718,72 @@ fn5(); path: `${projectLocation}/random/tsconfig.json`, content: "{}" }; + const dtsMapLocation = `${dependecyLocation}/FnS.d.ts.map`; + const dtsMapPath = dtsMapLocation.toLowerCase() as Path; const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; - function verifyScriptInfos(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { - checkScriptInfos(service, openInfos.concat(closedInfos)); + function verifyScriptInfos(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + checkScriptInfos(session.getProjectService(), openInfos.concat(closedInfos)); checkWatchedFiles(host, closedInfos.concat(otherWatchedFiles).map(f => f.toLowerCase())); } - function verifyInfosWithRandom(service: server.ProjectService, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { - verifyScriptInfos(service, host, openInfos.concat(randomFile.path), closedInfos, otherWatchedFiles.concat(randomConfig.path)); + function verifyInfosWithRandom(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + verifyScriptInfos(session, host, openInfos.concat(randomFile.path), closedInfos, otherWatchedFiles.concat(randomConfig.path)); } - function verifyOnlyRandomInfos(service: server.ProjectService, host: TestServerHost) { - verifyScriptInfos(service, host, [randomFile.path], [libFile.path], [randomConfig.path]); + function verifyOnlyRandomInfos(session: TestSession, host: TestServerHost) { + verifyScriptInfos(session, host, [randomFile.path], [libFile.path], [randomConfig.path]); } - function verifyGotoDefintinionFromMainTs(fn: number, session: TestSession) { + // Returns request and expected Response + type SessionAction = [Partial, Response]; + function gotoDefintinionFromMainTs(fn: number): SessionAction { const startSpan = { line: fn + 4, offset: 1 }; - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.DefinitionAndBoundSpan, - arguments: { file: mainTs.path, ...startSpan } - }).response as protocol.DefinitionInfoAndBoundSpan; - assert.deepEqual(response, { - definitions: [{ file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }], - textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } - }); + return [ + { + command: protocol.CommandTypes.DefinitionAndBoundSpan, + arguments: { file: mainTs.path, ...startSpan } + }, + { + definitions: [{ file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }], + textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } + } + ]; } - function verifyRenameFromDependencyTs(fn: number, session: TestSession) { + function renameFromDependencyTs(fn: number): SessionAction { const startSpan = { line: fn, offset: 17 }; - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.Rename, - arguments: { file: dependencyTs.path, ...startSpan } - }).response as protocol.RenameResponseBody; - assert.deepEqual(response.locs, [{ - file: dependencyTs.path, - locs: [{ start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }] - }]); + const triggerSpan = { + start: startSpan, + end: { line: startSpan.line, offset: startSpan.offset + 3 } + }; + return [ + { + command: protocol.CommandTypes.Rename, + arguments: { file: dependencyTs.path, ...startSpan } + }, + { + info: { + canRename: true, + fileToRename: undefined, + displayName: `fn${fn}`, + fullDisplayName: `"${dependecyLocation}/FnS".fn${fn}`, + kind: ScriptElementKind.functionElement, + kindModifiers: "export", + triggerSpan + }, + locs: [ + { file: dependencyTs.path, locs: [triggerSpan] } + ] + } + ]; } - // Open File, expectedProjectActualFiles, action, openFileLastLine - type DocumentPositionMapperVerifier = [File, ReadonlyArray, (fn: number, session: TestSession) => void, number]; + // Returns request and expected Response + type SessionActionGetter = (fn: number) => SessionAction; + // Open File, expectedProjectActualFiles, actionGetter, openFileLastLine + type DocumentPositionMapperVerifier = [File, ReadonlyArray, SessionActionGetter, number]; function verifyDocumentPositionMapperUpdates( mainScenario: string, verifier: ReadonlyArray, @@ -10767,7 +10791,7 @@ fn5(); const openFiles = verifier.map(v => v[0]); const expectedProjectActualFiles = verifier.map(v => v[1]); - const actions = verifier.map(v => v[2]); + const actionGetters = verifier.map(v => v[2]); const openFileLastLines = verifier.map(v => v[3]); const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); @@ -10776,24 +10800,24 @@ fn5(); function openTsFile() { const host = createHost(files, [mainConfig.path]); const session = createSession(host); - const service = session.getProjectService(); openFilesForSession([...openFiles, randomFile], session); - return { host, session, service }; + return { host, session }; } - function checkProject(service: server.ProjectService) { + function checkProject(session: TestSession) { + const service = session.getProjectService(); checkNumberOfProjects(service, { configuredProjects: 1 + verifier.length }); configFiles.forEach((configFile, index) => { checkProjectActualFiles(service.configuredProjects.get(configFile)!, expectedProjectActualFiles[index]); }); } - function verifyInfos(service: server.ProjectService, host: TestServerHost) { - verifyInfosWithRandom(service, host, openInfos, closedInfos, otherWatchedFiles); + function verifyInfos(session: TestSession, host: TestServerHost, minusDtsMap?: true) { + verifyInfosWithRandom(session, host, openInfos, minusDtsMap ? closedInfos.filter(f => f.toLowerCase() !== dtsMapPath) : closedInfos, otherWatchedFiles); } - function verifyDocumentPositionMapper(service: server.ProjectService, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { - assert.strictEqual(service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`), dependencyMap); + function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { + assert.strictEqual(session.getProjectService().filenameToScriptInfo.get(dtsMapPath), dependencyMap); if (notEqual) { assert.notStrictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); } @@ -10802,9 +10826,26 @@ fn5(); } } + function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { + const [req, expectedResponse] = actionGetter(fn); + const { response } = session.executeCommandSeq(req); + return { response, expectedResponse }; + } + + function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo) => void) { + // action + for (const actionGetter of actionGetters) { + for (let fn = 1; fn <= 5; fn++) { + const result = action(actionGetter, fn, session); + const dtsInfo = session.getProjectService().filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts`); + assert.isDefined(dtsInfo); + verifyAction(result, dtsInfo!); + } + } + } + function verifyAllFnAction( session: TestSession, - service: server.ProjectService, host: TestServerHost, firstDocumentPositionMapperNotEquals?: true, dependencyMap?: server.ScriptInfo, @@ -10812,51 +10853,63 @@ fn5(); ) { // action let isFirst = true; - for (const action of actions) { - for (let fn = 1; fn <= 5; fn++) { - action(fn, session); - verifyInfos(service, host); - if (isFirst) { - isFirst = false; - if (dependencyMap) { - verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); - documentPositionMapper = dependencyMap.documentPositionMapper; - } - else { - dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; - documentPositionMapper = dependencyMap.documentPositionMapper; - } + verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo) => { + assert.deepEqual(response, expectedResponse); + verifyInfos(session, host); + assert.equal(dtsInfo.sourceMapFilePath, dtsMapPath); + if (isFirst) { + isFirst = false; + if (dependencyMap) { + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); + documentPositionMapper = dependencyMap.documentPositionMapper; } else { - verifyDocumentPositionMapper(service, dependencyMap!, documentPositionMapper); + dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; + documentPositionMapper = dependencyMap.documentPositionMapper; } } - } + else { + verifyDocumentPositionMapper(session, dependencyMap!, documentPositionMapper); + } + }); return { dependencyMap: dependencyMap!, documentPositionMapper }; } + function verifyAllFnActionWithNoMap( + session: TestSession, + host: TestServerHost + ) { + // action + verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo) => { + assert.deepEqual(response, expectedResponse); + verifyInfos(session, host); + assert.isFalse(dtsInfo.sourceMapFilePath); + assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); + }); + } + function verifyScenarioWithChangesWorker( change: (host: TestServerHost, session: TestSession) => void, afterActionDocumentPositionMapperNotEquals: true | undefined, timeoutBeforeAction: boolean ) { - const { host, session, service } = openTsFile(); + const { host, session } = openTsFile(); // Create DocumentPositionMapper - actions.forEach(action => action(1, session)); - const dependencyMap = service.filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts.map`)!; + actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); + const dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; const documentPositionMapper = dependencyMap.documentPositionMapper; // change change(host, session); if (timeoutBeforeAction) { host.runQueuedTimeoutCallbacks(); - checkProject(service); - verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + checkProject(session); + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); } // action - verifyAllFnAction(session, service, host, afterActionDocumentPositionMapperNotEquals, dependencyMap, documentPositionMapper); + verifyAllFnAction(session, host, afterActionDocumentPositionMapperNotEquals, dependencyMap, documentPositionMapper); } function verifyScenarioWithChanges( @@ -10873,24 +10926,24 @@ fn5(); } it(mainScenario, () => { - const { host, session, service } = openTsFile(); - checkProject(service); + const { host, session } = openTsFile(); + checkProject(session); // Main scenario action - const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, service, host); - checkProject(service); - verifyInfos(service, host); + const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, host); + checkProject(session); + verifyInfos(session, host); // Collecting at this point retains dependency.d.ts and map closeFilesForSession([randomFile], session); openFilesForSession([randomFile], session); - verifyInfos(service, host); - verifyDocumentPositionMapper(service, dependencyMap, documentPositionMapper); + verifyInfos(session, host); + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); // Closing open file, removes dependencies too closeFilesForSession([...openFiles, randomFile], session); openFilesForSession([randomFile], session); - verifyOnlyRandomInfos(service, host); + verifyOnlyRandomInfos(session, host); }); describe("when usage file changes, document position mapper doesnt change", () => { @@ -10916,20 +10969,31 @@ fn5(); describe("when dependency file's map changes", () => { // Edit map file to represent added new line verifyScenarioWithChanges(host => host.writeFile( - `${dependecyLocation}/FnS.d.ts.map`, + dtsMapLocation, `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"}` ), /*afterActionDocumentPositionMapperNotEquals*/ true); }); + + it("when map file is not present", () => { + const host = createHost(files, [mainConfig.path]); + host.deleteFile(dtsMapLocation); + + const session = createSession(host); + openFilesForSession([...openFiles, randomFile], session); + checkProject(session); + + verifyAllFnActionWithNoMap(session, host); + }); } const usageVerifier: DocumentPositionMapperVerifier = [ /*openFile*/ mainTs, /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`], - /*action*/ verifyGotoDefintinionFromMainTs, + /*actionGetter*/ gotoDefintinionFromMainTs, /*openFileLastLine*/ 10 ]; describe("from project that uses dependency", () => { - const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "can go to definition correctly", [usageVerifier], @@ -10940,11 +11004,11 @@ fn5(); const definingVerifier: DocumentPositionMapperVerifier = [ /*openFile*/ dependencyTs, /*expectedProjectActualFiles*/[dependencyTs.path, libFile.path, dependencyConfig.path], - /*action*/ verifyRenameFromDependencyTs, + /*actionGetter*/ renameFromDependencyTs, /*openFileLastLine*/ 6 ]; describe("from defining project", () => { - const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "rename locations from dependency", [definingVerifier], @@ -10953,7 +11017,7 @@ fn5(); }); describe("when opening depedency and usage project", () => { - const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, `${dependecyLocation}/FnS.d.ts.map`]; + const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "goto Definition in usage and rename locations from defining project", [definingVerifier], From 8f3d2d9f76ed1ebc7cea9ab0e4dd6905ef53c703 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 4 Dec 2018 15:42:10 -0800 Subject: [PATCH 128/322] Goto defintion will not go to source if map is present --- .../unittests/tsserverProjectSystem.ts | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 8f7328e6fc4..077f0128adc 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10718,7 +10718,9 @@ fn5(); path: `${projectLocation}/random/tsconfig.json`, content: "{}" }; - const dtsMapLocation = `${dependecyLocation}/FnS.d.ts.map`; + const dtsLocation = `${dependecyLocation}/FnS.d.ts`; + const dtsPath = dtsLocation.toLowerCase() as Path; + const dtsMapLocation = `${dtsLocation}.map`; const dtsMapPath = dtsMapLocation.toLowerCase() as Path; const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; @@ -10736,18 +10738,25 @@ fn5(); verifyScriptInfos(session, host, [randomFile.path], [libFile.path], [randomConfig.path]); } - // Returns request and expected Response - type SessionAction = [Partial, Response]; + // Returns request and expected Response, expected response when no map file + type SessionAction = [Partial, Response, Response?]; function gotoDefintinionFromMainTs(fn: number): SessionAction { const startSpan = { line: fn + 4, offset: 1 }; + const textSpan: protocol.TextSpan = { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }; + const definitionSpan: protocol.FileSpan = { file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; + const declareSpaceLength = "declare ".length; return [ { command: protocol.CommandTypes.DefinitionAndBoundSpan, arguments: { file: mainTs.path, ...startSpan } }, { - definitions: [{ file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }], - textSpan: { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } } + definitions: [definitionSpan], + textSpan + }, + { + definitions: [{ file: dtsPath, start: { line: fn, offset: definitionSpan.start.offset + declareSpaceLength }, end: { line: fn, offset: definitionSpan.end.offset + declareSpaceLength } }], + textSpan } ]; } @@ -10812,8 +10821,8 @@ fn5(); }); } - function verifyInfos(session: TestSession, host: TestServerHost, minusDtsMap?: true) { - verifyInfosWithRandom(session, host, openInfos, minusDtsMap ? closedInfos.filter(f => f.toLowerCase() !== dtsMapPath) : closedInfos, otherWatchedFiles); + function verifyInfos(session: TestSession, host: TestServerHost, minusDtsMapAndSource?: true) { + verifyInfosWithRandom(session, host, openInfos, minusDtsMapAndSource ? closedInfos.filter(f => f !== dependencyTs.path && f.toLowerCase() !== dtsMapPath) : closedInfos, otherWatchedFiles); } function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { @@ -10827,9 +10836,9 @@ fn5(); } function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { - const [req, expectedResponse] = actionGetter(fn); + const [req, expectedResponse, expectedNoMapResponse] = actionGetter(fn); const { response } = session.executeCommandSeq(req); - return { response, expectedResponse }; + return { response, expectedResponse, expectedNoMapResponse }; } function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo) => void) { @@ -10837,7 +10846,7 @@ fn5(); for (const actionGetter of actionGetters) { for (let fn = 1; fn <= 5; fn++) { const result = action(actionGetter, fn, session); - const dtsInfo = session.getProjectService().filenameToScriptInfo.get(`${dependecyLocation}/fns.d.ts`); + const dtsInfo = session.getProjectService().filenameToScriptInfo.get(dtsPath); assert.isDefined(dtsInfo); verifyAction(result, dtsInfo!); } @@ -10880,9 +10889,9 @@ fn5(); host: TestServerHost ) { // action - verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo) => { - assert.deepEqual(response, expectedResponse); - verifyInfos(session, host); + verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoMapResponse }, dtsInfo) => { + assert.deepEqual(response, expectedNoMapResponse && verifier.length ? expectedNoMapResponse : expectedResponse); + verifyInfos(session, host, /*minusDtsMapAndSource*/ true); assert.isFalse(dtsInfo.sourceMapFilePath); assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); }); @@ -10957,8 +10966,8 @@ fn5(); describe("when dependency file changes, document position mapper doesnt change", () => { // Edit dts to add new fn verifyScenarioWithChanges(host => host.writeFile( - `${dependecyLocation}/fns.d.ts`, - host.readFile(`${dependecyLocation}/fns.d.ts`)!.replace( + dtsLocation, + host.readFile(dtsLocation)!.replace( "//# sourceMappingURL=FnS.d.ts.map", `export declare function fn6(): void; //# sourceMappingURL=FnS.d.ts.map` @@ -10988,12 +10997,12 @@ fn5(); const usageVerifier: DocumentPositionMapperVerifier = [ /*openFile*/ mainTs, - /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, `${dependecyLocation}/fns.d.ts`], + /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, dtsPath], /*actionGetter*/ gotoDefintinionFromMainTs, /*openFileLastLine*/ 10 ]; describe("from project that uses dependency", () => { - const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, `${dependecyLocation}/fns.d.ts`, dtsMapLocation]; + const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, dtsPath, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "can go to definition correctly", [usageVerifier], @@ -11008,7 +11017,7 @@ fn5(); /*openFileLastLine*/ 6 ]; describe("from defining project", () => { - const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, dtsMapLocation]; + const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "rename locations from dependency", [definingVerifier], @@ -11017,7 +11026,7 @@ fn5(); }); describe("when opening depedency and usage project", () => { - const closedInfos = [libFile.path, `${dependecyLocation}/FnS.d.ts`, dtsMapLocation]; + const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; verifyDocumentPositionMapperUpdates( "goto Definition in usage and rename locations from defining project", [definingVerifier], From 3dc0d5a77c950e4757c17fd4a17959bb5f36b495 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 5 Dec 2018 12:18:14 -0800 Subject: [PATCH 129/322] Watch missing map file and update the source mapping accordingly --- src/server/editorServices.ts | 150 +++++++++++++----- src/server/scriptInfo.ts | 18 ++- src/services/sourcemaps.ts | 5 +- .../unittests/tsserverProjectSystem.ts | 117 +++++++++++--- 4 files changed, 224 insertions(+), 66 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index a3ce0989b0c..b970a8fc716 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -342,6 +342,7 @@ namespace ts.server { FailedLookupLocation = "Directory of Failed lookup locations in module resolution", TypeRoots = "Type root directory", NodeModulesForClosedScriptInfo = "node_modules for closed script infos in them", + MissingSourceMapFile = "Missing source map file" } const enum ConfigFileWatcherStatus { @@ -953,22 +954,25 @@ namespace ts.server { private handleSourceMapProjects(info: ScriptInfo) { // Change in d.ts, update source projects as well if (info.sourceMapFilePath) { - const sourceMapFileInfo = this.getScriptInfoForPath(info.sourceMapFilePath); - if (sourceMapFileInfo && sourceMapFileInfo.sourceInfos) { - this.delayUpdateSourceInfoProjects(sourceMapFileInfo.sourceInfos); + if (isString(info.sourceMapFilePath)) { + const sourceMapFileInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + this.delayUpdateSourceInfoProjects(sourceMapFileInfo && sourceMapFileInfo.sourceInfos); + } + else { + this.delayUpdateSourceInfoProjects(info.sourceMapFilePath.sourceInfos); } } // Change in mapInfo, update declarationProjects and source projects - if (info.sourceInfos) { - this.delayUpdateSourceInfoProjects(info.sourceInfos); - } + this.delayUpdateSourceInfoProjects(info.sourceInfos); if (info.declarationInfoPath) { this.delayUpdateProjectsOfScriptInfoPath(info.declarationInfoPath); } } - private delayUpdateSourceInfoProjects(sourceInfos: Map) { - sourceInfos.forEach((_value, path) => this.delayUpdateProjectsOfScriptInfoPath(path as Path)); + private delayUpdateSourceInfoProjects(sourceInfos: Map | undefined) { + if (sourceInfos) { + sourceInfos.forEach((_value, path) => this.delayUpdateProjectsOfScriptInfoPath(path as Path)); + } } private delayUpdateProjectsOfScriptInfoPath(path: Path) { @@ -992,6 +996,14 @@ namespace ts.server { // update projects to make sure that set of referenced files is correct this.delayUpdateProjectGraphs(containingProjects); this.handleSourceMapProjects(info); + info.closeSourceMapFileWatcher(); + // need to recalculate source map from declaration file + if (info.declarationInfoPath) { + const declarationInfo = this.getScriptInfoForPath(info.declarationInfoPath); + if (declarationInfo) { + declarationInfo.sourceMapFilePath = undefined; + } + } } } @@ -2228,32 +2240,43 @@ namespace ts.server { /*@internal*/ getDocumentPositionMapper(project: Project, generatedFileName: string, sourceFileName?: string): DocumentPositionMapper | undefined { - const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, project.directoryStructureHost); + // Since declaration info and map file watches arent updating project's directory structure host (which can cache file structure) use host + const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, this.host); if (!declarationInfo) return undefined; // Try to get from cache declarationInfo.getSnapshot(); // Ensure synchronized - if (declarationInfo.sourceMapFilePath !== undefined) { - // Doesnt have sourceMap - if (!declarationInfo.sourceMapFilePath) return undefined; - + if (isString(declarationInfo.sourceMapFilePath)) { // Ensure mapper is synchronized - const mapFileInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); - if (mapFileInfo) { - mapFileInfo.getSnapshot(); - if (mapFileInfo.documentPositionMapper !== undefined) { - return mapFileInfo.documentPositionMapper ? mapFileInfo.documentPositionMapper : undefined; + const sourceMapFileInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapFileInfo) { + sourceMapFileInfo.getSnapshot(); + if (sourceMapFileInfo.documentPositionMapper !== undefined) { + sourceMapFileInfo.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo.sourceInfos); + return sourceMapFileInfo.documentPositionMapper ? sourceMapFileInfo.documentPositionMapper : undefined; } } + declarationInfo.sourceMapFilePath = undefined; + } + else if (declarationInfo.sourceMapFilePath) { + declarationInfo.sourceMapFilePath.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, declarationInfo.sourceMapFilePath.sourceInfos); + return undefined; + } + else if (declarationInfo.sourceMapFilePath !== undefined) { + // Doesnt have sourceMap + return undefined; } // Create the mapper - declarationInfo.sourceMapFilePath = undefined; let sourceMapFileInfo: ScriptInfo | undefined; + let mapFileNameFromDeclarationInfo: string | undefined; - let readMapFile: ReadMapFile | undefined = mapFileName => { - const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(mapFileName, project.currentDirectory, project.directoryStructureHost); - if (!mapInfo) return undefined; + let readMapFile: ReadMapFile | undefined = (mapFileName, mapFileNameFromDts) => { + const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(mapFileName, project.currentDirectory, this.host); + if (!mapInfo) { + mapFileNameFromDeclarationInfo = mapFileNameFromDts; + return undefined; + } sourceMapFileInfo = mapInfo; const snap = mapInfo.getSnapshot(); if (mapInfo.documentPositionMapper !== undefined) return mapInfo.documentPositionMapper; @@ -2271,11 +2294,19 @@ namespace ts.server { declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; sourceMapFileInfo.declarationInfoPath = declarationInfo.path; sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false; - if (sourceFileName && documentPositionMapper) { - // Attach as source - const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; - (sourceMapFileInfo.sourceInfos || (sourceMapFileInfo.sourceInfos = createMap())).set(sourceInfo.path, true); - } + sourceMapFileInfo.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo.sourceInfos); + } + else if (mapFileNameFromDeclarationInfo) { + declarationInfo.sourceMapFilePath = { + declarationInfoPath: declarationInfo.path, + watcher: this.addMissingSourceMapFile( + project.currentDirectory === this.currentDirectory ? + mapFileNameFromDeclarationInfo : + getNormalizedAbsolutePath(mapFileNameFromDeclarationInfo, project.currentDirectory), + declarationInfo.path + ), + sourceInfos: this.addSourceInfoToSourceMap(sourceFileName, project) + }; } else { declarationInfo.sourceMapFilePath = false; @@ -2283,6 +2314,34 @@ namespace ts.server { return documentPositionMapper; } + private addSourceInfoToSourceMap(sourceFileName: string | undefined, project: Project, sourceInfos?: Map) { + if (sourceFileName) { + // Attach as source + const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost)!; + (sourceInfos || (sourceInfos = createMap())).set(sourceInfo.path, true); + } + return sourceInfos; + } + + private addMissingSourceMapFile(mapFileName: string, declarationInfoPath: Path) { + const fileWatcher = this.watchFactory.watchFile( + this.host, + mapFileName, + () => { + const declarationInfo = this.getScriptInfoForPath(declarationInfoPath); + if (declarationInfo && declarationInfo.sourceMapFilePath && !isString(declarationInfo.sourceMapFilePath)) { + // Update declaration and source projects + this.delayUpdateProjectGraphs(declarationInfo.containingProjects); + this.delayUpdateSourceInfoProjects(declarationInfo.sourceMapFilePath.sourceInfos); + declarationInfo.closeSourceMapFileWatcher(); + } + }, + PollingInterval.High, + WatchType.MissingSourceMapFile, + ); + return fileWatcher; + } + /*@internal*/ getSourceFileLike(fileName: string, projectNameOrProject: string | Project, declarationInfo?: ScriptInfo) { const project = (projectNameOrProject as Project).projectName ? projectNameOrProject as Project : this.findProject(projectNameOrProject as string); @@ -2297,7 +2356,7 @@ namespace ts.server { if (!info) return undefined; // Attach as source - if (declarationInfo && declarationInfo.sourceMapFilePath && info !== declarationInfo) { + if (declarationInfo && isString(declarationInfo.sourceMapFilePath) && info !== declarationInfo) { const sourceMapInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); if (sourceMapInfo) { (sourceMapInfo.sourceInfos || (sourceMapInfo.sourceInfos = createMap())).set(info.path, true); @@ -2669,11 +2728,18 @@ namespace ts.server { if (!info.isScriptOpen() && info.isOrphan()) { // Otherwise if there is any source info that is alive, this alive too if (!info.sourceMapFilePath) return; - const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); - if (!sourceMapInfo || !sourceMapInfo.sourceInfos) return; - if (!forEachKey(sourceMapInfo.sourceInfos, path => { - const info = this.getScriptInfoForPath(path as Path)!; - return info.isScriptOpen() || !info.isOrphan(); + let sourceInfos: Map | undefined; + if (isString(info.sourceMapFilePath)) { + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } + else { + sourceInfos = info.sourceMapFilePath.sourceInfos; + } + if (!sourceInfos) return; + if (!forEachKey(sourceInfos, path => { + const info = this.getScriptInfoForPath(path as Path); + return !!info && (info.isScriptOpen() || !info.isOrphan()); })) { return; } @@ -2682,11 +2748,18 @@ namespace ts.server { // Retain this script info toRemoveScriptInfos.delete(info.path); if (info.sourceMapFilePath) { - // And map file info and source infos - toRemoveScriptInfos.delete(info.sourceMapFilePath); - const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); - if (sourceMapInfo && sourceMapInfo.sourceInfos) { - sourceMapInfo.sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); + let sourceInfos: Map | undefined; + if (isString(info.sourceMapFilePath)) { + // And map file info and source infos + toRemoveScriptInfos.delete(info.sourceMapFilePath); + const sourceMapInfo = this.getScriptInfoForPath(info.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } + else { + sourceInfos = info.sourceMapFilePath.sourceInfos; + } + if (sourceInfos) { + sourceInfos.forEach((_value, path) => toRemoveScriptInfos.delete(path)); } } }); @@ -2695,6 +2768,7 @@ namespace ts.server { // if there are not projects that include this script info - delete it this.stopWatchingScriptInfo(info); this.deleteScriptInfo(info); + info.closeSourceMapFileWatcher(); }); } diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 1cd00cdca45..21c011d7261 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -66,6 +66,7 @@ namespace ts.server { private resetSourceMapInfo() { this.info.sourceFileLike = undefined; + this.info.closeSourceMapFileWatcher(); this.info.sourceMapFilePath = undefined; this.info.declarationInfoPath = undefined; this.info.sourceInfos = undefined; @@ -280,6 +281,13 @@ namespace ts.server { sourceFile: SourceFile; } + /*@internal*/ + export interface SourceMapFileWatcher { + declarationInfoPath: Path; + watcher: FileWatcher; + sourceInfos?: Map; + } + export class ScriptInfo { /** * All projects that include this file @@ -309,7 +317,7 @@ namespace ts.server { sourceFileLike?: SourceFileLike; /*@internal*/ - sourceMapFilePath?: Path | false; + sourceMapFilePath?: Path | SourceMapFileWatcher | false; // Present on sourceMapFile info /*@internal*/ @@ -606,5 +614,13 @@ namespace ts.server { getLineInfo(): LineInfo { return this.textStorage.getLineInfo(); } + + /*@internal*/ + closeSourceMapFileWatcher() { + if (this.sourceMapFilePath && !isString(this.sourceMapFilePath)) { + closeFileWatcherOf(this.sourceMapFilePath); + this.sourceMapFilePath = undefined; + } + } } } diff --git a/src/services/sourcemaps.ts b/src/services/sourcemaps.ts index 42b00b8a8d7..d07c21a9f43 100644 --- a/src/services/sourcemaps.ts +++ b/src/services/sourcemaps.ts @@ -131,7 +131,7 @@ namespace ts { * string | undefined to contents of map file to create DocumentPositionMapper from it * DocumentPositionMapper | false to give back cached DocumentPositionMapper */ - export type ReadMapFile = (mapFileName: string) => string | undefined | DocumentPositionMapper | false; + export type ReadMapFile = (mapFileName: string, mapFileNameFromDts: string | undefined) => string | undefined | DocumentPositionMapper | false; export function getDocumentPositionMapper( host: DocumentPositionMapperHost, @@ -155,9 +155,10 @@ namespace ts { possibleMapLocations.push(mapFileName); } possibleMapLocations.push(generatedFileName + ".map"); + const originalMapFileName = mapFileName && getNormalizedAbsolutePath(mapFileName, getDirectoryPath(generatedFileName)); for (const location of possibleMapLocations) { const mapFileName = getNormalizedAbsolutePath(location, getDirectoryPath(generatedFileName)); - const mapFileContents = readMapFile(mapFileName); + const mapFileContents = readMapFile(mapFileName, originalMapFileName); if (isString(mapFileContents)) { return convertDocumentToSourceMapper(host, mapFileContents, mapFileName); } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 077f0128adc..b5909d3b3d5 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10806,8 +10806,11 @@ fn5(); const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); const openInfos = openFiles.map(f => f.path); const otherWatchedFiles = configFiles; - function openTsFile() { + function openTsFile(onHostCreate?: (host: TestServerHost) => void) { const host = createHost(files, [mainConfig.path]); + if (onHostCreate) { + onHostCreate(host); + } const session = createSession(host); openFilesForSession([...openFiles, randomFile], session); return { host, session }; @@ -10821,8 +10824,19 @@ fn5(); }); } - function verifyInfos(session: TestSession, host: TestServerHost, minusDtsMapAndSource?: true) { - verifyInfosWithRandom(session, host, openInfos, minusDtsMapAndSource ? closedInfos.filter(f => f !== dependencyTs.path && f.toLowerCase() !== dtsMapPath) : closedInfos, otherWatchedFiles); + function verifyInfos(session: TestSession, host: TestServerHost) { + verifyInfosWithRandom(session, host, openInfos, closedInfos, otherWatchedFiles); + } + + function verifyInfosWhenNoMapFile(session: TestSession, host: TestServerHost, dependencyTsOK?: true) { + const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); + verifyInfosWithRandom( + session, + host, + openInfos, + closedInfos.filter(f => f !== dtsMapClosedInfo && (dependencyTsOK || f !== dependencyTs.path)), + dtsMapClosedInfo ? otherWatchedFiles.concat(dtsMapClosedInfo) : otherWatchedFiles + ); } function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { @@ -10841,14 +10855,20 @@ fn5(); return { response, expectedResponse, expectedNoMapResponse }; } - function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo) => void) { + function firstAction(session: TestSession) { + actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); + } + + function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo, isFirst: boolean) => void) { // action + let isFirst = true; for (const actionGetter of actionGetters) { for (let fn = 1; fn <= 5; fn++) { const result = action(actionGetter, fn, session); const dtsInfo = session.getProjectService().filenameToScriptInfo.get(dtsPath); assert.isDefined(dtsInfo); - verifyAction(result, dtsInfo!); + verifyAction(result, dtsInfo!, isFirst); + isFirst = false; } } } @@ -10861,13 +10881,11 @@ fn5(); documentPositionMapper?: server.ScriptInfo["documentPositionMapper"] ) { // action - let isFirst = true; - verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo) => { + verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo, isFirst) => { assert.deepEqual(response, expectedResponse); verifyInfos(session, host); assert.equal(dtsInfo.sourceMapFilePath, dtsMapPath); if (isFirst) { - isFirst = false; if (dependencyMap) { verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); documentPositionMapper = dependencyMap.documentPositionMapper; @@ -10886,15 +10904,26 @@ fn5(); function verifyAllFnActionWithNoMap( session: TestSession, - host: TestServerHost + host: TestServerHost, + dependencyTsOK?: true ) { + let sourceMapFilePath: server.ScriptInfo["sourceMapFilePath"]; // action - verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoMapResponse }, dtsInfo) => { + verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoMapResponse }, dtsInfo, isFirst) => { assert.deepEqual(response, expectedNoMapResponse && verifier.length ? expectedNoMapResponse : expectedResponse); - verifyInfos(session, host, /*minusDtsMapAndSource*/ true); - assert.isFalse(dtsInfo.sourceMapFilePath); + verifyInfosWhenNoMapFile(session, host, dependencyTsOK); assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); + if (isFirst) { + assert.isNotString(dtsInfo.sourceMapFilePath); + assert.isNotFalse(dtsInfo.sourceMapFilePath); + assert.isDefined(dtsInfo.sourceMapFilePath); + sourceMapFilePath = dtsInfo.sourceMapFilePath; + } + else { + assert.equal(dtsInfo.sourceMapFilePath, sourceMapFilePath); + } }); + return sourceMapFilePath; } function verifyScenarioWithChangesWorker( @@ -10905,7 +10934,7 @@ fn5(); const { host, session } = openTsFile(); // Create DocumentPositionMapper - actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); + firstAction(session); const dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; const documentPositionMapper = dependencyMap.documentPositionMapper; @@ -10934,10 +10963,7 @@ fn5(); }); } - it(mainScenario, () => { - const { host, session } = openTsFile(); - checkProject(session); - + function verifyMainScenarioAndScriptInfoCollection(session: TestSession, host: TestServerHost) { // Main scenario action const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, host); checkProject(session); @@ -10953,6 +10979,28 @@ fn5(); closeFilesForSession([...openFiles, randomFile], session); openFilesForSession([randomFile], session); verifyOnlyRandomInfos(session, host); + } + + function verifyMainScenarioAndScriptInfoCollectionWithNoMap(session: TestSession, host: TestServerHost, dependencyTsOKInScenario?: true) { + // Main scenario action + verifyAllFnActionWithNoMap(session, host, dependencyTsOKInScenario); + + // Collecting at this point retains dependency.d.ts and map watcher + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfosWhenNoMapFile(session, host); + + // Closing open file, removes dependencies too + closeFilesForSession([...openFiles, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(session, host); + } + + it(mainScenario, () => { + const { host, session } = openTsFile(); + checkProject(session); + + verifyMainScenarioAndScriptInfoCollection(session, host); }); describe("when usage file changes, document position mapper doesnt change", () => { @@ -10963,7 +11011,7 @@ fn5(); }))); }); - describe("when dependency file changes, document position mapper doesnt change", () => { + describe("when dependency .d.ts changes, document position mapper doesnt change", () => { // Edit dts to add new fn verifyScenarioWithChanges(host => host.writeFile( dtsLocation, @@ -10983,15 +11031,34 @@ fn5(); ), /*afterActionDocumentPositionMapperNotEquals*/ true); }); - it("when map file is not present", () => { - const host = createHost(files, [mainConfig.path]); - host.deleteFile(dtsMapLocation); + describe("when map file is not present", () => { + it(mainScenario, () => { + const { host, session } = openTsFile(host => host.deleteFile(dtsMapLocation)); + checkProject(session); - const session = createSession(host); - openFilesForSession([...openFiles, randomFile], session); - checkProject(session); + verifyMainScenarioAndScriptInfoCollectionWithNoMap(session, host); + }); - verifyAllFnActionWithNoMap(session, host); + it("when map file is created", () => { + let dtsMapContents: string | undefined; + const { host, session } = openTsFile(host => { + dtsMapContents = host.readFile(dtsMapLocation)!; + host.deleteFile(dtsMapLocation); + }); + firstAction(session); + + host.writeFile(dtsMapLocation, dtsMapContents!); + verifyMainScenarioAndScriptInfoCollection(session, host); + }); + + it("when map file is deleted", () => { + const { host, session } = openTsFile(); + firstAction(session); + + // The dependency file is deleted when orphan files are collected + host.deleteFile(dtsMapLocation); + verifyMainScenarioAndScriptInfoCollectionWithNoMap(session, host, /*dependencyTsOKInScenario*/ true); + }); }); } From 6cb30651944458fd7a094326d705b68a01917b29 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 5 Dec 2018 15:31:55 -0800 Subject: [PATCH 130/322] Test to verify presence of .d.ts file --- src/compiler/program.ts | 21 +++- .../unittests/tsserverProjectSystem.ts | 107 +++++++++++++++--- 2 files changed, 104 insertions(+), 24 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 1789b161e39..080b17b8cbe 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -787,7 +787,13 @@ namespace ts { // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it. let redirectTargetsMap = createMultiMap(); - const filesByName = createMap(); + /** + * map with + * - SourceFile if present + * - false if sourceFile missing for source of project reference redirect + * - undefined otherwise + */ + const filesByName = createMap(); let missingFilePaths: ReadonlyArray | undefined; // stores 'filename -> file association' ignoring case // used to track cases when two file names differ only in casing @@ -854,7 +860,7 @@ namespace ts { } } - missingFilePaths = arrayFrom(filesByName.keys(), p => p).filter(p => !filesByName.get(p)); + missingFilePaths = arrayFrom(mapDefinedIterator(filesByName.entries(), ([path, file]) => file === undefined ? path as Path : undefined)); files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); processingDefaultLibFiles = undefined; processingOtherFiles = undefined; @@ -1567,7 +1573,7 @@ namespace ts { } function getSourceFileByPath(path: Path): SourceFile | undefined { - return filesByName.get(path); + return filesByName.get(path) || undefined; } function getDiagnosticsHelper( @@ -2104,7 +2110,7 @@ namespace ts { /** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */ function getSourceFileFromReference(referencingFile: SourceFile, ref: FileReference): SourceFile | undefined { - return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), fileName => filesByName.get(toPath(fileName))); + return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), fileName => filesByName.get(toPath(fileName)) || undefined); } function getSourceFileFromReferenceWorker( @@ -2235,7 +2241,7 @@ namespace ts { } } - return file; + return file || undefined; } let redirectedPath: Path | undefined; @@ -2327,9 +2333,12 @@ namespace ts { } function addFileToFilesByName(file: SourceFile | undefined, path: Path, redirectedPath: Path | undefined) { - filesByName.set(path, file); if (redirectedPath) { filesByName.set(redirectedPath, file); + filesByName.set(path, file || false); + } + else { + filesByName.set(path, file); } } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index b5909d3b3d5..ba7c7761886 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10692,7 +10692,11 @@ export function fn5() { } const mainTs: File = { path: `${mainLocation}/main.ts`, content: `import { - fn1, fn2, fn3, fn4, fn5 + fn1, + fn2, + fn3, + fn4, + fn5 } from '../dependency/fns' fn1(); @@ -10739,9 +10743,9 @@ fn5(); } // Returns request and expected Response, expected response when no map file - type SessionAction = [Partial, Response, Response?]; + type SessionAction = [Partial, Response, Response?, Response?]; function gotoDefintinionFromMainTs(fn: number): SessionAction { - const startSpan = { line: fn + 4, offset: 1 }; + const startSpan = { line: fn + 8, offset: 1 }; const textSpan: protocol.TextSpan = { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }; const definitionSpan: protocol.FileSpan = { file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; const declareSpaceLength = "declare ".length; @@ -10751,12 +10755,19 @@ fn5(); arguments: { file: mainTs.path, ...startSpan } }, { + // To dependency definitions: [definitionSpan], textSpan }, { + // To the dts definitions: [{ file: dtsPath, start: { line: fn, offset: definitionSpan.start.offset + declareSpaceLength }, end: { line: fn, offset: definitionSpan.end.offset + declareSpaceLength } }], textSpan + }, + { + // To import declaration + definitions: [{ file: mainTs.path, start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 } }], + textSpan } ]; } @@ -10816,11 +10827,16 @@ fn5(); return { host, session }; } - function checkProject(session: TestSession) { + function checkProject(session: TestSession, noDts?: true) { const service = session.getProjectService(); checkNumberOfProjects(service, { configuredProjects: 1 + verifier.length }); configFiles.forEach((configFile, index) => { - checkProjectActualFiles(service.configuredProjects.get(configFile)!, expectedProjectActualFiles[index]); + checkProjectActualFiles( + service.configuredProjects.get(configFile)!, + noDts ? + expectedProjectActualFiles[index].filter(f => f.toLowerCase() !== dtsPath) : + expectedProjectActualFiles[index] + ); }); } @@ -10839,6 +10855,21 @@ fn5(); ); } + function verifyInfosWhenNoDtsFile(session: TestSession, host: TestServerHost) { + const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); + const dtsClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsPath ? f : undefined); + verifyInfosWithRandom( + session, + host, + openInfos, + closedInfos.filter(f => f !== dtsMapClosedInfo && f !== dtsClosedInfo && f !== dependencyTs.path), + // When project actual file contains dts, it needs to be watched + dtsClosedInfo && verifier.length === 1 && expectedProjectActualFiles[0].some(f => f.toLowerCase() === dtsPath) ? + otherWatchedFiles.concat(dtsClosedInfo) : + otherWatchedFiles + ); + } + function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { assert.strictEqual(session.getProjectService().filenameToScriptInfo.get(dtsMapPath), dependencyMap); if (notEqual) { @@ -10850,24 +10881,29 @@ fn5(); } function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { - const [req, expectedResponse, expectedNoMapResponse] = actionGetter(fn); + const [req, expectedResponse, expectedNoMapResponse, expectedNoDtsResponse] = actionGetter(fn); const { response } = session.executeCommandSeq(req); - return { response, expectedResponse, expectedNoMapResponse }; + return { response, expectedResponse, expectedNoMapResponse, expectedNoDtsResponse }; } function firstAction(session: TestSession) { actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); } - function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo, isFirst: boolean) => void) { + function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo | undefined, isFirst: boolean) => void, dtsAbsent?: true) { // action let isFirst = true; for (const actionGetter of actionGetters) { for (let fn = 1; fn <= 5; fn++) { const result = action(actionGetter, fn, session); const dtsInfo = session.getProjectService().filenameToScriptInfo.get(dtsPath); - assert.isDefined(dtsInfo); - verifyAction(result, dtsInfo!, isFirst); + if (dtsAbsent) { + assert.isUndefined(dtsInfo); + } + else { + assert.isDefined(dtsInfo); + } + verifyAction(result, dtsInfo, isFirst); isFirst = false; } } @@ -10884,7 +10920,7 @@ fn5(); verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo, isFirst) => { assert.deepEqual(response, expectedResponse); verifyInfos(session, host); - assert.equal(dtsInfo.sourceMapFilePath, dtsMapPath); + assert.equal(dtsInfo!.sourceMapFilePath, dtsMapPath); if (isFirst) { if (dependencyMap) { verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); @@ -10910,22 +10946,33 @@ fn5(); let sourceMapFilePath: server.ScriptInfo["sourceMapFilePath"]; // action verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoMapResponse }, dtsInfo, isFirst) => { - assert.deepEqual(response, expectedNoMapResponse && verifier.length ? expectedNoMapResponse : expectedResponse); + assert.deepEqual(response, expectedNoMapResponse || expectedResponse); verifyInfosWhenNoMapFile(session, host, dependencyTsOK); assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); if (isFirst) { - assert.isNotString(dtsInfo.sourceMapFilePath); - assert.isNotFalse(dtsInfo.sourceMapFilePath); - assert.isDefined(dtsInfo.sourceMapFilePath); - sourceMapFilePath = dtsInfo.sourceMapFilePath; + assert.isNotString(dtsInfo!.sourceMapFilePath); + assert.isNotFalse(dtsInfo!.sourceMapFilePath); + assert.isDefined(dtsInfo!.sourceMapFilePath); + sourceMapFilePath = dtsInfo!.sourceMapFilePath; } else { - assert.equal(dtsInfo.sourceMapFilePath, sourceMapFilePath); + assert.equal(dtsInfo!.sourceMapFilePath, sourceMapFilePath); } }); return sourceMapFilePath; } + function verifyAllFnActionWithNoDts( + session: TestSession, + host: TestServerHost + ) { + // action + verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoDtsResponse }) => { + assert.deepEqual(response, expectedNoDtsResponse || expectedResponse); + verifyInfosWhenNoDtsFile(session, host); + }, /*dtsAbsent*/ true); + } + function verifyScenarioWithChangesWorker( change: (host: TestServerHost, session: TestSession) => void, afterActionDocumentPositionMapperNotEquals: true | undefined, @@ -10996,6 +11043,21 @@ fn5(); verifyOnlyRandomInfos(session, host); } + function verifyMainScenarioAndScriptInfoCollectionWithNoDts(session: TestSession, host: TestServerHost) { + // Main scenario action + verifyAllFnActionWithNoDts(session, host); + + // Collecting at this point retains dependency.d.ts and map watcher + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfosWhenNoDtsFile(session, host); + + // Closing open file, removes dependencies too + closeFilesForSession([...openFiles, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(session, host); + } + it(mainScenario, () => { const { host, session } = openTsFile(); checkProject(session); @@ -11060,13 +11122,22 @@ fn5(); verifyMainScenarioAndScriptInfoCollectionWithNoMap(session, host, /*dependencyTsOKInScenario*/ true); }); }); + + describe("when .d.ts file is not present", () => { + it(mainScenario, () => { + const { host, session } = openTsFile(host => host.deleteFile(dtsLocation)); + checkProject(session, /*noDts*/ true); + + verifyMainScenarioAndScriptInfoCollectionWithNoDts(session, host); + }); + }); } const usageVerifier: DocumentPositionMapperVerifier = [ /*openFile*/ mainTs, /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, dtsPath], /*actionGetter*/ gotoDefintinionFromMainTs, - /*openFileLastLine*/ 10 + /*openFileLastLine*/ 14 ]; describe("from project that uses dependency", () => { const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, dtsPath, dtsMapLocation]; From fa7f5cb5a0ab4068235dfa186bb1ee81ab772137 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 6 Dec 2018 12:18:10 -0800 Subject: [PATCH 131/322] Actually verify when dependency and main project is open --- src/compiler/sourcemap.ts | 3 +- src/server/editorServices.ts | 2 +- src/server/project.ts | 5 +- .../unittests/tsserverProjectSystem.ts | 305 +++++++++++------- 4 files changed, 192 insertions(+), 123 deletions(-) diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 00a78b0a93c..7c47449da10 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -583,7 +583,8 @@ namespace ts { } function compareSourcePositions(left: SourceMappedPosition, right: SourceMappedPosition) { - return compareValues(left.sourceIndex, right.sourceIndex); + Debug.assert(left.sourceIndex === right.sourceIndex); + return compareValues(left.sourcePosition, right.sourcePosition); } function compareGeneratedPositions(left: MappedPosition, right: MappedPosition) { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index b970a8fc716..0bdff39e49a 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2604,7 +2604,7 @@ namespace ts.server { /** @internal */ fileExists(fileName: NormalizedPath): boolean { - return this.filenameToScriptInfo.has(fileName) || this.host.fileExists(fileName); + return !!this.getScriptInfoForNormalizedPath(fileName) || this.host.fileExists(fileName); } private findExternalProjectContainingOpenScriptInfo(info: ScriptInfo): ExternalProject | undefined { diff --git a/src/server/project.ts b/src/server/project.ts index a28e9c35be5..e3069e1d183 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -759,7 +759,10 @@ namespace ts.server { } containsScriptInfo(info: ScriptInfo): boolean { - return this.isRoot(info) || (!!this.program && this.program.getSourceFileByPath(info.path) !== undefined); + if (this.isRoot(info)) return true; + if (!this.program) return false; + const file = this.program.getSourceFileByPath(info.path); + return !!file && file.resolvedPath === info.path; } containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index ba7c7761886..e6fc1fa3726 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10743,47 +10743,60 @@ fn5(); } // Returns request and expected Response, expected response when no map file - type SessionAction = [Partial, Response, Response?, Response?]; + interface SessionAction { + reqName: string; + request: Partial; + expectedResponse: Response; + expectedResponseNoMap?: Response; + expectedResponseNoDts?: Response; + } function gotoDefintinionFromMainTs(fn: number): SessionAction { - const startSpan = { line: fn + 8, offset: 1 }; - const textSpan: protocol.TextSpan = { start: startSpan, end: { line: startSpan.line, offset: startSpan.offset + 3 } }; - const definitionSpan: protocol.FileSpan = { file: dependencyTs.path, start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; + const textSpan = usageSpan(fn); + const definition: protocol.FileSpan = { file: dependencyTs.path, ...definitionSpan(fn) }; const declareSpaceLength = "declare ".length; - return [ - { + return { + reqName: "goToDef", + request: { command: protocol.CommandTypes.DefinitionAndBoundSpan, - arguments: { file: mainTs.path, ...startSpan } + arguments: { file: mainTs.path, ...textSpan.start } }, - { + expectedResponse: { // To dependency - definitions: [definitionSpan], + definitions: [definition], textSpan }, - { + expectedResponseNoMap: { // To the dts - definitions: [{ file: dtsPath, start: { line: fn, offset: definitionSpan.start.offset + declareSpaceLength }, end: { line: fn, offset: definitionSpan.end.offset + declareSpaceLength } }], + definitions: [{ file: dtsPath, start: { line: fn, offset: definition.start.offset + declareSpaceLength }, end: { line: fn, offset: definition.end.offset + declareSpaceLength } }], textSpan }, - { + expectedResponseNoDts: { // To import declaration - definitions: [{ file: mainTs.path, start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 } }], + definitions: [{ file: mainTs.path, ...importSpan(fn) }], textSpan } - ]; + }; + } + + function definitionSpan(fn: number): protocol.TextSpan { + return { start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; + } + function importSpan(fn: number): protocol.TextSpan { + return { start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 } }; + } + function usageSpan(fn: number): protocol.TextSpan { + return { start: { line: fn + 8, offset: 1 }, end: { line: fn + 8, offset: 4 } }; } function renameFromDependencyTs(fn: number): SessionAction { - const startSpan = { line: fn, offset: 17 }; - const triggerSpan = { - start: startSpan, - end: { line: startSpan.line, offset: startSpan.offset + 3 } - }; - return [ - { + const triggerSpan = definitionSpan(fn); + return { + reqName: "rename", + request: { command: protocol.CommandTypes.Rename, - arguments: { file: dependencyTs.path, ...startSpan } + arguments: { file: dependencyTs.path, ...triggerSpan.start } }, - { + expectedResponse: { info: { canRename: true, fileToRename: undefined, @@ -10797,26 +10810,57 @@ fn5(); { file: dependencyTs.path, locs: [triggerSpan] } ] } - ]; + }; + } + + function renameFromDependencyTsWithBothProjectsOpen(fn: number): SessionAction { + const { reqName, request, expectedResponse } = renameFromDependencyTs(fn); + const { info, locs } = expectedResponse; + return { + reqName, + request, + expectedResponse: { + info, + locs: [ + locs[0], + { + file: mainTs.path, + locs: [ + importSpan(fn), + usageSpan(fn) + ] + } + ] + }, + // Only dependency result + expectedResponseNoMap: expectedResponse, + expectedResponseNoDts: expectedResponse + }; } // Returns request and expected Response type SessionActionGetter = (fn: number) => SessionAction; // Open File, expectedProjectActualFiles, actionGetter, openFileLastLine - type DocumentPositionMapperVerifier = [File, ReadonlyArray, SessionActionGetter, number]; + interface DocumentPositionMapperVerifier { + openFile: File; + expectedProjectActualFiles: ReadonlyArray; + actionGetter: SessionActionGetter; + openFileLastLine: number; + } function verifyDocumentPositionMapperUpdates( mainScenario: string, verifier: ReadonlyArray, closedInfos: ReadonlyArray) { - const openFiles = verifier.map(v => v[0]); - const expectedProjectActualFiles = verifier.map(v => v[1]); - const actionGetters = verifier.map(v => v[2]); - const openFileLastLines = verifier.map(v => v[3]); + const openFiles = verifier.map(v => v.openFile); + const expectedProjectActualFiles = verifier.map(v => v.expectedProjectActualFiles); + const actionGetters = verifier.map(v => v.actionGetter); + const openFileLastLines = verifier.map(v => v.openFileLastLine); const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); const openInfos = openFiles.map(f => f.path); - const otherWatchedFiles = configFiles; + // When usage and dependency are used, dependency config is part of closedInfo so ignore + const otherWatchedFiles = verifier.length > 1 ? [configFiles[0]] : configFiles; function openTsFile(onHostCreate?: (host: TestServerHost) => void) { const host = createHost(files, [mainConfig.path]); if (onHostCreate) { @@ -10855,16 +10899,16 @@ fn5(); ); } - function verifyInfosWhenNoDtsFile(session: TestSession, host: TestServerHost) { + function verifyInfosWhenNoDtsFile(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); const dtsClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsPath ? f : undefined); verifyInfosWithRandom( session, host, openInfos, - closedInfos.filter(f => f !== dtsMapClosedInfo && f !== dtsClosedInfo && f !== dependencyTs.path), + closedInfos.filter(f => (dependencyTsAndMapOk || f !== dtsMapClosedInfo) && f !== dtsClosedInfo && (dependencyTsAndMapOk || f !== dependencyTs.path)), // When project actual file contains dts, it needs to be watched - dtsClosedInfo && verifier.length === 1 && expectedProjectActualFiles[0].some(f => f.toLowerCase() === dtsPath) ? + dtsClosedInfo && expectedProjectActualFiles.some(expectedProjectActualFiles => expectedProjectActualFiles.some(f => f.toLowerCase() === dtsPath)) ? otherWatchedFiles.concat(dtsClosedInfo) : otherWatchedFiles ); @@ -10881,9 +10925,9 @@ fn5(); } function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { - const [req, expectedResponse, expectedNoMapResponse, expectedNoDtsResponse] = actionGetter(fn); - const { response } = session.executeCommandSeq(req); - return { response, expectedResponse, expectedNoMapResponse, expectedNoDtsResponse }; + const { reqName, request, expectedResponse, expectedResponseNoMap, expectedResponseNoDts } = actionGetter(fn); + const { response } = session.executeCommandSeq(request); + return { reqName, response, expectedResponse, expectedResponseNoMap, expectedResponseNoDts }; } function firstAction(session: TestSession) { @@ -10917,8 +10961,8 @@ fn5(); documentPositionMapper?: server.ScriptInfo["documentPositionMapper"] ) { // action - verifyAllFnActionWorker(session, ({ response, expectedResponse }, dtsInfo, isFirst) => { - assert.deepEqual(response, expectedResponse); + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse }, dtsInfo, isFirst) => { + assert.deepEqual(response, expectedResponse, `Failed on ${reqName}`); verifyInfos(session, host); assert.equal(dtsInfo!.sourceMapFilePath, dtsMapPath); if (isFirst) { @@ -10945,8 +10989,8 @@ fn5(); ) { let sourceMapFilePath: server.ScriptInfo["sourceMapFilePath"]; // action - verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoMapResponse }, dtsInfo, isFirst) => { - assert.deepEqual(response, expectedNoMapResponse || expectedResponse); + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoMap }, dtsInfo, isFirst) => { + assert.deepEqual(response, expectedResponseNoMap || expectedResponse, `Failed on ${reqName}`); verifyInfosWhenNoMapFile(session, host, dependencyTsOK); assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); if (isFirst) { @@ -10964,12 +11008,13 @@ fn5(); function verifyAllFnActionWithNoDts( session: TestSession, - host: TestServerHost + host: TestServerHost, + dependencyTsAndMapOk?: true ) { // action - verifyAllFnActionWorker(session, ({ response, expectedResponse, expectedNoDtsResponse }) => { - assert.deepEqual(response, expectedNoDtsResponse || expectedResponse); - verifyInfosWhenNoDtsFile(session, host); + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoDts }) => { + assert.deepEqual(response, expectedResponseNoDts || expectedResponse, `Failed on ${reqName}`); + verifyInfosWhenNoDtsFile(session, host, dependencyTsAndMapOk); }, /*dtsAbsent*/ true); } @@ -10998,15 +11043,18 @@ fn5(); } function verifyScenarioWithChanges( + scenarioName: string, change: (host: TestServerHost, session: TestSession) => void, afterActionDocumentPositionMapperNotEquals?: true ) { - it("when timeout occurs before request", () => { - verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ true); - }); + describe(scenarioName, () => { + it("when timeout occurs before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ true); + }); - it("when timeout does not occur before request", () => { - verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ false); + it("when timeout does not occur before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ false); + }); }); } @@ -11043,9 +11091,9 @@ fn5(); verifyOnlyRandomInfos(session, host); } - function verifyMainScenarioAndScriptInfoCollectionWithNoDts(session: TestSession, host: TestServerHost) { + function verifyMainScenarioAndScriptInfoCollectionWithNoDts(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { // Main scenario action - verifyAllFnActionWithNoDts(session, host); + verifyAllFnActionWithNoDts(session, host, dependencyTsAndMapOk); // Collecting at this point retains dependency.d.ts and map watcher closeFilesForSession([randomFile], session); @@ -11058,6 +11106,43 @@ fn5(); verifyOnlyRandomInfos(session, host); } + function verifyScenarioWhenFileNotPresent( + scenarioName: string, + fileLocation: string, + verifyScenarioAndScriptInfoCollection: (session: TestSession, host: TestServerHost, dependencyTsOk?: true) => void, + noDts?: true + ) { + describe(scenarioName, () => { + it(mainScenario, () => { + const { host, session } = openTsFile(host => host.deleteFile(fileLocation)); + checkProject(session, noDts); + + verifyScenarioAndScriptInfoCollection(session, host); + }); + + it("when file is created", () => { + let fileContents: string | undefined; + const { host, session } = openTsFile(host => { + fileContents = host.readFile(fileLocation); + host.deleteFile(fileLocation); + }); + firstAction(session); + + host.writeFile(fileLocation, fileContents!); + verifyMainScenarioAndScriptInfoCollection(session, host); + }); + + it("when file is deleted", () => { + const { host, session } = openTsFile(); + firstAction(session); + + // The dependency file is deleted when orphan files are collected + host.deleteFile(fileLocation); + verifyScenarioAndScriptInfoCollection(session, host, /*dependencyTsOk*/ true); + }); + }); + } + it(mainScenario, () => { const { host, session } = openTsFile(); checkProject(session); @@ -11065,80 +11150,60 @@ fn5(); verifyMainScenarioAndScriptInfoCollection(session, host); }); - describe("when usage file changes, document position mapper doesnt change", () => { - // Edit - verifyScenarioWithChanges((_host, session) => openFiles.forEach((openFile, index) => session.executeCommandSeq({ - command: protocol.CommandTypes.Change, - arguments: { file: openFile.path, line: openFileLastLines[index], offset: 1, endLine: openFileLastLines[index], endOffset: 1, insertString: "const x = 10;" } - }))); - }); + // Edit + verifyScenarioWithChanges( + "when usage file changes, document position mapper doesnt change", + (_host, session) => openFiles.forEach( + (openFile, index) => session.executeCommandSeq({ + command: protocol.CommandTypes.Change, + arguments: { file: openFile.path, line: openFileLastLines[index], offset: 1, endLine: openFileLastLines[index], endOffset: 1, insertString: "const x = 10;" } + }) + ) + ); - describe("when dependency .d.ts changes, document position mapper doesnt change", () => { - // Edit dts to add new fn - verifyScenarioWithChanges(host => host.writeFile( + // Edit dts to add new fn + verifyScenarioWithChanges( + "when dependency .d.ts changes, document position mapper doesnt change", + host => host.writeFile( dtsLocation, host.readFile(dtsLocation)!.replace( "//# sourceMappingURL=FnS.d.ts.map", `export declare function fn6(): void; //# sourceMappingURL=FnS.d.ts.map` ) - )); - }); + ) + ); - describe("when dependency file's map changes", () => { - // Edit map file to represent added new line - verifyScenarioWithChanges(host => host.writeFile( + // Edit map file to represent added new line + verifyScenarioWithChanges( + "when dependency file's map changes", + host => host.writeFile( dtsMapLocation, - `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM"}` - ), /*afterActionDocumentPositionMapperNotEquals*/ true); - }); + `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,eAAO,MAAM,CAAC,KAAK,CAAC"}` + ), + /*afterActionDocumentPositionMapperNotEquals*/ true + ); - describe("when map file is not present", () => { - it(mainScenario, () => { - const { host, session } = openTsFile(host => host.deleteFile(dtsMapLocation)); - checkProject(session); + verifyScenarioWhenFileNotPresent( + "when map file is not present", + dtsMapLocation, + verifyMainScenarioAndScriptInfoCollectionWithNoMap + ); - verifyMainScenarioAndScriptInfoCollectionWithNoMap(session, host); - }); - - it("when map file is created", () => { - let dtsMapContents: string | undefined; - const { host, session } = openTsFile(host => { - dtsMapContents = host.readFile(dtsMapLocation)!; - host.deleteFile(dtsMapLocation); - }); - firstAction(session); - - host.writeFile(dtsMapLocation, dtsMapContents!); - verifyMainScenarioAndScriptInfoCollection(session, host); - }); - - it("when map file is deleted", () => { - const { host, session } = openTsFile(); - firstAction(session); - - // The dependency file is deleted when orphan files are collected - host.deleteFile(dtsMapLocation); - verifyMainScenarioAndScriptInfoCollectionWithNoMap(session, host, /*dependencyTsOKInScenario*/ true); - }); - }); - - describe("when .d.ts file is not present", () => { - it(mainScenario, () => { - const { host, session } = openTsFile(host => host.deleteFile(dtsLocation)); - checkProject(session, /*noDts*/ true); - - verifyMainScenarioAndScriptInfoCollectionWithNoDts(session, host); - }); - }); + verifyScenarioWhenFileNotPresent( + "when .d.ts file is not present", + dtsLocation, + verifyMainScenarioAndScriptInfoCollectionWithNoDts, + /*noDts*/ true + ); } - const usageVerifier: DocumentPositionMapperVerifier = [ - /*openFile*/ mainTs, - /*expectedProjectActualFiles*/[mainTs.path, libFile.path, mainConfig.path, dtsPath], - /*actionGetter*/ gotoDefintinionFromMainTs, - /*openFileLastLine*/ 14 - ]; + const usageVerifier: DocumentPositionMapperVerifier = { + openFile: mainTs, + expectedProjectActualFiles: [mainTs.path, libFile.path, mainConfig.path, dtsPath], + actionGetter: gotoDefintinionFromMainTs, + openFileLastLine: 14 + }; describe("from project that uses dependency", () => { const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, dtsPath, dtsMapLocation]; verifyDocumentPositionMapperUpdates( @@ -11148,12 +11213,12 @@ fn5(); ); }); - const definingVerifier: DocumentPositionMapperVerifier = [ - /*openFile*/ dependencyTs, - /*expectedProjectActualFiles*/[dependencyTs.path, libFile.path, dependencyConfig.path], - /*actionGetter*/ renameFromDependencyTs, - /*openFileLastLine*/ 6 - ]; + const definingVerifier: DocumentPositionMapperVerifier = { + openFile: dependencyTs, + expectedProjectActualFiles: [dependencyTs.path, libFile.path, dependencyConfig.path], + actionGetter: renameFromDependencyTs, + openFileLastLine: 6 + }; describe("from defining project", () => { const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; verifyDocumentPositionMapperUpdates( @@ -11164,10 +11229,10 @@ fn5(); }); describe("when opening depedency and usage project", () => { - const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; + const closedInfos = [libFile.path, dtsPath, dtsMapLocation, dependencyConfig.path]; verifyDocumentPositionMapperUpdates( "goto Definition in usage and rename locations from defining project", - [definingVerifier], + [usageVerifier, { ...definingVerifier, actionGetter: renameFromDependencyTsWithBothProjectsOpen }], closedInfos ); }); From 1ed67c0ebd47800646b46783426c715f98e74e3d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 6 Dec 2018 15:05:23 -0800 Subject: [PATCH 132/322] Accept test changes --- src/testRunner/unittests/textStorage.ts | 18 +++++++++++------- .../reference/api/tsserverlibrary.d.ts | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/textStorage.ts index 724dc8e4ed3..0bb14aa2d90 100644 --- a/src/testRunner/unittests/textStorage.ts +++ b/src/testRunner/unittests/textStorage.ts @@ -10,12 +10,16 @@ namespace ts.textStorage { }` }; + function getDummyScriptInfo() { + return { closeSourceMapFileWatcher: noop } as server.ScriptInfo; + } + it("text based storage should be have exactly the same as script version cache", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); - const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); + const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); ts1.useScriptVersionCache_TestOnly(); ts2.useText(); @@ -49,7 +53,7 @@ namespace ts.textStorage { it("should switch to script version cache if necessary", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); ts1.getSnapshot(); assert.isFalse(ts1.hasScriptVersionCache_TestOnly(), "should not have script version cache - 1"); @@ -67,7 +71,7 @@ namespace ts.textStorage { it("should be able to return the file size immediately after construction", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); assert.strictEqual(f.content.length, ts1.getTelemetryFileSize()); }); @@ -75,7 +79,7 @@ namespace ts.textStorage { it("should be able to return the file size when backed by text", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); ts1.useText(f.content); assert.isFalse(ts1.hasScriptVersionCache_TestOnly()); @@ -86,7 +90,7 @@ namespace ts.textStorage { it("should be able to return the file size when backed by a script version cache", () => { const host = projectSystem.createServerHost([f]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path), /*initialVersion*/ undefined, getDummyScriptInfo()); ts1.useScriptVersionCache_TestOnly(); assert.isTrue(ts1.hasScriptVersionCache_TestOnly()); @@ -126,7 +130,7 @@ namespace ts.textStorage { const host = projectSystem.createServerHost([changingFile]); // Since script info is not used in these tests, just cheat by passing undefined - const ts1 = new server.TextStorage(host, server.asNormalizedPath(changingFile.path), /*initialVersion*/ undefined, {} as server.ScriptInfo); + const ts1 = new server.TextStorage(host, server.asNormalizedPath(changingFile.path), /*initialVersion*/ undefined, getDummyScriptInfo()); assert.isTrue(ts1.reloadFromDisk()); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index fa6990c07f4..91f492ddd1d 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8688,6 +8688,8 @@ declare namespace ts.server { */ getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; getScriptInfoForPath(fileName: Path): ScriptInfo | undefined; + private addSourceInfoToSourceMap; + private addMissingSourceMapFile; setHostConfiguration(args: protocol.ConfigureRequestArguments): void; closeLog(): void; /** From 2f84741725a1db41db794163fed6215259cfd57b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 6 Dec 2018 15:13:21 -0800 Subject: [PATCH 133/322] Remove unnecessary fields --- src/server/editorServices.ts | 1 - src/server/scriptInfo.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 0bdff39e49a..3050c976231 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2298,7 +2298,6 @@ namespace ts.server { } else if (mapFileNameFromDeclarationInfo) { declarationInfo.sourceMapFilePath = { - declarationInfoPath: declarationInfo.path, watcher: this.addMissingSourceMapFile( project.currentDirectory === this.currentDirectory ? mapFileNameFromDeclarationInfo : diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 21c011d7261..68c448a7e76 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -283,7 +283,6 @@ namespace ts.server { /*@internal*/ export interface SourceMapFileWatcher { - declarationInfoPath: Path; watcher: FileWatcher; sourceInfos?: Map; } From 6fcc815aa8591211fe2134976b0c2a9cb961fac1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 6 Dec 2018 18:06:59 -0800 Subject: [PATCH 134/322] Check if the expression had any trailing comments. --- src/compiler/emitter.ts | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 15b6540900f..9c09ed79a77 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1651,11 +1651,17 @@ namespace ts { function emitPropertyAccessExpression(node: PropertyAccessExpression) { let indentBeforeDot = false; let indentAfterDot = false; + const dotRangeFirstCommentStart = skipTrivia( + currentSourceFile!.text, + node.expression.end, + /*stopAfterLineBreak*/ false, + /*stopAtComments*/ true + ); + const dotRangeStart = skipTrivia(currentSourceFile!.text, dotRangeFirstCommentStart); + const dotRangeEnd = dotRangeStart + 1; if (!(getEmitFlags(node) & EmitFlags.NoIndentation)) { - const dotRangeStart = node.expression.end; - const dotRangeEnd = skipTrivia(currentSourceFile!.text, node.expression.end) + 1; const dotToken = createToken(SyntaxKind.DotToken); - dotToken.pos = dotRangeStart; + dotToken.pos = node.expression.end; dotToken.end = dotRangeEnd; indentBeforeDot = needsIndentation(node, node.expression, dotToken); indentAfterDot = needsIndentation(node, dotToken, node.name); @@ -1664,7 +1670,8 @@ namespace ts { emitExpression(node.expression); increaseIndentIf(indentBeforeDot, /*writeSpaceIfNotIndenting*/ false); - const shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); + const dotHasCommentTrivia = dotRangeFirstCommentStart !== dotRangeStart; + const shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression, dotHasCommentTrivia); if (shouldEmitDotDot) { writePunctuation("."); } @@ -1677,13 +1684,15 @@ namespace ts { // 1..toString is a valid property access, emit a dot after the literal // Also emit a dot if expression is a integer const enum value - it will appear in generated code as numeric literal - function needsDotDotForPropertyAccess(expression: Expression) { + function needsDotDotForPropertyAccess(expression: Expression, dotHasTrivia: boolean) { expression = skipPartiallyEmittedExpressions(expression); if (isNumericLiteral(expression)) { // check if numeric literal is a decimal literal that was originally written with a dot const text = getLiteralTextOfNode(expression, /*neverAsciiEscape*/ true); - return !expression.numericLiteralFlags - && !stringContains(text, tokenToString(SyntaxKind.DotToken)!); + // If he number will be printed verbatim and it doesn't already contain a dot, add one + // if the expression doesn't have any comments that will be emitted. + return !expression.numericLiteralFlags && !stringContains(text, tokenToString(SyntaxKind.DotToken)!) && + (!dotHasTrivia || printerOptions.removeComments); } else if (isPropertyAccessExpression(expression) || isElementAccessExpression(expression)) { // check if constant enum value is integer From 75c51f50bbe35ed51f98a4b7e4776c2fcc142089 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 6 Dec 2018 18:07:10 -0800 Subject: [PATCH 135/322] Accepted baselines. --- .../reference/numericLiteralsWithTrailingDecimalPoints01.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js index 62e40a94e22..4ea5c5c7bd2 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js @@ -38,4 +38,4 @@ var test7 = 3 .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3.; -var test10 = 0 /* any comment */..toString(); +var test10 = 0 /* any comment */.toString(); From 773c50f05ae876dacb65e2a6d2b7e9c662279ec6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 7 Dec 2018 00:40:13 -0800 Subject: [PATCH 136/322] Better error message for invalid bigint literals ending with n Helps with the cases of decimals and exponentials, though not with numbers incorrectly starting with `0`. Fixes #28887. --- src/compiler/diagnosticMessages.json | 8 ++++++++ src/compiler/scanner.ts | 18 +++++++++++++++--- .../baselines/reference/parseBigInt.errors.txt | 12 ++++++------ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cde7516f047..ed7c25d5919 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1015,6 +1015,14 @@ "category": "Error", "code": 1351 }, + "A bigint literal cannot use exponential notation.": { + "category": "Error", + "code": 1352 + }, + "A bigint literal must be an integer.": { + "category": "Error", + "code": 1353 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index a9438110593..1a6da02bbd0 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -976,7 +976,7 @@ namespace ts { } if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { - checkForIdentifierStartAfterNumericLiteral(); + checkForIdentifierStartAfterNumericLiteral(decimalFragment === undefined && !!(tokenFlags & TokenFlags.Scientific)); return { type: SyntaxKind.NumericLiteral, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -990,14 +990,26 @@ namespace ts { } } - function checkForIdentifierStartAfterNumericLiteral() { + function checkForIdentifierStartAfterNumericLiteral(isScientific?: boolean) { if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) { return; } const identifierStart = pos; const { length } = scanIdentifierParts(); - error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + + if (length === 1 && text[identifierStart] === "n") { + if (isScientific) { + error(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, identifierStart, length); + } + else { + error(Diagnostics.A_bigint_literal_must_be_an_integer, identifierStart, length); + } + } + else { + error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + } + pos = identifierStart; } diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index 16878e75fe9..72f98ee0f46 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(57,25): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(58,22): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. -tests/cases/compiler/parseBigInt.ts(59,28): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/parseBigInt.ts(57,25): error TS1352: A bigint literal cannot use exponential notation. +tests/cases/compiler/parseBigInt.ts(58,22): error TS1353: A bigint literal must be an integer. +tests/cases/compiler/parseBigInt.ts(59,28): error TS1353: A bigint literal must be an integer. tests/cases/compiler/parseBigInt.ts(60,23): error TS1177: Binary digit expected. tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected. tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected. @@ -82,13 +82,13 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i !!! error TS1005: ',' expected. { const scientific = 1e2n; } ~ -!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +!!! error TS1352: A bigint literal cannot use exponential notation. { const decimal = 4.1n; } ~ -!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +!!! error TS1353: A bigint literal must be an integer. { const leadingDecimal = .1n; } ~ -!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +!!! error TS1353: A bigint literal must be an integer. const emptyBinary = 0bn; // should error but infer 0n !!! error TS1177: Binary digit expected. From c156c9377a410ce50457ed8f5243bfbe063445d7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 08:56:22 -0800 Subject: [PATCH 137/322] Add note about comparing source positions --- src/compiler/sourcemap.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 7c47449da10..c2597d688d8 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -583,6 +583,8 @@ namespace ts { } function compareSourcePositions(left: SourceMappedPosition, right: SourceMappedPosition) { + // Compares sourcePosition without comparing sourceIndex + // since the mappings are grouped by sourceIndex Debug.assert(left.sourceIndex === right.sourceIndex); return compareValues(left.sourcePosition, right.sourcePosition); } From 94b3d1a2b535da60b2803a788516197cd97516dc Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 8 Dec 2018 11:53:18 +0200 Subject: [PATCH 138/322] Allow trailing comma on tuple types --- src/compiler/checker.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f76f1b318e9..4573857a003 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23643,7 +23643,6 @@ namespace ts { break; } } - checkGrammarForDisallowedTrailingComma(node.elementTypes); forEach(node.elementTypes, checkSourceElement); } From a92462db6cebddc0de66701c6892cd3c1428a0d2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 8 Dec 2018 12:06:37 +0200 Subject: [PATCH 139/322] 28893 - update baseline --- tests/baselines/reference/TupleType5.errors.txt | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/baselines/reference/TupleType5.errors.txt diff --git a/tests/baselines/reference/TupleType5.errors.txt b/tests/baselines/reference/TupleType5.errors.txt deleted file mode 100644 index 1a6ca7f99b3..00000000000 --- a/tests/baselines/reference/TupleType5.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts(1,15): error TS1009: Trailing comma not allowed. - - -==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType5.ts (1 errors) ==== - var v: [number,] - ~ -!!! error TS1009: Trailing comma not allowed. \ No newline at end of file From e219b17ff0dd0dd8cea0ba7cd21eec80556ce070 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 8 Dec 2018 20:50:09 +0200 Subject: [PATCH 140/322] TupleType - add additional tests to handle error on extra comma --- tests/baselines/reference/TupleType6.errors.txt | 7 +++++++ tests/baselines/reference/TupleType6.js | 5 +++++ tests/baselines/reference/TupleType6.symbols | 4 ++++ tests/baselines/reference/TupleType6.types | 4 ++++ .../parser/ecmascript5/TupleTypes/TupleType6.ts | 1 + 5 files changed, 21 insertions(+) create mode 100644 tests/baselines/reference/TupleType6.errors.txt create mode 100644 tests/baselines/reference/TupleType6.js create mode 100644 tests/baselines/reference/TupleType6.symbols create mode 100644 tests/baselines/reference/TupleType6.types create mode 100644 tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts diff --git a/tests/baselines/reference/TupleType6.errors.txt b/tests/baselines/reference/TupleType6.errors.txt new file mode 100644 index 00000000000..1c3427b8f38 --- /dev/null +++ b/tests/baselines/reference/TupleType6.errors.txt @@ -0,0 +1,7 @@ +tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts(1,16): error TS1110: Type expected. + + +==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts (1 errors) ==== + var v: [number,,] + ~ +!!! error TS1110: Type expected. \ No newline at end of file diff --git a/tests/baselines/reference/TupleType6.js b/tests/baselines/reference/TupleType6.js new file mode 100644 index 00000000000..828d90a72bf --- /dev/null +++ b/tests/baselines/reference/TupleType6.js @@ -0,0 +1,5 @@ +//// [TupleType6.ts] +var v: [number,,] + +//// [TupleType6.js] +var v; diff --git a/tests/baselines/reference/TupleType6.symbols b/tests/baselines/reference/TupleType6.symbols new file mode 100644 index 00000000000..b02a0d6eb5e --- /dev/null +++ b/tests/baselines/reference/TupleType6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts === +var v: [number,,] +>v : Symbol(v, Decl(TupleType6.ts, 0, 3)) + diff --git a/tests/baselines/reference/TupleType6.types b/tests/baselines/reference/TupleType6.types new file mode 100644 index 00000000000..a5f9c5e59eb --- /dev/null +++ b/tests/baselines/reference/TupleType6.types @@ -0,0 +1,4 @@ +=== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts === +var v: [number,,] +>v : [number, any] + diff --git a/tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts b/tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts new file mode 100644 index 00000000000..50cca65c6dc --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType6.ts @@ -0,0 +1 @@ +var v: [number,,] \ No newline at end of file From 9cc997fca76d0befe9ba42803a6be9263f2b24dc Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 8 Dec 2018 11:02:19 -0800 Subject: [PATCH 141/322] Improve typing of 'bind' method on function types --- src/lib/es5.d.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index c8e99f0d1db..308af721af6 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -295,6 +295,16 @@ interface FunctionConstructor { declare const Function: FunctionConstructor; +/** + * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter. + */ +type ThisParameterType = T extends (this: unknown, ...args: any[]) => any ? unknown : T extends (this: infer U, ...args: any[]) => any ? U : unknown; + +/** + * Removes the 'this' parameter from a function type. + */ +type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T; + interface CallableFunction extends Function { /** * Calls the function with the specified object as the this value and the elements of specified array as the arguments. @@ -317,7 +327,7 @@ interface CallableFunction extends Function { * @param thisArg The object to be used as the this object. * @param args Arguments to bind to the parameters of the function. */ - bind(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; + bind(this: T, thisArg: ThisParameterType): OmitThisParameter; bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; @@ -347,7 +357,7 @@ interface NewableFunction extends Function { * @param thisArg The object to be used as the this object. * @param args Arguments to bind to the parameters of the function. */ - bind(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; + bind(this: T, thisArg: any): T; bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; From aea2a12d79d76b8240dffbf2f6996d8e80e1a80c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 8 Dec 2018 11:03:00 -0800 Subject: [PATCH 142/322] Accept new baselines --- ...tructuringParameterDeclaration4.errors.txt | 2 +- .../reference/externModule.errors.txt | 8 +-- ...mUsingES6FeaturesWithOnlyES5Lib.errors.txt | 2 +- ...wExceptionVariableInCatchClause.errors.txt | 2 +- .../narrowFromAnyWithInstanceof.errors.txt | 4 +- .../narrowFromAnyWithTypePredicate.errors.txt | 4 +- ...erAccessAfterPostfixExpression1.errors.txt | 2 +- .../reference/parserS7.2_A1.5_T2.errors.txt | 4 +- .../reference/parserS7.3_A1.1_T2.errors.txt | 2 +- .../reference/parserS7.6_A4.2_T1.errors.txt | 20 +++---- .../reference/parserUnicode1.errors.txt | 4 +- .../reference/promisePermutations.errors.txt | 2 +- .../reference/promisePermutations2.errors.txt | 2 +- .../reference/promisePermutations3.errors.txt | 4 +- .../reference/promiseTypeInference.errors.txt | 2 +- .../reference/scannerS7.2_A1.5_T2.errors.txt | 4 +- .../reference/scannerS7.3_A1.1_T2.errors.txt | 2 +- .../reference/scannerS7.6_A4.2_T1.errors.txt | 20 +++---- .../reference/strictBindCallApply1.types | 56 +++++++++---------- ...eStringsWithOverloadResolution1.errors.txt | 2 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 2 +- 21 files changed, 75 insertions(+), 75 deletions(-) diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index e51ee68b604..035d912b638 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -41,7 +41,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'? -!!! related TS2728 /.ts/lib.es5.d.ts:1358:15: 'Array' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1368:15: 'Array' is declared here. a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] ~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type '[[any]]'. diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 377fe025cc6..8e95e2c8101 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -69,20 +69,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat var d=new XDate(); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here. d.getDay(); d=new XDate(1978,2); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here. d.getXDate(); var n=XDate.parse("3/2/2004"); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here. n=XDate.UTC(1964,2,1); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:907:15: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt index f2c77d62984..db1b2840132 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt @@ -41,7 +41,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t Math.sign(1); ~~~~ !!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? -!!! related TS2728 /.ts/lib.es5.d.ts:703:5: 'sin' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:713:5: 'sin' is declared here. // Using ES6 object var o = { diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index 12b2790c3de..c5a85483631 100644 --- a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt +++ b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt @@ -24,7 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17) err.massage; // ERROR: Property 'massage' does not exist on type 'Error' ~~~~~~~ !!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index f5c0c5728f1..6e7ae406bcf 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here. } if (x instanceof Date) { @@ -30,6 +30,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:753:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:763:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt index 385357f2204..0cf20b5c86b 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -39,7 +39,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:5: 'message' is declared here. } if (isDate(x)) { @@ -47,6 +47,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:753:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:763:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index bd7db9c44fe..ab9d0a34a55 100644 --- a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt @@ -11,4 +11,4 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo !!! error TS1005: ';' expected. ~~~~~~~~ !!! error TS2552: Cannot find name 'toString'. Did you mean 'String'? -!!! related TS2728 /.ts/lib.es5.d.ts:517:15: 'String' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:527:15: 'String' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt index 136d4477268..5d1059f6eff 100644 --- a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } diff --git a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt index 3a35d5f0a83..1f8845e808a 100644 --- a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt index 35fc8935b73..4242d1faeca 100644 --- a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts(142,3): error T $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/parserUnicode1.errors.txt b/tests/baselines/reference/parserUnicode1.errors.txt index 2e16f696620..aa9cf504714 100644 --- a/tests/baselines/reference/parserUnicode1.errors.txt +++ b/tests/baselines/reference/parserUnicode1.errors.txt @@ -11,13 +11,13 @@ tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts(10,5): error TS2552 $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } } catch (e) { $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 7d1112dab17..c719d8a9b95 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -295,7 +295,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t ~~~~~~~~~ !!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 10abb661feb..b88ef28ca5c 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -294,7 +294,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of ~~~~~~~~~ !!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 733eae63c5f..7f12ee8609a 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -303,7 +303,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of ~~~~~~~~~ !!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; @@ -340,5 +340,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise<{}>'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise<{}>'. -!!! related TS2728 /.ts/lib.es5.d.ts:1403:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1413:5: 'catch' is declared here. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 5edf8f5b091..1996f37e540 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -26,5 +26,5 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromis !!! error TS2322: Types of parameters 'success' and 'onfulfilled' are incompatible. !!! error TS2322: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. !!! error TS2322: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS6502 /.ts/lib.es5.d.ts:1396:57: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1406:57: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt index f61392a51ec..473590f63e5 100644 --- a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt index f7ab44d83d5..fa25b5cc170 100644 --- a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts(17,3): error $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt index ab3bddb5bc6..6dc7a99446b 100644 --- a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts(142,3): error $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:984:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types index a895447e182..eb859d722d8 100644 --- a/tests/baselines/reference/strictBindCallApply1.types +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -7,26 +7,26 @@ declare function foo(a: number, b: string): string; let f00 = foo.bind(undefined); >f00 : (a: number, b: string) => string >foo.bind(undefined) : (a: number, b: string) => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined let f01 = foo.bind(undefined, 10); >f01 : (b: string) => string >foo.bind(undefined, 10) : (b: string) => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 let f02 = foo.bind(undefined, 10, "hello"); >f02 : () => string >foo.bind(undefined, 10, "hello") : () => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -34,9 +34,9 @@ let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error >f03 : any >foo.bind(undefined, 10, 20) : any ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 >20 : 20 @@ -149,32 +149,32 @@ declare let obj: {}; let f10 = c.foo.bind(c); >f10 : (a: number, b: string) => string >c.foo.bind(c) : (a: number, b: string) => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C let f11 = c.foo.bind(c, 10); >f11 : (b: string) => string >c.foo.bind(c, 10) : (b: string) => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 let f12 = c.foo.bind(c, 10, "hello"); >f12 : () => string >c.foo.bind(c, 10, "hello") : () => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 >"hello" : "hello" @@ -182,11 +182,11 @@ let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error >f13 : any >c.foo.bind(c, 10, 20) : any ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 >20 : 20 @@ -194,11 +194,11 @@ let f13 = c.foo.bind(c, 10, 20); // Error let f14 = c.foo.bind(undefined); // Error >f14 : any >c.foo.bind(undefined) : any ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined let c10 = c.foo.call(c, 10, "hello"); @@ -327,28 +327,28 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error >"hello" : "hello" let f20 = C.bind(undefined); ->f20 : new (a: number, b: string) => C ->C.bind(undefined) : new (a: number, b: string) => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>f20 : typeof C +>C.bind(undefined) : typeof C +>C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined let f21 = C.bind(undefined, 10); >f21 : new (b: string) => C >C.bind(undefined, 10) : new (b: string) => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 let f22 = C.bind(undefined, 10, "hello"); >f22 : new () => C >C.bind(undefined, 10, "hello") : new () => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -356,9 +356,9 @@ let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error >f23 : any >C.bind(undefined, 10, 20) : any ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 >20 : 20 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index b70344e0a06..f4bcdb5a1ac 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:595:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here. var b = foo([], 1); // string ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 7cdc02c457d..a6f6708074c 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:595:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here. var b = foo([], 1); // string ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. From 992513791d032c0e68b7f20d6f903d8b1186f2de Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 8 Dec 2018 11:03:37 -0800 Subject: [PATCH 143/322] Fix findAllReferences for 'this' parameter declarations --- src/services/findAllReferences.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 0ed29a73bb5..f290826690e 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -1428,6 +1428,10 @@ namespace ts.FindAllReferences.Core { return [{ definition: { type: DefinitionKind.Symbol, symbol: searchSpaceNode.symbol }, references }]; } + function isParameterName(node: Node) { + return node.kind === SyntaxKind.Identifier && node.parent.kind === SyntaxKind.Parameter && (node.parent).name === node; + } + function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] | undefined { let searchSpaceNode = getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); @@ -1450,7 +1454,7 @@ namespace ts.FindAllReferences.Core { searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; case SyntaxKind.SourceFile: - if (isExternalModule(searchSpaceNode)) { + if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through @@ -1483,7 +1487,7 @@ namespace ts.FindAllReferences.Core { // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag; case SyntaxKind.SourceFile: - return container.kind === SyntaxKind.SourceFile && !isExternalModule(container); + return container.kind === SyntaxKind.SourceFile && !isExternalModule(container) && !isParameterName(node); } }); }).map(n => nodeEntry(n)); From 201eec62304631864d78f4c7ec0e0e5383665c7b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 8 Dec 2018 11:20:31 -0800 Subject: [PATCH 144/322] Update fourslash list of global types --- src/harness/fourslash.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index b79a154c555..b02aff523d1 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -4450,6 +4450,8 @@ namespace FourSlashInterface { interfaceEntry("ObjectConstructor"), constEntry("Function"), interfaceEntry("FunctionConstructor"), + typeEntry("ThisParameterType"), + typeEntry("OmitThisParameter"), interfaceEntry("CallableFunction"), interfaceEntry("NewableFunction"), interfaceEntry("IArguments"), From 67f037ccf410ed20a76a94ca744e1383a7c6d71e Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sat, 8 Dec 2018 22:34:47 +0100 Subject: [PATCH 145/322] Avoid uses of ES6 Set, use Array instead Fixes: #28918 --- src/compiler/inspectValue.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/inspectValue.ts b/src/compiler/inspectValue.ts index 8433ee6e489..5b78cd89620 100644 --- a/src/compiler/inspectValue.ts +++ b/src/compiler/inspectValue.ts @@ -40,18 +40,18 @@ namespace ts { type Recurser = (obj: unknown, name: string, cbOk: () => T, cbFail: (isCircularReference: boolean, keyStack: ReadonlyArray) => T) => T; function getRecurser(): Recurser { - const seen = new Set(); + const seen: unknown[] = []; const nameStack: string[] = []; return (obj, name, cbOk, cbFail) => { - if (seen.has(obj) || nameStack.length > 4) { - return cbFail(seen.has(obj), nameStack); + if (seen.indexOf(obj) !== -1 || nameStack.length > 4) { + return cbFail(seen.indexOf(obj) !== -1, nameStack); } - seen.add(obj); + seen.push(obj); nameStack.push(name); const res = cbOk(); nameStack.pop(); - seen.delete(obj); + seen.pop(); return res; }; } @@ -104,8 +104,8 @@ namespace ts { key === "constructor" ? undefined : getValueInfo(key, value, recurser)); } - const ignoredProperties: ReadonlySet = new Set(["arguments", "caller", "constructor", "eval", "super_"]); - const reservedFunctionProperties: ReadonlySet = new Set(Object.getOwnPropertyNames(noop)); + const ignoredProperties: ReadonlyArray = ["arguments", "caller", "constructor", "eval", "super_"]; + const reservedFunctionProperties: ReadonlyArray = Object.getOwnPropertyNames(noop); interface ObjectEntry { readonly key: string; readonly value: unknown; } function getEntriesOfObject(obj: object): ReadonlyArray { const seen = createMap(); @@ -114,8 +114,8 @@ namespace ts { while (!isNullOrUndefined(chain) && chain !== Object.prototype && chain !== Function.prototype) { for (const key of Object.getOwnPropertyNames(chain)) { if (!isJsPrivate(key) && - !ignoredProperties.has(key) && - (typeof obj !== "function" || !reservedFunctionProperties.has(key)) && + ignoredProperties.indexOf(key) === -1 && + (typeof obj !== "function" || reservedFunctionProperties.indexOf(key) === -1) && // Don't add property from a higher prototype if it already exists in a lower one addToSeen(seen, key)) { const value = safeGetPropertyOfObject(chain, key); From f41b4e088da53f73e7f2b51bef3f8feb31b59656 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Sun, 9 Dec 2018 20:17:54 +0100 Subject: [PATCH 146/322] Change usage of Array.prototype.find to ts.find. --- src/compiler/moduleSpecifiers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index 1913ee90b2b..f5bac45f6ab 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -203,7 +203,7 @@ namespace ts.moduleSpecifiers { return; // Don't want to a package to globally import from itself } - const target = targets.find(t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo); + const target = find(targets, t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo); if (target === undefined) return; const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName); From 3d23e7a0a4fe5894f6f79fbd3e15d2956f5a1fc8 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Sun, 9 Dec 2018 20:21:45 +0100 Subject: [PATCH 147/322] Change usage of String.prototype.startsWith to ts.startsWith. --- src/compiler/inspectValue.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/inspectValue.ts b/src/compiler/inspectValue.ts index 8433ee6e489..8d0b6993c00 100644 --- a/src/compiler/inspectValue.ts +++ b/src/compiler/inspectValue.ts @@ -148,8 +148,7 @@ namespace ts { } export function isJsPrivate(name: string): boolean { - return name.startsWith("_"); - } + return startsWith(name, "_"); } function tryRequire(fileNameToRequire: string): unknown { try { From 4e43dcdc05074d9f28efa2232e328f2bc0002d85 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Sun, 9 Dec 2018 20:22:06 +0100 Subject: [PATCH 148/322] Change usages of String.prototype.endsWith to ts.endsWith. --- src/services/rename.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/services/rename.ts b/src/services/rename.ts index 7ba32c91309..1175ce847fe 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -45,8 +45,7 @@ namespace ts.Rename { const moduleSourceFile = find(moduleSymbol.declarations, isSourceFile); if (!moduleSourceFile) return undefined; - const withoutIndex = node.text.endsWith("/index") || node.text.endsWith("/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); - const name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; + const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); const name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; const kind = withoutIndex === undefined ? ScriptElementKind.moduleElement : ScriptElementKind.directory; const indexAfterLastSlash = node.text.lastIndexOf("/") + 1; // Span should only be the last component of the path. + 1 to account for the quote character. From 6a82b0a96bf7104743b7ca5cf9eb89fffa6b68f4 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Sun, 9 Dec 2018 20:42:02 +0100 Subject: [PATCH 149/322] Add newline, bad edit --- src/compiler/inspectValue.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/inspectValue.ts b/src/compiler/inspectValue.ts index 8d0b6993c00..381f47d12e9 100644 --- a/src/compiler/inspectValue.ts +++ b/src/compiler/inspectValue.ts @@ -148,7 +148,8 @@ namespace ts { } export function isJsPrivate(name: string): boolean { - return startsWith(name, "_"); } + return startsWith(name, "_"); + } function tryRequire(fileNameToRequire: string): unknown { try { From 599a963493a8bdb12e2eef7cc37151c047df8af0 Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Sun, 9 Dec 2018 20:42:46 +0100 Subject: [PATCH 150/322] Add newline --- src/services/rename.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/rename.ts b/src/services/rename.ts index 1175ce847fe..a51d79797bf 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -45,7 +45,8 @@ namespace ts.Rename { const moduleSourceFile = find(moduleSymbol.declarations, isSourceFile); if (!moduleSourceFile) return undefined; - const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); const name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; + const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? undefined : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); + const name = withoutIndex === undefined ? moduleSourceFile.fileName : withoutIndex; const kind = withoutIndex === undefined ? ScriptElementKind.moduleElement : ScriptElementKind.directory; const indexAfterLastSlash = node.text.lastIndexOf("/") + 1; // Span should only be the last component of the path. + 1 to account for the quote character. From a8964cbc60db652bcdc98c54e5f48a7084be74b6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 08:59:12 -0800 Subject: [PATCH 151/322] Type parameter with 'unknown' constraint not assignable to '{}' --- src/compiler/checker.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f76f1b318e9..8564e9e360e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12168,10 +12168,6 @@ namespace ts { return result; } - function getConstraintForRelation(type: Type) { - return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); - } - function structuredTypeRelatedTo(source: Type, target: Type, reportErrors: boolean, isIntersectionConstituent: boolean): Ternary { const flags = source.flags & target.flags; if (relation === identityRelation && !(flags & TypeFlags.Object)) { @@ -12304,24 +12300,26 @@ namespace ts { return result; } } - const constraint = getConstraintForRelation(source); - if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.AnyOrUnknown)) { - // A type variable with no constraint is not related to the non-primitive object type. - if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) { + if (relation !== definitelyAssignableRelation) { + const constraint = getConstraintOfType(source); + if (!constraint || (source.flags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { + // A type variable with no constraint is not related to the non-primitive object type. + if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) { + errorInfo = saveErrorInfo; + return result; + } + } + // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed + else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { + errorInfo = saveErrorInfo; + return result; + } + // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example + else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { errorInfo = saveErrorInfo; return result; } } - // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed - else if (result = isRelatedTo(constraint, target, /*reportErrors*/ false, /*headMessage*/ undefined, isIntersectionConstituent)) { - errorInfo = saveErrorInfo; - return result; - } - // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example - else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors, /*headMessage*/ undefined, isIntersectionConstituent)) { - errorInfo = saveErrorInfo; - return result; - } } else if (source.flags & TypeFlags.Index) { if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) { From 7a0779288f2de6d5ac000f7113976386d88821a8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 09:14:41 -0800 Subject: [PATCH 152/322] Add tests --- .../conformance/types/unknown/unknownType1.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/cases/conformance/types/unknown/unknownType1.ts b/tests/cases/conformance/types/unknown/unknownType1.ts index 3307f5c4481..d1f5ce11261 100644 --- a/tests/cases/conformance/types/unknown/unknownType1.ts +++ b/tests/cases/conformance/types/unknown/unknownType1.ts @@ -164,3 +164,20 @@ class C1 { b: unknown; c: any; } + +// Type parameter with explicit 'unknown' constraint not assignable to '{}' + +function f30(t: T, u: U) { + let x: {} = t; + let y: {} = u; +} + +// Repro from #26796 + +type Test1 = [unknown] extends [{}] ? true : false; // false +type IsDefinitelyDefined = [T] extends [{}] ? true : false; +type Test2 = IsDefinitelyDefined; // false + +function oops(arg: T): {} { + return arg; // Error +} From c8091acc5e403b321a476f5aecbdb5281b3a18e2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 09:14:50 -0800 Subject: [PATCH 153/322] Accept new baselines --- .../reference/unknownType1.errors.txt | 31 ++++++++++++- tests/baselines/reference/unknownType1.js | 25 +++++++++++ .../baselines/reference/unknownType1.symbols | 44 +++++++++++++++++++ tests/baselines/reference/unknownType1.types | 39 ++++++++++++++++ 4 files changed, 138 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/unknownType1.errors.txt b/tests/baselines/reference/unknownType1.errors.txt index 83849184dce..57fb6114069 100644 --- a/tests/baselines/reference/unknownType1.errors.txt +++ b/tests/baselines/reference/unknownType1.errors.txt @@ -17,13 +17,18 @@ tests/cases/conformance/types/unknown/unknownType1.ts(113,9): error TS2322: Type tests/cases/conformance/types/unknown/unknownType1.ts(114,9): error TS2322: Type 'unknown' is not assignable to type '{} | null | undefined'. Type 'unknown' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(120,9): error TS2322: Type 'T' is not assignable to type 'object'. + Type 'unknown' is not assignable to type 'object'. tests/cases/conformance/types/unknown/unknownType1.ts(129,5): error TS2322: Type '123' is not assignable to type '{ [x: string]: unknown; }'. tests/cases/conformance/types/unknown/unknownType1.ts(149,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/types/unknown/unknownType1.ts(155,14): error TS2700: Rest types may only be created from object types. tests/cases/conformance/types/unknown/unknownType1.ts(161,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +tests/cases/conformance/types/unknown/unknownType1.ts(170,9): error TS2322: Type 'U' is not assignable to type '{}'. + Type 'unknown' is not assignable to type '{}'. +tests/cases/conformance/types/unknown/unknownType1.ts(180,5): error TS2322: Type 'T' is not assignable to type '{}'. + Type 'unknown' is not assignable to type '{}'. -==== tests/cases/conformance/types/unknown/unknownType1.ts (22 errors) ==== +==== tests/cases/conformance/types/unknown/unknownType1.ts (24 errors) ==== // In an intersection everything absorbs unknown type T00 = unknown & null; // null @@ -181,6 +186,7 @@ tests/cases/conformance/types/unknown/unknownType1.ts(161,5): error TS2564: Prop let y: object = x; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'object'. +!!! error TS2322: Type 'unknown' is not assignable to type 'object'. } // Anything but primitive assignable to { [x: string]: unknown } @@ -233,4 +239,27 @@ tests/cases/conformance/types/unknown/unknownType1.ts(161,5): error TS2564: Prop b: unknown; c: any; } + + // Type parameter with explicit 'unknown' constraint not assignable to '{}' + + function f30(t: T, u: U) { + let x: {} = t; + let y: {} = u; + ~ +!!! error TS2322: Type 'U' is not assignable to type '{}'. +!!! error TS2322: Type 'unknown' is not assignable to type '{}'. + } + + // Repro from #26796 + + type Test1 = [unknown] extends [{}] ? true : false; // false + type IsDefinitelyDefined = [T] extends [{}] ? true : false; + type Test2 = IsDefinitelyDefined; // false + + function oops(arg: T): {} { + return arg; // Error + ~~~~~~~~~~~ +!!! error TS2322: Type 'T' is not assignable to type '{}'. +!!! error TS2322: Type 'unknown' is not assignable to type '{}'. + } \ No newline at end of file diff --git a/tests/baselines/reference/unknownType1.js b/tests/baselines/reference/unknownType1.js index 81a787b5827..9dd1568861f 100644 --- a/tests/baselines/reference/unknownType1.js +++ b/tests/baselines/reference/unknownType1.js @@ -163,6 +163,23 @@ class C1 { b: unknown; c: any; } + +// Type parameter with explicit 'unknown' constraint not assignable to '{}' + +function f30(t: T, u: U) { + let x: {} = t; + let y: {} = u; +} + +// Repro from #26796 + +type Test1 = [unknown] extends [{}] ? true : false; // false +type IsDefinitelyDefined = [T] extends [{}] ? true : false; +type Test2 = IsDefinitelyDefined; // false + +function oops(arg: T): {} { + return arg; // Error +} //// [unknownType1.js] @@ -276,3 +293,11 @@ var C1 = /** @class */ (function () { } return C1; }()); +// Type parameter with explicit 'unknown' constraint not assignable to '{}' +function f30(t, u) { + var x = t; + var y = u; +} +function oops(arg) { + return arg; // Error +} diff --git a/tests/baselines/reference/unknownType1.symbols b/tests/baselines/reference/unknownType1.symbols index bf4088c6e38..a91664fe029 100644 --- a/tests/baselines/reference/unknownType1.symbols +++ b/tests/baselines/reference/unknownType1.symbols @@ -407,3 +407,47 @@ class C1 { >c : Symbol(C1.c, Decl(unknownType1.ts, 161, 15)) } +// Type parameter with explicit 'unknown' constraint not assignable to '{}' + +function f30(t: T, u: U) { +>f30 : Symbol(f30, Decl(unknownType1.ts, 163, 1)) +>T : Symbol(T, Decl(unknownType1.ts, 167, 13)) +>U : Symbol(U, Decl(unknownType1.ts, 167, 15)) +>t : Symbol(t, Decl(unknownType1.ts, 167, 35)) +>T : Symbol(T, Decl(unknownType1.ts, 167, 13)) +>u : Symbol(u, Decl(unknownType1.ts, 167, 40)) +>U : Symbol(U, Decl(unknownType1.ts, 167, 15)) + + let x: {} = t; +>x : Symbol(x, Decl(unknownType1.ts, 168, 7)) +>t : Symbol(t, Decl(unknownType1.ts, 167, 35)) + + let y: {} = u; +>y : Symbol(y, Decl(unknownType1.ts, 169, 7)) +>u : Symbol(u, Decl(unknownType1.ts, 167, 40)) +} + +// Repro from #26796 + +type Test1 = [unknown] extends [{}] ? true : false; // false +>Test1 : Symbol(Test1, Decl(unknownType1.ts, 170, 1)) + +type IsDefinitelyDefined = [T] extends [{}] ? true : false; +>IsDefinitelyDefined : Symbol(IsDefinitelyDefined, Decl(unknownType1.ts, 174, 51)) +>T : Symbol(T, Decl(unknownType1.ts, 175, 25)) +>T : Symbol(T, Decl(unknownType1.ts, 175, 25)) + +type Test2 = IsDefinitelyDefined; // false +>Test2 : Symbol(Test2, Decl(unknownType1.ts, 175, 78)) +>IsDefinitelyDefined : Symbol(IsDefinitelyDefined, Decl(unknownType1.ts, 174, 51)) + +function oops(arg: T): {} { +>oops : Symbol(oops, Decl(unknownType1.ts, 176, 42)) +>T : Symbol(T, Decl(unknownType1.ts, 178, 14)) +>arg : Symbol(arg, Decl(unknownType1.ts, 178, 33)) +>T : Symbol(T, Decl(unknownType1.ts, 178, 14)) + + return arg; // Error +>arg : Symbol(arg, Decl(unknownType1.ts, 178, 33)) +} + diff --git a/tests/baselines/reference/unknownType1.types b/tests/baselines/reference/unknownType1.types index bf177d4fde8..bd3408a914d 100644 --- a/tests/baselines/reference/unknownType1.types +++ b/tests/baselines/reference/unknownType1.types @@ -453,3 +453,42 @@ class C1 { >c : any } +// Type parameter with explicit 'unknown' constraint not assignable to '{}' + +function f30(t: T, u: U) { +>f30 : (t: T, u: U) => void +>t : T +>u : U + + let x: {} = t; +>x : {} +>t : T + + let y: {} = u; +>y : {} +>u : U +} + +// Repro from #26796 + +type Test1 = [unknown] extends [{}] ? true : false; // false +>Test1 : false +>true : true +>false : false + +type IsDefinitelyDefined = [T] extends [{}] ? true : false; +>IsDefinitelyDefined : IsDefinitelyDefined +>true : true +>false : false + +type Test2 = IsDefinitelyDefined; // false +>Test2 : false + +function oops(arg: T): {} { +>oops : (arg: T) => {} +>arg : T + + return arg; // Error +>arg : T +} + From d2cc2821346d919485d7d1157c5524498f00c4bb Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 09:45:55 -0800 Subject: [PATCH 154/322] Add tests --- .../conformance/functions/strictBindCallApply1.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/cases/conformance/functions/strictBindCallApply1.ts b/tests/cases/conformance/functions/strictBindCallApply1.ts index 5a94d4b5416..4194c41ec24 100644 --- a/tests/cases/conformance/functions/strictBindCallApply1.ts +++ b/tests/cases/conformance/functions/strictBindCallApply1.ts @@ -2,11 +2,19 @@ declare function foo(a: number, b: string): string; +declare function overloaded(s: string): number; +declare function overloaded(n: number): string; + +declare function generic(x: T): T; + let f00 = foo.bind(undefined); let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error +let f04 = overloaded.bind(undefined); // typeof overloaded +let f05 = generic.bind(undefined); // typeof generic + let c00 = foo.call(undefined, 10, "hello"); let c01 = foo.call(undefined, 10); // Error let c02 = foo.call(undefined, 10, 20); // Error @@ -20,6 +28,10 @@ let a03 = foo.apply(undefined, [10, "hello", 30]); // Error class C { constructor(a: number, b: string) {} foo(this: this, a: number, b: string): string { return "" } + overloaded(s: string): number; + overloaded(n: number): string; + overloaded(x: any): any { return undefined } + generic(x: T): T { return x } } declare let c: C; @@ -31,6 +43,9 @@ let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error let f14 = c.foo.bind(undefined); // Error +let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded +let f16 = c.generic.bind(c); // typeof C.prototype.generic + let c10 = c.foo.call(c, 10, "hello"); let c11 = c.foo.call(c, 10); // Error let c12 = c.foo.call(c, 10, 20); // Error From 4d67c8f873b52809dff10b71444dde4b827698b6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 09:46:03 -0800 Subject: [PATCH 155/322] Accept new baselines --- .../reference/strictBindCallApply1.errors.txt | 63 ++-- .../reference/strictBindCallApply1.js | 21 ++ .../reference/strictBindCallApply1.symbols | 304 +++++++++++------- .../reference/strictBindCallApply1.types | 67 ++++ 4 files changed, 313 insertions(+), 142 deletions(-) diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index e8f48e5597c..0931a837bac 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,35 +1,40 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(6,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(9,11): error TS2554: Expected 3 arguments, but got 2. -tests/cases/conformance/functions/strictBindCallApply1.ts(10,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2554: Expected 3 arguments, but got 4. -tests/cases/conformance/functions/strictBindCallApply1.ts(14,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(17,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(19,11): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. Property '1' is missing in type '[number]' but required in type '[number, string]'. -tests/cases/conformance/functions/strictBindCallApply1.ts(15,37): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(16,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/conformance/functions/strictBindCallApply1.ts(29,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(30,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(33,11): error TS2554: Expected 3 arguments, but got 2. -tests/cases/conformance/functions/strictBindCallApply1.ts(34,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(35,11): error TS2554: Expected 3 arguments, but got 4. -tests/cases/conformance/functions/strictBindCallApply1.ts(36,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(39,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. -tests/cases/conformance/functions/strictBindCallApply1.ts(40,31): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(47,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(50,1): error TS2554: Expected 3 arguments, but got 2. -tests/cases/conformance/functions/strictBindCallApply1.ts(51,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(52,1): error TS2554: Expected 3 arguments, but got 4. -tests/cases/conformance/functions/strictBindCallApply1.ts(55,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. -tests/cases/conformance/functions/strictBindCallApply1.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(48,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(50,11): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(51,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(54,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(65,1): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(67,1): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. ==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ==== declare function foo(a: number, b: string): string; + declare function overloaded(s: string): number; + declare function overloaded(n: number): string; + + declare function generic(x: T): T; + let f00 = foo.bind(undefined); let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); @@ -37,6 +42,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: ~~ !!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + let f04 = overloaded.bind(undefined); // typeof overloaded + let f05 = generic.bind(undefined); // typeof generic + let c00 = foo.call(undefined, 10, "hello"); let c01 = foo.call(undefined, 10); // Error ~~~~~~~~~~~~~~~~~~~~~~~ @@ -65,6 +73,10 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: class C { constructor(a: number, b: string) {} foo(this: this, a: number, b: string): string { return "" } + overloaded(s: string): number; + overloaded(n: number): string; + overloaded(x: any): any { return undefined } + generic(x: T): T { return x } } declare let c: C; @@ -80,6 +92,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: ~~~~~~~~~ !!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded + let f16 = c.generic.bind(c); // typeof C.prototype.generic + let c10 = c.foo.call(c, 10, "hello"); let c11 = c.foo.call(c, 10); // Error ~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/strictBindCallApply1.js b/tests/baselines/reference/strictBindCallApply1.js index e43c84edbf1..fc90729a8d6 100644 --- a/tests/baselines/reference/strictBindCallApply1.js +++ b/tests/baselines/reference/strictBindCallApply1.js @@ -1,11 +1,19 @@ //// [strictBindCallApply1.ts] declare function foo(a: number, b: string): string; +declare function overloaded(s: string): number; +declare function overloaded(n: number): string; + +declare function generic(x: T): T; + let f00 = foo.bind(undefined); let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error +let f04 = overloaded.bind(undefined); // typeof overloaded +let f05 = generic.bind(undefined); // typeof generic + let c00 = foo.call(undefined, 10, "hello"); let c01 = foo.call(undefined, 10); // Error let c02 = foo.call(undefined, 10, 20); // Error @@ -19,6 +27,10 @@ let a03 = foo.apply(undefined, [10, "hello", 30]); // Error class C { constructor(a: number, b: string) {} foo(this: this, a: number, b: string): string { return "" } + overloaded(s: string): number; + overloaded(n: number): string; + overloaded(x: any): any { return undefined } + generic(x: T): T { return x } } declare let c: C; @@ -30,6 +42,9 @@ let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error let f14 = c.foo.bind(undefined); // Error +let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded +let f16 = c.generic.bind(c); // typeof C.prototype.generic + let c10 = c.foo.call(c, 10, "hello"); let c11 = c.foo.call(c, 10); // Error let c12 = c.foo.call(c, 10, 20); // Error @@ -64,6 +79,8 @@ var f00 = foo.bind(undefined); var f01 = foo.bind(undefined, 10); var f02 = foo.bind(undefined, 10, "hello"); var f03 = foo.bind(undefined, 10, 20); // Error +var f04 = overloaded.bind(undefined); // typeof overloaded +var f05 = generic.bind(undefined); // typeof generic var c00 = foo.call(undefined, 10, "hello"); var c01 = foo.call(undefined, 10); // Error var c02 = foo.call(undefined, 10, 20); // Error @@ -76,6 +93,8 @@ var C = /** @class */ (function () { function C(a, b) { } C.prototype.foo = function (a, b) { return ""; }; + C.prototype.overloaded = function (x) { return undefined; }; + C.prototype.generic = function (x) { return x; }; return C; }()); var f10 = c.foo.bind(c); @@ -83,6 +102,8 @@ var f11 = c.foo.bind(c, 10); var f12 = c.foo.bind(c, 10, "hello"); var f13 = c.foo.bind(c, 10, 20); // Error var f14 = c.foo.bind(undefined); // Error +var f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded +var f16 = c.generic.bind(c); // typeof C.prototype.generic var c10 = c.foo.call(c, 10, "hello"); var c11 = c.foo.call(c, 10); // Error var c12 = c.foo.call(c, 10, 20); // Error diff --git a/tests/baselines/reference/strictBindCallApply1.symbols b/tests/baselines/reference/strictBindCallApply1.symbols index b8133a65a78..705df6da699 100644 --- a/tests/baselines/reference/strictBindCallApply1.symbols +++ b/tests/baselines/reference/strictBindCallApply1.symbols @@ -4,319 +4,387 @@ declare function foo(a: number, b: string): string; >a : Symbol(a, Decl(strictBindCallApply1.ts, 0, 21)) >b : Symbol(b, Decl(strictBindCallApply1.ts, 0, 31)) +declare function overloaded(s: string): number; +>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47)) +>s : Symbol(s, Decl(strictBindCallApply1.ts, 2, 28)) + +declare function overloaded(n: number): string; +>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47)) +>n : Symbol(n, Decl(strictBindCallApply1.ts, 3, 28)) + +declare function generic(x: T): T; +>generic : Symbol(generic, Decl(strictBindCallApply1.ts, 3, 47)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25)) +>x : Symbol(x, Decl(strictBindCallApply1.ts, 5, 28)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 5, 25)) + let f00 = foo.bind(undefined); ->f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 2, 3)) +>f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 7, 3)) >foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f01 = foo.bind(undefined, 10); ->f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 3, 3)) +>f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 8, 3)) >foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f02 = foo.bind(undefined, 10, "hello"); ->f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 4, 3)) +>f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 9, 3)) >foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f03 = foo.bind(undefined, 10, 20); // Error ->f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 5, 3)) +>f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 10, 3)) >foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) +let f04 = overloaded.bind(undefined); // typeof overloaded +>f04 : Symbol(f04, Decl(strictBindCallApply1.ts, 12, 3)) +>overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>undefined : Symbol(undefined) + +let f05 = generic.bind(undefined); // typeof generic +>f05 : Symbol(f05, Decl(strictBindCallApply1.ts, 13, 3)) +>generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>generic : Symbol(generic, Decl(strictBindCallApply1.ts, 3, 47)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>undefined : Symbol(undefined) + let c00 = foo.call(undefined, 10, "hello"); ->c00 : Symbol(c00, Decl(strictBindCallApply1.ts, 7, 3)) +>c00 : Symbol(c00, Decl(strictBindCallApply1.ts, 15, 3)) >foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let c01 = foo.call(undefined, 10); // Error ->c01 : Symbol(c01, Decl(strictBindCallApply1.ts, 8, 3)) +>c01 : Symbol(c01, Decl(strictBindCallApply1.ts, 16, 3)) >foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let c02 = foo.call(undefined, 10, 20); // Error ->c02 : Symbol(c02, Decl(strictBindCallApply1.ts, 9, 3)) +>c02 : Symbol(c02, Decl(strictBindCallApply1.ts, 17, 3)) >foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let c03 = foo.call(undefined, 10, "hello", 30); // Error ->c03 : Symbol(c03, Decl(strictBindCallApply1.ts, 10, 3)) +>c03 : Symbol(c03, Decl(strictBindCallApply1.ts, 18, 3)) >foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let a00 = foo.apply(undefined, [10, "hello"]); ->a00 : Symbol(a00, Decl(strictBindCallApply1.ts, 12, 3)) +>a00 : Symbol(a00, Decl(strictBindCallApply1.ts, 20, 3)) >foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let a01 = foo.apply(undefined, [10]); // Error ->a01 : Symbol(a01, Decl(strictBindCallApply1.ts, 13, 3)) +>a01 : Symbol(a01, Decl(strictBindCallApply1.ts, 21, 3)) >foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let a02 = foo.apply(undefined, [10, 20]); // Error ->a02 : Symbol(a02, Decl(strictBindCallApply1.ts, 14, 3)) +>a02 : Symbol(a02, Decl(strictBindCallApply1.ts, 22, 3)) >foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let a03 = foo.apply(undefined, [10, "hello", 30]); // Error ->a03 : Symbol(a03, Decl(strictBindCallApply1.ts, 15, 3)) +>a03 : Symbol(a03, Decl(strictBindCallApply1.ts, 23, 3)) >foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) class C { ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) constructor(a: number, b: string) {} ->a : Symbol(a, Decl(strictBindCallApply1.ts, 18, 16)) ->b : Symbol(b, Decl(strictBindCallApply1.ts, 18, 26)) +>a : Symbol(a, Decl(strictBindCallApply1.ts, 26, 16)) +>b : Symbol(b, Decl(strictBindCallApply1.ts, 26, 26)) foo(this: this, a: number, b: string): string { return "" } ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->this : Symbol(this, Decl(strictBindCallApply1.ts, 19, 8)) ->a : Symbol(a, Decl(strictBindCallApply1.ts, 19, 19)) ->b : Symbol(b, Decl(strictBindCallApply1.ts, 19, 30)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>this : Symbol(this, Decl(strictBindCallApply1.ts, 27, 8)) +>a : Symbol(a, Decl(strictBindCallApply1.ts, 27, 19)) +>b : Symbol(b, Decl(strictBindCallApply1.ts, 27, 30)) + + overloaded(s: string): number; +>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) +>s : Symbol(s, Decl(strictBindCallApply1.ts, 28, 15)) + + overloaded(n: number): string; +>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) +>n : Symbol(n, Decl(strictBindCallApply1.ts, 29, 15)) + + overloaded(x: any): any { return undefined } +>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) +>x : Symbol(x, Decl(strictBindCallApply1.ts, 30, 15)) +>undefined : Symbol(undefined) + + generic(x: T): T { return x } +>generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12)) +>x : Symbol(x, Decl(strictBindCallApply1.ts, 31, 15)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12)) +>T : Symbol(T, Decl(strictBindCallApply1.ts, 31, 12)) +>x : Symbol(x, Decl(strictBindCallApply1.ts, 31, 15)) } declare let c: C; ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) declare let obj: {}; ->obj : Symbol(obj, Decl(strictBindCallApply1.ts, 23, 11)) +>obj : Symbol(obj, Decl(strictBindCallApply1.ts, 35, 11)) let f10 = c.foo.bind(c); ->f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 25, 3)) +>f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 37, 3)) >c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f11 = c.foo.bind(c, 10); ->f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 26, 3)) +>f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 38, 3)) >c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f12 = c.foo.bind(c, 10, "hello"); ->f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 27, 3)) +>f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 39, 3)) >c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f13 = c.foo.bind(c, 10, 20); // Error ->f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 28, 3)) +>f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 40, 3)) >c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f14 = c.foo.bind(undefined); // Error ->f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 29, 3)) +>f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 41, 3)) >c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) +let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded +>f15 : Symbol(f15, Decl(strictBindCallApply1.ts, 43, 3)) +>c.overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) + +let f16 = c.generic.bind(c); // typeof C.prototype.generic +>f16 : Symbol(f16, Decl(strictBindCallApply1.ts, 44, 3)) +>c.generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) + let c10 = c.foo.call(c, 10, "hello"); ->c10 : Symbol(c10, Decl(strictBindCallApply1.ts, 31, 3)) +>c10 : Symbol(c10, Decl(strictBindCallApply1.ts, 46, 3)) >c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let c11 = c.foo.call(c, 10); // Error ->c11 : Symbol(c11, Decl(strictBindCallApply1.ts, 32, 3)) +>c11 : Symbol(c11, Decl(strictBindCallApply1.ts, 47, 3)) >c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let c12 = c.foo.call(c, 10, 20); // Error ->c12 : Symbol(c12, Decl(strictBindCallApply1.ts, 33, 3)) +>c12 : Symbol(c12, Decl(strictBindCallApply1.ts, 48, 3)) >c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let c13 = c.foo.call(c, 10, "hello", 30); // Error ->c13 : Symbol(c13, Decl(strictBindCallApply1.ts, 34, 3)) +>c13 : Symbol(c13, Decl(strictBindCallApply1.ts, 49, 3)) >c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let c14 = c.foo.call(undefined, 10, "hello"); // Error ->c14 : Symbol(c14, Decl(strictBindCallApply1.ts, 35, 3)) +>c14 : Symbol(c14, Decl(strictBindCallApply1.ts, 50, 3)) >c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let a10 = c.foo.apply(c, [10, "hello"]); ->a10 : Symbol(a10, Decl(strictBindCallApply1.ts, 37, 3)) +>a10 : Symbol(a10, Decl(strictBindCallApply1.ts, 52, 3)) >c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let a11 = c.foo.apply(c, [10]); // Error ->a11 : Symbol(a11, Decl(strictBindCallApply1.ts, 38, 3)) +>a11 : Symbol(a11, Decl(strictBindCallApply1.ts, 53, 3)) >c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let a12 = c.foo.apply(c, [10, 20]); // Error ->a12 : Symbol(a12, Decl(strictBindCallApply1.ts, 39, 3)) +>a12 : Symbol(a12, Decl(strictBindCallApply1.ts, 54, 3)) >c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let a13 = c.foo.apply(c, [10, "hello", 30]); // Error ->a13 : Symbol(a13, Decl(strictBindCallApply1.ts, 40, 3)) +>a13 : Symbol(a13, Decl(strictBindCallApply1.ts, 55, 3)) >c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let a14 = c.foo.apply(undefined, [10, "hello"]); // Error ->a14 : Symbol(a14, Decl(strictBindCallApply1.ts, 41, 3)) +>a14 : Symbol(a14, Decl(strictBindCallApply1.ts, 56, 3)) >c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) ->foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f20 = C.bind(undefined); ->f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 43, 3)) +>f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 58, 3)) >C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f21 = C.bind(undefined, 10); ->f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 44, 3)) +>f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 59, 3)) >C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f22 = C.bind(undefined, 10, "hello"); ->f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 45, 3)) +>f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 60, 3)) >C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f23 = C.bind(undefined, 10, 20); // Error ->f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 46, 3)) +>f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 61, 3)) >C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) C.call(c, 10, "hello"); >C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.call(c, 10); // Error >C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.call(c, 10, 20); // Error >C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.call(c, 10, "hello", 30); // Error >C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.apply(c, [10, "hello"]); >C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.apply(c, [10]); // Error >C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.apply(c, [10, 20]); // Error >C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) C.apply(c, [10, "hello", 30]); // Error >C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) >apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types index eb859d722d8..7237c1d3142 100644 --- a/tests/baselines/reference/strictBindCallApply1.types +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -4,6 +4,18 @@ declare function foo(a: number, b: string): string; >a : number >b : string +declare function overloaded(s: string): number; +>overloaded : { (s: string): number; (n: number): string; } +>s : string + +declare function overloaded(n: number): string; +>overloaded : { (s: string): number; (n: number): string; } +>n : number + +declare function generic(x: T): T; +>generic : (x: T) => T +>x : T + let f00 = foo.bind(undefined); >f00 : (a: number, b: string) => string >foo.bind(undefined) : (a: number, b: string) => string @@ -41,6 +53,22 @@ let f03 = foo.bind(undefined, 10, 20); // Error >10 : 10 >20 : 20 +let f04 = overloaded.bind(undefined); // typeof overloaded +>f04 : { (s: string): number; (n: number): string; } +>overloaded.bind(undefined) : { (s: string): number; (n: number): string; } +>overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>overloaded : { (s: string): number; (n: number): string; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>undefined : undefined + +let f05 = generic.bind(undefined); // typeof generic +>f05 : (x: T) => T +>generic.bind(undefined) : (x: T) => T +>generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>generic : (x: T) => T +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>undefined : undefined + let c00 = foo.call(undefined, 10, "hello"); >c00 : string >foo.call(undefined, 10, "hello") : string @@ -138,6 +166,25 @@ class C { >a : number >b : string >"" : "" + + overloaded(s: string): number; +>overloaded : { (s: string): number; (n: number): string; } +>s : string + + overloaded(n: number): string; +>overloaded : { (s: string): number; (n: number): string; } +>n : number + + overloaded(x: any): any { return undefined } +>overloaded : { (s: string): number; (n: number): string; } +>x : any +>undefined : any +>undefined : undefined + + generic(x: T): T { return x } +>generic : (x: T) => T +>x : T +>x : T } declare let c: C; @@ -201,6 +248,26 @@ let f14 = c.foo.bind(undefined); // Error >bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined +let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded +>f15 : { (s: string): number; (n: number): string; } +>c.overloaded.bind(c) : { (s: string): number; (n: number): string; } +>c.overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.overloaded : { (s: string): number; (n: number): string; } +>c : C +>overloaded : { (s: string): number; (n: number): string; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c : C + +let f16 = c.generic.bind(c); // typeof C.prototype.generic +>f16 : (x: T) => T +>c.generic.bind(c) : (x: T) => T +>c.generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.generic : (x: T) => T +>c : C +>generic : (x: T) => T +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c : C + let c10 = c.foo.call(c, 10, "hello"); >c10 : string >c.foo.call(c, 10, "hello") : string From b980e19df2f1622cd8bb0e69f618ff38c3e318b3 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 10 Dec 2018 09:47:48 -0800 Subject: [PATCH 156/322] Update user baselines (#28941) --- tests/baselines/reference/user/antd.log | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/baselines/reference/user/antd.log diff --git a/tests/baselines/reference/user/antd.log b/tests/baselines/reference/user/antd.log deleted file mode 100644 index f0d7570b578..00000000000 --- a/tests/baselines/reference/user/antd.log +++ /dev/null @@ -1,7 +0,0 @@ -Exit Code: 1 -Standard output: -node_modules/antd/lib/input/TextArea.d.ts(20,21): error TS2304: Cannot find name 'ResizeObserver'. - - - -Standard error: From d1cafe775151f5e6a63b4ff4f4985680e5ac925d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 10 Dec 2018 14:19:53 -0800 Subject: [PATCH 157/322] Always generate lowercase locale names so 'LKG's produce identical results on case-sensitive file systems. --- Gulpfile.js | 3 ++- Jakefile.js | 15 --------------- scripts/generateLocalizedDiagnosticMessages.ts | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 867f35d4ff7..df8a832426d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -117,7 +117,8 @@ const generatedLCGFile = "built/local/enu/diagnosticMessages.generated.json.lcg" * 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg' * generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json */ -const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"] +const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"] + .map(f => f.toLowerCase()) .map(f => `built/local/${f}/diagnosticMessages.generated.json`) .concat(generatedLCGFile); diff --git a/Jakefile.js b/Jakefile.js index 68cfbf7eef6..1413230c079 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -24,8 +24,6 @@ else if (process.env.PATH !== undefined) { const host = process.env.TYPESCRIPT_HOST || process.env.host || "node"; -const locales = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"]; - const defaultTestTimeout = 40000; let useDebugMode = true; @@ -709,19 +707,6 @@ const Travis = { } }; -function buildLocalizedTargets() { - /** - * The localization target produces the two following transformations: - * 1. 'src\loc\lcl\\diagnosticMessages.generated.json.lcl' => 'built\local\\diagnosticMessages.generated.json' - * convert localized resources into a .json file the compiler can understand - * 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg' - * generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json - */ - const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"] - .map(f => path.join(Paths.builtLocal,f)) - .concat(path.dirname(Paths.generatedLCGFile)); -} - function toNs(diff) { return diff[0] * 1e9 + diff[1]; } diff --git a/scripts/generateLocalizedDiagnosticMessages.ts b/scripts/generateLocalizedDiagnosticMessages.ts index 09d117d533b..a9183c8ddbe 100644 --- a/scripts/generateLocalizedDiagnosticMessages.ts +++ b/scripts/generateLocalizedDiagnosticMessages.ts @@ -36,7 +36,7 @@ function main(): void { console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul."); process.exit(1); } - const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul); + const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul).toLowerCase(); if (!outputDirectoryName) { console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`); process.exit(1); From 9479353d5c41575e2fbedfa99f15c4156bf00744 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 16:30:21 -0800 Subject: [PATCH 158/322] Fix handling of index signatures in discriminated unions --- src/compiler/checker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c17893cebe8..2eeea77e492 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4715,6 +4715,10 @@ namespace ts { return prop ? getTypeOfSymbol(prop) : undefined; } + function getTypeOfPropertyOrIndexSignature(type: Type, name: __String): Type { + return getTypeOfPropertyOfType(type, name) || isNumericLiteralName(name) && getIndexTypeOfType(type, IndexKind.Number) || getIndexTypeOfType(type, IndexKind.String) || unknownType; + } + function isTypeAny(type: Type | undefined) { return type && (type.flags & TypeFlags.Any) !== 0; } @@ -15657,7 +15661,7 @@ namespace ts { } const propType = getTypeOfPropertyOfType(type, propName); const narrowedPropType = propType && narrowType(propType); - return propType === narrowedPropType ? type : filterType(type, t => isTypeComparableTo(getTypeOfPropertyOfType(t, propName)!, narrowedPropType!)); + return propType === narrowedPropType ? type : filterType(type, t => isTypeComparableTo(getTypeOfPropertyOrIndexSignature(t, propName), narrowedPropType!)); } function narrowTypeByTruthiness(type: Type, expr: Expression, assumeTrue: boolean): Type { From 45411e525c91eb5b8faf79c5a253e906e5a94c66 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 16:30:30 -0800 Subject: [PATCH 159/322] Add tests --- .../types/union/discriminatedUnionTypes2.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/cases/conformance/types/union/discriminatedUnionTypes2.ts b/tests/cases/conformance/types/union/discriminatedUnionTypes2.ts index 789bc263c7e..a11e1447780 100644 --- a/tests/cases/conformance/types/union/discriminatedUnionTypes2.ts +++ b/tests/cases/conformance/types/union/discriminatedUnionTypes2.ts @@ -72,3 +72,25 @@ function f20(carrier: DataCarrier) { const data: null = carrier.data } } + +// Repro from #28935 + +type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; + +function f30(foo: Foo) { + if (foo.tag) { + foo; + } + else { + foo; + } +} + +function f31(foo: Foo) { + if (foo.tag === true) { + foo; + } + else { + foo; + } +} From aa9db9a8fda633ea108ce6923fb9135f8d575b6a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Dec 2018 16:30:50 -0800 Subject: [PATCH 160/322] Accept new baselines --- .../discriminatedUnionTypes2.errors.txt | 22 ++++++++ .../reference/discriminatedUnionTypes2.js | 38 ++++++++++++++ .../discriminatedUnionTypes2.symbols | 48 ++++++++++++++++++ .../reference/discriminatedUnionTypes2.types | 50 +++++++++++++++++++ 4 files changed, 158 insertions(+) diff --git a/tests/baselines/reference/discriminatedUnionTypes2.errors.txt b/tests/baselines/reference/discriminatedUnionTypes2.errors.txt index c50f7a2767a..15ed6968aea 100644 --- a/tests/baselines/reference/discriminatedUnionTypes2.errors.txt +++ b/tests/baselines/reference/discriminatedUnionTypes2.errors.txt @@ -83,4 +83,26 @@ tests/cases/conformance/types/union/discriminatedUnionTypes2.ts(32,11): error TS const data: null = carrier.data } } + + // Repro from #28935 + + type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; + + function f30(foo: Foo) { + if (foo.tag) { + foo; + } + else { + foo; + } + } + + function f31(foo: Foo) { + if (foo.tag === true) { + foo; + } + else { + foo; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/discriminatedUnionTypes2.js b/tests/baselines/reference/discriminatedUnionTypes2.js index e2b5d99ddcd..ec5b2a6b5f1 100644 --- a/tests/baselines/reference/discriminatedUnionTypes2.js +++ b/tests/baselines/reference/discriminatedUnionTypes2.js @@ -71,6 +71,28 @@ function f20(carrier: DataCarrier) { const data: null = carrier.data } } + +// Repro from #28935 + +type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; + +function f30(foo: Foo) { + if (foo.tag) { + foo; + } + else { + foo; + } +} + +function f31(foo: Foo) { + if (foo.tag === true) { + foo; + } + else { + foo; + } +} //// [discriminatedUnionTypes2.js] @@ -126,3 +148,19 @@ function f20(carrier) { var data = carrier.data; } } +function f30(foo) { + if (foo.tag) { + foo; + } + else { + foo; + } +} +function f31(foo) { + if (foo.tag === true) { + foo; + } + else { + foo; + } +} diff --git a/tests/baselines/reference/discriminatedUnionTypes2.symbols b/tests/baselines/reference/discriminatedUnionTypes2.symbols index 38cfcb0b23a..682c62b9be5 100644 --- a/tests/baselines/reference/discriminatedUnionTypes2.symbols +++ b/tests/baselines/reference/discriminatedUnionTypes2.symbols @@ -225,3 +225,51 @@ function f20(carrier: DataCarrier) { } } +// Repro from #28935 + +type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; +>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1)) +>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12)) +>x : Symbol(x, Decl(discriminatedUnionTypes2.ts, 75, 23)) +>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 39)) +>y : Symbol(y, Decl(discriminatedUnionTypes2.ts, 75, 51)) +>x : Symbol(x, Decl(discriminatedUnionTypes2.ts, 75, 69)) + +function f30(foo: Foo) { +>f30 : Symbol(f30, Decl(discriminatedUnionTypes2.ts, 75, 90)) +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13)) +>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1)) + + if (foo.tag) { +>foo.tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39)) +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13)) +>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39)) + + foo; +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13)) + } + else { + foo; +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 77, 13)) + } +} + +function f31(foo: Foo) { +>f31 : Symbol(f31, Decl(discriminatedUnionTypes2.ts, 84, 1)) +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13)) +>Foo : Symbol(Foo, Decl(discriminatedUnionTypes2.ts, 71, 1)) + + if (foo.tag === true) { +>foo.tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39)) +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13)) +>tag : Symbol(tag, Decl(discriminatedUnionTypes2.ts, 75, 12), Decl(discriminatedUnionTypes2.ts, 75, 39)) + + foo; +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13)) + } + else { + foo; +>foo : Symbol(foo, Decl(discriminatedUnionTypes2.ts, 86, 13)) + } +} + diff --git a/tests/baselines/reference/discriminatedUnionTypes2.types b/tests/baselines/reference/discriminatedUnionTypes2.types index b654fc1a78d..58819d0d349 100644 --- a/tests/baselines/reference/discriminatedUnionTypes2.types +++ b/tests/baselines/reference/discriminatedUnionTypes2.types @@ -239,3 +239,53 @@ function f20(carrier: DataCarrier) { } } +// Repro from #28935 + +type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; +>Foo : Foo +>tag : true +>true : true +>x : number +>tag : false +>false : false +>y : number +>x : string + +function f30(foo: Foo) { +>f30 : (foo: Foo) => void +>foo : Foo + + if (foo.tag) { +>foo.tag : string | boolean +>foo : Foo +>tag : string | boolean + + foo; +>foo : { tag: true; x: number; } | { [x: string]: string; } + } + else { + foo; +>foo : { tag: false; y: number; } | { [x: string]: string; } + } +} + +function f31(foo: Foo) { +>f31 : (foo: Foo) => void +>foo : Foo + + if (foo.tag === true) { +>foo.tag === true : boolean +>foo.tag : string | boolean +>foo : Foo +>tag : string | boolean +>true : true + + foo; +>foo : { tag: true; x: number; } + } + else { + foo; +>foo : { tag: false; y: number; } | { [x: string]: string; } + } +} + From cc477ee891270e2a3af820e2cc6889ddc65c63af Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 10 Dec 2018 17:16:23 -0800 Subject: [PATCH 161/322] Only use 'es2015.iterable' to avoid accidental es2015 feature usage. --- src/tsconfig-base.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index e9925f3a98b..4d83436a538 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -1,7 +1,7 @@ { "compilerOptions": { "pretty": true, - "lib": ["es2015"], + "lib": ["es2015.iterable", "es5"], "target": "es5", "rootDir": ".", From 28c3663e6218c61929d74dda1cdd8bcf042a3f6a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 10 Dec 2018 17:45:51 -0800 Subject: [PATCH 162/322] Don't use 'fill' in 'fill'. --- src/compiler/core.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f585ce2ec96..322355117ec 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2165,6 +2165,10 @@ namespace ts { } export function fill(length: number, cb: (index: number) => T): T[] { - return new Array(length).fill(0).map((_, i) => cb(i)); + const result = Array(length); + for (let i = 0; i < length; i++) { + result[i] = cb(i); + } + return result; } } From 2e9be8c05bf4cac83e5cc7a90c03440d07c48d48 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 10 Dec 2018 21:39:17 -0800 Subject: [PATCH 163/322] Added more tests, including some in 'removeComments' mode. --- ...ericLiteralsWithTrailingDecimalPoints01.ts | 26 ++++++++++--- ...ericLiteralsWithTrailingDecimalPoints02.ts | 37 +++++++++++++++++++ 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts diff --git a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts index 4e8e3529f3a..de45315d8ef 100644 --- a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts +++ b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts @@ -4,16 +4,32 @@ 1.toString(); 1.+2.0 + 3. ; -// Preserve whitespace where important for JS compatibility +// Preserve whitespace and comments where important for JS compatibility var i: number = 1; -var test1 = i.toString(); +var test1 = i.toString(); var test2 = 2.toString(); var test3 = 3 .toString(); var test4 = 3 .toString(); -var test5 = 3 .toString(); +var test5 = 3 .toString(); var test6 = 3.['toString'](); var test7 = 3 .toString(); var test8 = new Number(4).toString(); -var test9 = 3. + 3. -var test10 = 0 /* any comment */.toString(); +var test9 = 3. + 3.; +var test10 = 0 /* comment */.toString(); +var test11 = 3. /* comment */ .toString(); +var test12 = 3 + /* comment */ .toString(); +var test13 = 3. + /* comment */ .toString(); +var test14 = 3 + // comment + .toString(); +var test15 = 3. + // comment + .toString(); +var test16 = 3 // comment time + .toString(); +var test17 = 3. // comment time again + .toString(); + diff --git a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts new file mode 100644 index 00000000000..775175f70c0 --- /dev/null +++ b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts @@ -0,0 +1,37 @@ +// @lib: es5 +// @removeComments: true + +1..toString(); +1.0.toString(); +1.toString(); +1.+2.0 + 3. ; + +// Preserve whitespace where important for JS compatibility +var i: number = 1; +var test1 = i.toString(); +var test2 = 2.toString(); +var test3 = 3 .toString(); +var test4 = 3 .toString(); +var test5 = 3 .toString(); +var test6 = 3.['toString'](); +var test7 = 3 +.toString(); +var test8 = new Number(4).toString(); +var test9 = 3. + 3.; +var test10 = 0 /* comment */.toString(); +var test11 = 3. /* comment */ .toString(); +var test12 = 3 + /* comment */ .toString(); +var test13 = 3. + /* comment */ .toString(); +var test14 = 3 + // comment + .toString(); +var test15 = 3. + // comment + .toString(); +var test16 = 3 // comment time + .toString(); +var test17 = 3. // comment time again + .toString(); + From 9a6d2ee664b1bf2f79035cf007c24d8d6be02309 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 10 Dec 2018 22:17:09 -0800 Subject: [PATCH 164/322] Accepted baselines. --- ...ralsWithTrailingDecimalPoints01.errors.txt | 26 ++- ...ericLiteralsWithTrailingDecimalPoints01.js | 45 ++++- ...iteralsWithTrailingDecimalPoints01.symbols | 62 ++++++- ...cLiteralsWithTrailingDecimalPoints01.types | 78 +++++++- ...ralsWithTrailingDecimalPoints02.errors.txt | 50 ++++++ ...ericLiteralsWithTrailingDecimalPoints02.js | 69 ++++++++ ...iteralsWithTrailingDecimalPoints02.symbols | 118 +++++++++++++ ...cLiteralsWithTrailingDecimalPoints02.types | 167 ++++++++++++++++++ 8 files changed, 590 insertions(+), 25 deletions(-) create mode 100644 tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt create mode 100644 tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.js create mode 100644 tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.symbols create mode 100644 tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.types diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt index c1484b2da66..d89255a9568 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.errors.txt @@ -12,9 +12,9 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error !!! error TS1005: ';' expected. 1.+2.0 + 3. ; - // Preserve whitespace where important for JS compatibility + // Preserve whitespace and comments where important for JS compatibility var i: number = 1; - var test1 = i.toString(); + var test1 = i.toString(); var test2 = 2.toString(); ~~~~~~~~ !!! error TS1005: ',' expected. @@ -24,11 +24,27 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts(9,24): error !!! error TS1109: Expression expected. var test3 = 3 .toString(); var test4 = 3 .toString(); - var test5 = 3 .toString(); + var test5 = 3 .toString(); var test6 = 3.['toString'](); var test7 = 3 .toString(); var test8 = new Number(4).toString(); - var test9 = 3. + 3. - var test10 = 0 /* any comment */.toString(); + var test9 = 3. + 3.; + var test10 = 0 /* comment */.toString(); + var test11 = 3. /* comment */ .toString(); + var test12 = 3 + /* comment */ .toString(); + var test13 = 3. + /* comment */ .toString(); + var test14 = 3 + // comment + .toString(); + var test15 = 3. + // comment + .toString(); + var test16 = 3 // comment time + .toString(); + var test17 = 3. // comment time again + .toString(); + \ No newline at end of file diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js index 4ea5c5c7bd2..ab2f0cbbdc7 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.js @@ -4,19 +4,35 @@ 1.toString(); 1.+2.0 + 3. ; -// Preserve whitespace where important for JS compatibility +// Preserve whitespace and comments where important for JS compatibility var i: number = 1; -var test1 = i.toString(); +var test1 = i.toString(); var test2 = 2.toString(); var test3 = 3 .toString(); var test4 = 3 .toString(); -var test5 = 3 .toString(); +var test5 = 3 .toString(); var test6 = 3.['toString'](); var test7 = 3 .toString(); var test8 = new Number(4).toString(); -var test9 = 3. + 3. -var test10 = 0 /* any comment */.toString(); +var test9 = 3. + 3.; +var test10 = 0 /* comment */.toString(); +var test11 = 3. /* comment */ .toString(); +var test12 = 3 + /* comment */ .toString(); +var test13 = 3. + /* comment */ .toString(); +var test14 = 3 + // comment + .toString(); +var test15 = 3. + // comment + .toString(); +var test16 = 3 // comment time + .toString(); +var test17 = 3. // comment time again + .toString(); + //// [numericLiteralsWithTrailingDecimalPoints01.js] @@ -25,7 +41,7 @@ var test10 = 0 /* any comment */.toString(); 1.; toString(); 1. + 2.0 + 3.; -// Preserve whitespace where important for JS compatibility +// Preserve whitespace and comments where important for JS compatibility var i = 1; var test1 = i.toString(); var test2 = 2., toString; @@ -38,4 +54,19 @@ var test7 = 3 .toString(); var test8 = new Number(4).toString(); var test9 = 3. + 3.; -var test10 = 0 /* any comment */.toString(); +var test10 = 0 /* comment */.toString(); +var test11 = 3. /* comment */.toString(); +var test12 = 3 + /* comment */ .toString(); +var test13 = 3. + /* comment */ .toString(); +var test14 = 3 + // comment + .toString(); +var test15 = 3. + // comment + .toString(); +var test16 = 3 // comment time + .toString(); +var test17 = 3. // comment time again + .toString(); diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols index 39ef3b1c0be..c4d3aa4b02a 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols @@ -12,11 +12,11 @@ 1.+2.0 + 3. ; -// Preserve whitespace where important for JS compatibility +// Preserve whitespace and comments where important for JS compatibility var i: number = 1; >i : Symbol(i, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 6, 3)) -var test1 = i.toString(); +var test1 = i.toString(); >test1 : Symbol(test1, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 7, 3)) >i.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 6, 3)) @@ -36,7 +36,7 @@ var test4 = 3 .toString(); >3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) -var test5 = 3 .toString(); +var test5 = 3 .toString(); >test5 : Symbol(test5, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 11, 3)) >3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) @@ -58,11 +58,61 @@ var test8 = new Number(4).toString(); >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) -var test9 = 3. + 3. +var test9 = 3. + 3.; >test9 : Symbol(test9, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 16, 3)) -var test10 = 0 /* any comment */.toString(); +var test10 = 0 /* comment */.toString(); >test10 : Symbol(test10, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 17, 3)) ->0 /* any comment */.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>0 /* comment */.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +var test11 = 3. /* comment */ .toString(); +>test11 : Symbol(test11, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 18, 3)) +>3. /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test12 = 3 +>test12 : Symbol(test12, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 19, 3)) +>3 /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + /* comment */ .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test13 = 3. +>test13 : Symbol(test13, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 21, 3)) +>3. /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + /* comment */ .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test14 = 3 +>test14 : Symbol(test14, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 23, 3)) +>3 // comment .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + // comment + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test15 = 3. +>test15 : Symbol(test15, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 26, 3)) +>3. // comment .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + // comment + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test16 = 3 // comment time +>test16 : Symbol(test16, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 29, 3)) +>3 // comment time .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test17 = 3. // comment time again +>test17 : Symbol(test17, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 31, 3)) +>3. // comment time again .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types index 839f03ce420..6228ec38d81 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.types @@ -23,12 +23,12 @@ >2.0 : 2 >3. : 3 -// Preserve whitespace where important for JS compatibility +// Preserve whitespace and comments where important for JS compatibility var i: number = 1; >i : number >1 : 1 -var test1 = i.toString(); +var test1 = i.toString(); >test1 : string >i.toString() : string >i.toString : (radix?: number) => string @@ -56,7 +56,7 @@ var test4 = 3 .toString(); >3 : 3 >toString : (radix?: number) => string -var test5 = 3 .toString(); +var test5 = 3 .toString(); >test5 : string >3 .toString() : string >3 .toString : (radix?: number) => string @@ -88,16 +88,80 @@ var test8 = new Number(4).toString(); >4 : 4 >toString : (radix?: number) => string -var test9 = 3. + 3. +var test9 = 3. + 3.; >test9 : number >3. + 3. : number >3. : 3 >3. : 3 -var test10 = 0 /* any comment */.toString(); +var test10 = 0 /* comment */.toString(); >test10 : string ->0 /* any comment */.toString() : string ->0 /* any comment */.toString : (radix?: number) => string +>0 /* comment */.toString() : string +>0 /* comment */.toString : (radix?: number) => string >0 : 0 >toString : (radix?: number) => string +var test11 = 3. /* comment */ .toString(); +>test11 : string +>3. /* comment */ .toString() : string +>3. /* comment */ .toString : (radix?: number) => string +>3. : 3 +>toString : (radix?: number) => string + +var test12 = 3 +>test12 : string +>3 /* comment */ .toString() : string +>3 /* comment */ .toString : (radix?: number) => string +>3 : 3 + + /* comment */ .toString(); +>toString : (radix?: number) => string + +var test13 = 3. +>test13 : string +>3. /* comment */ .toString() : string +>3. /* comment */ .toString : (radix?: number) => string +>3. : 3 + + /* comment */ .toString(); +>toString : (radix?: number) => string + +var test14 = 3 +>test14 : string +>3 // comment .toString() : string +>3 // comment .toString : (radix?: number) => string +>3 : 3 + + // comment + .toString(); +>toString : (radix?: number) => string + +var test15 = 3. +>test15 : string +>3. // comment .toString() : string +>3. // comment .toString : (radix?: number) => string +>3. : 3 + + // comment + .toString(); +>toString : (radix?: number) => string + +var test16 = 3 // comment time +>test16 : string +>3 // comment time .toString() : string +>3 // comment time .toString : (radix?: number) => string +>3 : 3 + + .toString(); +>toString : (radix?: number) => string + +var test17 = 3. // comment time again +>test17 : string +>3. // comment time again .toString() : string +>3. // comment time again .toString : (radix?: number) => string +>3. : 3 + + .toString(); +>toString : (radix?: number) => string + + diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt new file mode 100644 index 00000000000..4f83c9d031f --- /dev/null +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt @@ -0,0 +1,50 @@ +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(3,3): error TS1005: ';' expected. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,15): error TS1005: ',' expected. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,23): error TS1005: ',' expected. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,24): error TS1109: Expression expected. + + +==== tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts (4 errors) ==== + 1..toString(); + 1.0.toString(); + 1.toString(); + ~~~~~~~~ +!!! error TS1005: ';' expected. + 1.+2.0 + 3. ; + + // Preserve whitespace where important for JS compatibility + var i: number = 1; + var test1 = i.toString(); + var test2 = 2.toString(); + ~~~~~~~~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1109: Expression expected. + var test3 = 3 .toString(); + var test4 = 3 .toString(); + var test5 = 3 .toString(); + var test6 = 3.['toString'](); + var test7 = 3 + .toString(); + var test8 = new Number(4).toString(); + var test9 = 3. + 3.; + var test10 = 0 /* comment */.toString(); + var test11 = 3. /* comment */ .toString(); + var test12 = 3 + /* comment */ .toString(); + var test13 = 3. + /* comment */ .toString(); + var test14 = 3 + // comment + .toString(); + var test15 = 3. + // comment + .toString(); + var test16 = 3 // comment time + .toString(); + var test17 = 3. // comment time again + .toString(); + + \ No newline at end of file diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.js b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.js new file mode 100644 index 00000000000..b7aff7379d5 --- /dev/null +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.js @@ -0,0 +1,69 @@ +//// [numericLiteralsWithTrailingDecimalPoints02.ts] +1..toString(); +1.0.toString(); +1.toString(); +1.+2.0 + 3. ; + +// Preserve whitespace where important for JS compatibility +var i: number = 1; +var test1 = i.toString(); +var test2 = 2.toString(); +var test3 = 3 .toString(); +var test4 = 3 .toString(); +var test5 = 3 .toString(); +var test6 = 3.['toString'](); +var test7 = 3 +.toString(); +var test8 = new Number(4).toString(); +var test9 = 3. + 3.; +var test10 = 0 /* comment */.toString(); +var test11 = 3. /* comment */ .toString(); +var test12 = 3 + /* comment */ .toString(); +var test13 = 3. + /* comment */ .toString(); +var test14 = 3 + // comment + .toString(); +var test15 = 3. + // comment + .toString(); +var test16 = 3 // comment time + .toString(); +var test17 = 3. // comment time again + .toString(); + + + +//// [numericLiteralsWithTrailingDecimalPoints02.js] +1..toString(); +1.0.toString(); +1.; +toString(); +1. + 2.0 + 3.; +var i = 1; +var test1 = i.toString(); +var test2 = 2., toString; +(); +var test3 = 3..toString(); +var test4 = 3..toString(); +var test5 = 3..toString(); +var test6 = 3.['toString'](); +var test7 = 3 + .toString(); +var test8 = new Number(4).toString(); +var test9 = 3. + 3.; +var test10 = 0..toString(); +var test11 = 3..toString(); +var test12 = 3 + .toString(); +var test13 = 3. + .toString(); +var test14 = 3 + .toString(); +var test15 = 3. + .toString(); +var test16 = 3 + .toString(); +var test17 = 3. + .toString(); diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.symbols b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.symbols new file mode 100644 index 00000000000..9d2121ef444 --- /dev/null +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.symbols @@ -0,0 +1,118 @@ +=== tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts === +1..toString(); +>1..toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +1.0.toString(); +>1.0.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +1.toString(); +>toString : Symbol(toString, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 8, 14)) + +1.+2.0 + 3. ; + +// Preserve whitespace where important for JS compatibility +var i: number = 1; +>i : Symbol(i, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 6, 3)) + +var test1 = i.toString(); +>test1 : Symbol(test1, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 7, 3)) +>i.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>i : Symbol(i, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 6, 3)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test2 = 2.toString(); +>test2 : Symbol(test2, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 8, 3)) +>toString : Symbol(toString, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 8, 14)) + +var test3 = 3 .toString(); +>test3 : Symbol(test3, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 9, 3)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test4 = 3 .toString(); +>test4 : Symbol(test4, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 10, 3)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test5 = 3 .toString(); +>test5 : Symbol(test5, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 11, 3)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test6 = 3.['toString'](); +>test6 : Symbol(test6, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 12, 3)) +>'toString' : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test7 = 3 +>test7 : Symbol(test7, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 13, 3)) +>3.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +.toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test8 = new Number(4).toString(); +>test8 : Symbol(test8, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 15, 3)) +>new Number(4).toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test9 = 3. + 3.; +>test9 : Symbol(test9, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 16, 3)) + +var test10 = 0 /* comment */.toString(); +>test10 : Symbol(test10, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 17, 3)) +>0 /* comment */.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test11 = 3. /* comment */ .toString(); +>test11 : Symbol(test11, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 18, 3)) +>3. /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test12 = 3 +>test12 : Symbol(test12, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 19, 3)) +>3 /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + /* comment */ .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test13 = 3. +>test13 : Symbol(test13, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 21, 3)) +>3. /* comment */ .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + /* comment */ .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test14 = 3 +>test14 : Symbol(test14, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 23, 3)) +>3 // comment .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + // comment + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test15 = 3. +>test15 : Symbol(test15, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 26, 3)) +>3. // comment .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + // comment + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test16 = 3 // comment time +>test16 : Symbol(test16, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 29, 3)) +>3 // comment time .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + +var test17 = 3. // comment time again +>test17 : Symbol(test17, Decl(numericLiteralsWithTrailingDecimalPoints02.ts, 31, 3)) +>3. // comment time again .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + .toString(); +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + + diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.types b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.types new file mode 100644 index 00000000000..3aacb64fea0 --- /dev/null +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.types @@ -0,0 +1,167 @@ +=== tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts === +1..toString(); +>1..toString() : string +>1..toString : (radix?: number) => string +>1. : 1 +>toString : (radix?: number) => string + +1.0.toString(); +>1.0.toString() : string +>1.0.toString : (radix?: number) => string +>1.0 : 1 +>toString : (radix?: number) => string + +1.toString(); +>1. : 1 +>toString() : any +>toString : any + +1.+2.0 + 3. ; +>1.+2.0 + 3. : number +>1.+2.0 : number +>1. : 1 +>2.0 : 2 +>3. : 3 + +// Preserve whitespace where important for JS compatibility +var i: number = 1; +>i : number +>1 : 1 + +var test1 = i.toString(); +>test1 : string +>i.toString() : string +>i.toString : (radix?: number) => string +>i : number +>toString : (radix?: number) => string + +var test2 = 2.toString(); +>test2 : number +>2. : 2 +>toString : any +>() : any +> : any + +var test3 = 3 .toString(); +>test3 : string +>3 .toString() : string +>3 .toString : (radix?: number) => string +>3 : 3 +>toString : (radix?: number) => string + +var test4 = 3 .toString(); +>test4 : string +>3 .toString() : string +>3 .toString : (radix?: number) => string +>3 : 3 +>toString : (radix?: number) => string + +var test5 = 3 .toString(); +>test5 : string +>3 .toString() : string +>3 .toString : (radix?: number) => string +>3 : 3 +>toString : (radix?: number) => string + +var test6 = 3.['toString'](); +>test6 : string +>3.['toString']() : string +>3.['toString'] : (radix?: number) => string +>3. : 3 +>'toString' : "toString" + +var test7 = 3 +>test7 : string +>3.toString() : string +>3.toString : (radix?: number) => string +>3 : 3 + +.toString(); +>toString : (radix?: number) => string + +var test8 = new Number(4).toString(); +>test8 : string +>new Number(4).toString() : string +>new Number(4).toString : (radix?: number) => string +>new Number(4) : Number +>Number : NumberConstructor +>4 : 4 +>toString : (radix?: number) => string + +var test9 = 3. + 3.; +>test9 : number +>3. + 3. : number +>3. : 3 +>3. : 3 + +var test10 = 0 /* comment */.toString(); +>test10 : string +>0 /* comment */.toString() : string +>0 /* comment */.toString : (radix?: number) => string +>0 : 0 +>toString : (radix?: number) => string + +var test11 = 3. /* comment */ .toString(); +>test11 : string +>3. /* comment */ .toString() : string +>3. /* comment */ .toString : (radix?: number) => string +>3. : 3 +>toString : (radix?: number) => string + +var test12 = 3 +>test12 : string +>3 /* comment */ .toString() : string +>3 /* comment */ .toString : (radix?: number) => string +>3 : 3 + + /* comment */ .toString(); +>toString : (radix?: number) => string + +var test13 = 3. +>test13 : string +>3. /* comment */ .toString() : string +>3. /* comment */ .toString : (radix?: number) => string +>3. : 3 + + /* comment */ .toString(); +>toString : (radix?: number) => string + +var test14 = 3 +>test14 : string +>3 // comment .toString() : string +>3 // comment .toString : (radix?: number) => string +>3 : 3 + + // comment + .toString(); +>toString : (radix?: number) => string + +var test15 = 3. +>test15 : string +>3. // comment .toString() : string +>3. // comment .toString : (radix?: number) => string +>3. : 3 + + // comment + .toString(); +>toString : (radix?: number) => string + +var test16 = 3 // comment time +>test16 : string +>3 // comment time .toString() : string +>3 // comment time .toString : (radix?: number) => string +>3 : 3 + + .toString(); +>toString : (radix?: number) => string + +var test17 = 3. // comment time again +>test17 : string +>3. // comment time again .toString() : string +>3. // comment time again .toString : (radix?: number) => string +>3. : 3 + + .toString(); +>toString : (radix?: number) => string + + From e6aa99209589eac9d7baec422e7d55c7c1f12c03 Mon Sep 17 00:00:00 2001 From: Philip Pesca Date: Tue, 11 Dec 2018 09:54:38 -0800 Subject: [PATCH 165/322] Fix error message when type argument arity is wrong (#28366) * Fix error message when type argument arity is wrong * Parenthesize 's' in plurals * Update baseline * Update baseline * Use old error message * Revert parantheses --- src/compiler/checker.ts | 31 ++++++-- src/compiler/diagnosticMessages.json | 4 ++ ...functionTypeArgumentArityErrors.errors.txt | 57 +++++++++++++++ .../functionTypeArgumentArityErrors.js | 39 ++++++++++ .../functionTypeArgumentArityErrors.symbols | 72 +++++++++++++++++++ .../functionTypeArgumentArityErrors.types | 67 +++++++++++++++++ tests/baselines/reference/newMap.errors.txt | 4 +- .../reference/overloadResolution.errors.txt | 4 +- .../overloadResolutionConstructors.errors.txt | 4 +- ...loadsAndTypeArgumentArityErrors.errors.txt | 8 +-- .../functionTypeArgumentArityErrors.ts | 26 +++++++ 11 files changed, 299 insertions(+), 17 deletions(-) create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.js create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.symbols create mode 100644 tests/baselines/reference/functionTypeArgumentArityErrors.types create mode 100644 tests/cases/compiler/functionTypeArgumentArityErrors.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2eeea77e492..73c93f48cbf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19890,14 +19890,31 @@ namespace ts { } function getTypeArgumentArityError(node: Node, signatures: ReadonlyArray, typeArguments: NodeArray) { - let min = Infinity; - let max = -Infinity; - for (const sig of signatures) { - min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters)); - max = Math.max(max, length(sig.typeParameters)); + const argCount = typeArguments.length; + // No overloads exist + if (signatures.length === 1) { + const sig = signatures[0]; + const min = getMinTypeArgumentCount(sig.typeParameters); + const max = length(sig.typeParameters); + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min < max ? min + "-" + max : min , argCount); } - const paramCount = min === max ? min : min + "-" + max; - return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length); + // Overloads exist + let belowArgCount = -Infinity; + let aboveArgCount = Infinity; + for (const sig of signatures) { + const min = getMinTypeArgumentCount(sig.typeParameters); + const max = length(sig.typeParameters); + if (min > argCount) { + aboveArgCount = Math.min(aboveArgCount, min); + } + else if (max < argCount) { + belowArgCount = Math.max(belowArgCount, max); + } + } + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + } + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cde7516f047..2cbf5784d07 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2533,6 +2533,10 @@ "category": "Error", "code": 2742 }, + "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments.": { + "category": "Error", + "code": 2743 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt new file mode 100644 index 00000000000..22e22785a24 --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.errors.txt @@ -0,0 +1,57 @@ +tests/cases/compiler/functionTypeArgumentArityErrors.ts(4,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(5,4): error TS2558: Expected 4 type arguments, but got 5. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(10,4): error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(11,4): error TS2558: Expected 3 type arguments, but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(16,4): error TS2558: Expected 0 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(20,4): error TS2558: Expected 2-3 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(21,4): error TS2558: Expected 2-3 type arguments, but got 4. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(25,4): error TS2558: Expected 2 type arguments, but got 1. +tests/cases/compiler/functionTypeArgumentArityErrors.ts(26,4): error TS2558: Expected 2 type arguments, but got 3. + + +==== tests/cases/compiler/functionTypeArgumentArityErrors.ts (9 errors) ==== + // Overloaded functions with default type arguments + declare function f1(): void; + declare function f1(): void; + f1(); + ~~~~~~~~~~~~~~ +!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. + f1(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 4 type arguments, but got 5. + + // Overloaded functions with no default type arguments + declare function f2(): void; + declare function f2(): void; + f2(); + ~~~~~~~~~~~~~~ +!!! error TS2743: No overload expects 2 type arguments, but overloads do exist that expect either 1 or 3 type arguments. + f2(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 3 type arguments, but got 4. + + // Overloaded non-generic functions + declare function f3(): void; + declare function f3(a): void; + f3(); + ~~~~~~ +!!! error TS2558: Expected 0 type arguments, but got 1. + + // Generic function with default type parameters + declare function f4(): void; + f4(); + ~~~~~~ +!!! error TS2558: Expected 2-3 type arguments, but got 1. + f4(); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 2-3 type arguments, but got 4. + + // Generic function with no default type arguments + declare function f5(): void; + f5(); + ~~~~~~ +!!! error TS2558: Expected 2 type arguments, but got 1. + f5(); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2558: Expected 2 type arguments, but got 3. + \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.js b/tests/baselines/reference/functionTypeArgumentArityErrors.js new file mode 100644 index 00000000000..9c150bea78b --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.js @@ -0,0 +1,39 @@ +//// [functionTypeArgumentArityErrors.ts] +// Overloaded functions with default type arguments +declare function f1(): void; +declare function f1(): void; +f1(); +f1(); + +// Overloaded functions with no default type arguments +declare function f2(): void; +declare function f2(): void; +f2(); +f2(); + +// Overloaded non-generic functions +declare function f3(): void; +declare function f3(a): void; +f3(); + +// Generic function with default type parameters +declare function f4(): void; +f4(); +f4(); + +// Generic function with no default type arguments +declare function f5(): void; +f5(); +f5(); + + +//// [functionTypeArgumentArityErrors.js] +f1(); +f1(); +f2(); +f2(); +f3(); +f4(); +f4(); +f5(); +f5(); diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.symbols b/tests/baselines/reference/functionTypeArgumentArityErrors.symbols new file mode 100644 index 00000000000..48c702f968b --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.symbols @@ -0,0 +1,72 @@ +=== tests/cases/compiler/functionTypeArgumentArityErrors.ts === +// Overloaded functions with default type arguments +declare function f1(): void; +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 1, 20)) + +declare function f1(): void; +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 2, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 2, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 2, 25)) +>D : Symbol(D, Decl(functionTypeArgumentArityErrors.ts, 2, 28)) + +f1(); +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) + +f1(); +>f1 : Symbol(f1, Decl(functionTypeArgumentArityErrors.ts, 0, 0), Decl(functionTypeArgumentArityErrors.ts, 1, 37)) + +// Overloaded functions with no default type arguments +declare function f2(): void; +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 7, 20)) + +declare function f2(): void; +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 8, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 8, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 8, 25)) + +f2(); +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) + +f2(); +>f2 : Symbol(f2, Decl(functionTypeArgumentArityErrors.ts, 4, 45), Decl(functionTypeArgumentArityErrors.ts, 7, 31)) + +// Overloaded non-generic functions +declare function f3(): void; +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) + +declare function f3(a): void; +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) +>a : Symbol(a, Decl(functionTypeArgumentArityErrors.ts, 14, 20)) + +f3(); +>f3 : Symbol(f3, Decl(functionTypeArgumentArityErrors.ts, 10, 37), Decl(functionTypeArgumentArityErrors.ts, 13, 28)) + +// Generic function with default type parameters +declare function f4(): void; +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 18, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 18, 22)) +>C : Symbol(C, Decl(functionTypeArgumentArityErrors.ts, 18, 25)) + +f4(); +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) + +f4(); +>f4 : Symbol(f4, Decl(functionTypeArgumentArityErrors.ts, 15, 13)) + +// Generic function with no default type arguments +declare function f5(): void; +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) +>A : Symbol(A, Decl(functionTypeArgumentArityErrors.ts, 23, 20)) +>B : Symbol(B, Decl(functionTypeArgumentArityErrors.ts, 23, 22)) + +f5(); +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) + +f5(); +>f5 : Symbol(f5, Decl(functionTypeArgumentArityErrors.ts, 20, 37)) + diff --git a/tests/baselines/reference/functionTypeArgumentArityErrors.types b/tests/baselines/reference/functionTypeArgumentArityErrors.types new file mode 100644 index 00000000000..c91cf39674f --- /dev/null +++ b/tests/baselines/reference/functionTypeArgumentArityErrors.types @@ -0,0 +1,67 @@ +=== tests/cases/compiler/functionTypeArgumentArityErrors.ts === +// Overloaded functions with default type arguments +declare function f1(): void; +>f1 : { (): void; (): void; } + +declare function f1(): void; +>f1 : { (): void; (): void; } + +f1(); +>f1() : any +>f1 : { (): void; (): void; } + +f1(); +>f1() : any +>f1 : { (): void; (): void; } + +// Overloaded functions with no default type arguments +declare function f2(): void; +>f2 : { (): void; (): void; } + +declare function f2(): void; +>f2 : { (): void; (): void; } + +f2(); +>f2() : any +>f2 : { (): void; (): void; } + +f2(); +>f2() : any +>f2 : { (): void; (): void; } + +// Overloaded non-generic functions +declare function f3(): void; +>f3 : { (): void; (a: any): void; } + +declare function f3(a): void; +>f3 : { (): void; (a: any): void; } +>a : any + +f3(); +>f3() : any +>f3 : { (): void; (a: any): void; } + +// Generic function with default type parameters +declare function f4(): void; +>f4 : () => void + +f4(); +>f4() : any +>f4 : () => void + +f4(); +>f4() : any +>f4 : () => void + +// Generic function with no default type arguments +declare function f5(): void; +>f5 : () => void + +f5(); +>f5() : any +>f5 : () => void + +f5(); +>f5() : any +>f5 : () => void + diff --git a/tests/baselines/reference/newMap.errors.txt b/tests/baselines/reference/newMap.errors.txt index 46668890b07..d8a4f1c5222 100644 --- a/tests/baselines/reference/newMap.errors.txt +++ b/tests/baselines/reference/newMap.errors.txt @@ -1,8 +1,8 @@ -tests/cases/compiler/newMap.ts(1,9): error TS2558: Expected 0-2 type arguments, but got 1. +tests/cases/compiler/newMap.ts(1,9): error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. ==== tests/cases/compiler/newMap.ts (1 errors) ==== new Map(); ~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 1. +!!! error TS2743: No overload expects 1 type arguments, but overloads do exist that expect either 0 or 2 type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 6710f697b3c..27d0392ca8d 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(27,5): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(41,11): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 1-3 type arguments, but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(70,21): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -79,7 +79,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): // Generic overloads with differing arity called with type argument count that doesn't match any overload fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-3 type arguments, but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints function fn4(n: T, m: U); diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index fe1c955651b..2e09a84d138 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(27,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. -tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 1-3 type arguments, but got 4. +tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type '""' is not assignable to parameter of type 'number'. tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. @@ -83,7 +83,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors // Generic overloads with differing arity called with type argument count that doesn't match any overload new fn3(); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 1-3 type arguments, but got 4. +!!! error TS2558: Expected 3 type arguments, but got 4. // Generic overloads with constraints called with type arguments that satisfy the constraints interface fn4 { diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt index 1993a6d7f2c..6b64cd8a773 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt +++ b/tests/baselines/reference/overloadsAndTypeArgumentArityErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 0-2 type arguments, but got 3. -tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 0-2 type arguments, but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(5,11): error TS2558: Expected 2 type arguments, but got 3. +tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(6,15): error TS2558: Expected 2 type arguments, but got 3. tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Expected 1 arguments, but got 0. @@ -10,10 +10,10 @@ tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts(9,1): error TS2554: Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. new Callbacks('s'); // wrong number of type arguments ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2558: Expected 0-2 type arguments, but got 3. +!!! error TS2558: Expected 2 type arguments, but got 3. declare function f(arg: number): void; f(); // wrong number of arguments (#25683) diff --git a/tests/cases/compiler/functionTypeArgumentArityErrors.ts b/tests/cases/compiler/functionTypeArgumentArityErrors.ts new file mode 100644 index 00000000000..5cf681effa6 --- /dev/null +++ b/tests/cases/compiler/functionTypeArgumentArityErrors.ts @@ -0,0 +1,26 @@ +// Overloaded functions with default type arguments +declare function f1(): void; +declare function f1(): void; +f1(); +f1(); + +// Overloaded functions with no default type arguments +declare function f2(): void; +declare function f2(): void; +f2(); +f2(); + +// Overloaded non-generic functions +declare function f3(): void; +declare function f3(a): void; +f3(); + +// Generic function with default type parameters +declare function f4(): void; +f4(); +f4(); + +// Generic function with no default type arguments +declare function f5(): void; +f5(); +f5(); From ea36186c47f31e20a78664c5b1c1f5849b384cfc Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 11 Dec 2018 10:20:12 -0800 Subject: [PATCH 166/322] Update user baselines (#28961) --- tests/baselines/reference/user/chrome-devtools-frontend.log | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 2422fdab79b..268d9e869c4 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -11,8 +11,8 @@ Standard output: ../../../../built/local/lib.dom.d.ts(12039,13): error TS2300: Duplicate identifier 'Request'. ../../../../built/local/lib.dom.d.ts(16513,11): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.dom.d.ts(16644,13): error TS2300: Duplicate identifier 'Window'. -../../../../built/local/lib.es5.d.ts(1406,11): error TS2300: Duplicate identifier 'ArrayLike'. -../../../../built/local/lib.es5.d.ts(1442,6): error TS2300: Duplicate identifier 'Record'. +../../../../built/local/lib.es5.d.ts(1416,11): error TS2300: Duplicate identifier 'ArrayLike'. +../../../../built/local/lib.es5.d.ts(1452,6): error TS2300: Duplicate identifier 'Record'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(77,16): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. From 44116b52419708009eb32f67b49b19ed09f3036d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 12:11:07 -0800 Subject: [PATCH 167/322] Simplify indexed accesses on mapped types up to five levels deep --- src/compiler/checker.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2eeea77e492..8001165e491 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -67,6 +67,7 @@ namespace ts { let enumCount = 0; let instantiationDepth = 0; let constraintDepth = 0; + let simplificationDepth = 0; const emptySymbols = createSymbolTable(); const identityMapper: (type: Type) => Type = identity; @@ -9686,24 +9687,29 @@ namespace ts { // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we - // construct the type Box. We do not further simplify the result because mapped types can be recursive - // and we might never terminate. - if (isGenericMappedType(objectType)) { - return type.simplified = substituteIndexedMappedType(objectType, type); - } - if (objectType.flags & TypeFlags.TypeParameter) { - const constraint = getConstraintOfTypeParameter(objectType as TypeParameter); - if (constraint && isGenericMappedType(constraint)) { - return type.simplified = substituteIndexedMappedType(constraint, type); + // construct the type Box. Mapped types can be recursive so to guard against infinite recursion we + // only perform this simplification up to five levels deep. + if (simplificationDepth < 5) { + if (isGenericMappedType(objectType)) { + return type.simplified = substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & TypeFlags.TypeParameter) { + const constraint = getConstraintOfTypeParameter(objectType as TypeParameter); + if (constraint && isGenericMappedType(constraint)) { + return type.simplified = substituteIndexedMappedType(constraint, type); + } } } return type.simplified = type; } function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) { + simplificationDepth++; const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); const templateMapper = combineTypeMappers(objectType.mapper, mapper); - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + const result = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType); + simplificationDepth--; + return result; } function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName, missingType = accessNode ? errorType : unknownType): Type { From 2150a64f0cd457a791ac30c8850934cd6ee35704 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 12:11:16 -0800 Subject: [PATCH 168/322] Add tests --- .../types/keyof/keyofAndIndexedAccessErrors.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts index a4ed608d8e7..a179935d0ec 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts @@ -141,3 +141,19 @@ function test1, K extends keyof T>(t: T, k: K) { t[k] = "hello"; // Error t[k] = [10, 20]; // Error } + +// Repro from #28839 + +function f30() { + let x: Partial>[K] = "hello"; +} + +// We simplify indexed accesses applied to mapped types up to five levels deep + +function f31() { + let x: Partial>>>>[K] = "hello"; +} + +function f32() { + let x: Partial>>>>>[K] = "hello"; +} From 02b13a916a07cbd54e3132ea703e0be2035a1866 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 12:12:57 -0800 Subject: [PATCH 169/322] Accept new baselines --- .../keyofAndIndexedAccessErrors.errors.txt | 21 +++++++- .../reference/keyofAndIndexedAccessErrors.js | 27 ++++++++++ .../keyofAndIndexedAccessErrors.symbols | 53 +++++++++++++++++++ .../keyofAndIndexedAccessErrors.types | 28 ++++++++++ 4 files changed, 128 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt index cba7ab52469..68669463d95 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt @@ -66,9 +66,10 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(123,5): error tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(140,5): error TS2322: Type '42' is not assignable to type 'T[K]'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(141,5): error TS2322: Type '"hello"' is not assignable to type 'T[K]'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error TS2322: Type 'number[]' is not assignable to type 'T[K]'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(158,9): error TS2322: Type '"hello"' is not assignable to type 'Record[K]'. -==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (41 errors) ==== +==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (42 errors) ==== class Shape { name: string; width: number; @@ -321,4 +322,22 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error ~~~~ !!! error TS2322: Type 'number[]' is not assignable to type 'T[K]'. } + + // Repro from #28839 + + function f30() { + let x: Partial>[K] = "hello"; + } + + // We simplify indexed accesses applied to mapped types up to five levels deep + + function f31() { + let x: Partial>>>>[K] = "hello"; + } + + function f32() { + let x: Partial>>>>>[K] = "hello"; + ~ +!!! error TS2322: Type '"hello"' is not assignable to type 'Record[K]'. + } \ No newline at end of file diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.js b/tests/baselines/reference/keyofAndIndexedAccessErrors.js index 88a1b74f14d..0cf77e79ba6 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.js +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.js @@ -142,6 +142,22 @@ function test1, K extends keyof T>(t: T, k: K) { t[k] = "hello"; // Error t[k] = [10, 20]; // Error } + +// Repro from #28839 + +function f30() { + let x: Partial>[K] = "hello"; +} + +// We simplify indexed accesses applied to mapped types up to five levels deep + +function f31() { + let x: Partial>>>>[K] = "hello"; +} + +function f32() { + let x: Partial>>>>>[K] = "hello"; +} //// [keyofAndIndexedAccessErrors.js] @@ -215,3 +231,14 @@ function test1(t, k) { t[k] = "hello"; // Error t[k] = [10, 20]; // Error } +// Repro from #28839 +function f30() { + var x = "hello"; +} +// We simplify indexed accesses applied to mapped types up to five levels deep +function f31() { + var x = "hello"; +} +function f32() { + var x = "hello"; +} diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols b/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols index df1707849cb..3f32679a813 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols @@ -486,3 +486,56 @@ function test1, K extends keyof T>(t: T, k: K) { >k : Symbol(k, Decl(keyofAndIndexedAccessErrors.ts, 138, 70)) } +// Repro from #28839 + +function f30() { +>f30 : Symbol(f30, Decl(keyofAndIndexedAccessErrors.ts, 142, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 146, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 146, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 146, 13)) + + let x: Partial>[K] = "hello"; +>x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 147, 7)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 146, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 146, 15)) +} + +// We simplify indexed accesses applied to mapped types up to five levels deep + +function f31() { +>f31 : Symbol(f31, Decl(keyofAndIndexedAccessErrors.ts, 148, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 152, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) + + let x: Partial>>>>[K] = "hello"; +>x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 153, 7)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 152, 15)) +} + +function f32() { +>f32 : Symbol(f32, Decl(keyofAndIndexedAccessErrors.ts, 154, 1)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 156, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) + + let x: Partial>>>>>[K] = "hello"; +>x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 157, 7)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 156, 15)) +} + diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index 68dc361c99e..b9d17df0341 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -465,3 +465,31 @@ function test1, K extends keyof T>(t: T, k: K) { >20 : 20 } +// Repro from #28839 + +function f30() { +>f30 : () => void + + let x: Partial>[K] = "hello"; +>x : Partial>[K] +>"hello" : "hello" +} + +// We simplify indexed accesses applied to mapped types up to five levels deep + +function f31() { +>f31 : () => void + + let x: Partial>>>>[K] = "hello"; +>x : Partial>>>>[K] +>"hello" : "hello" +} + +function f32() { +>f32 : () => void + + let x: Partial>>>>>[K] = "hello"; +>x : Partial>>>>>[K] +>"hello" : "hello" +} + From 0dcaaa5c5094ca36138fbcd3b791f5f7de6b71b1 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 15:11:57 -0800 Subject: [PATCH 170/322] Simplify indexed accesses on mapped types with no depth limit --- src/compiler/checker.ts | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8001165e491..e7294d3941a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -67,7 +67,6 @@ namespace ts { let enumCount = 0; let instantiationDepth = 0; let constraintDepth = 0; - let simplificationDepth = 0; const emptySymbols = createSymbolTable(); const identityMapper: (type: Type) => Type = identity; @@ -9687,31 +9686,15 @@ namespace ts { // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we - // construct the type Box. Mapped types can be recursive so to guard against infinite recursion we - // only perform this simplification up to five levels deep. - if (simplificationDepth < 5) { - if (isGenericMappedType(objectType)) { - return type.simplified = substituteIndexedMappedType(objectType, type); - } - if (objectType.flags & TypeFlags.TypeParameter) { - const constraint = getConstraintOfTypeParameter(objectType as TypeParameter); - if (constraint && isGenericMappedType(constraint)) { - return type.simplified = substituteIndexedMappedType(constraint, type); - } - } + // construct the type Box. + if (isGenericMappedType(objectType)) { + const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + const templateMapper = combineTypeMappers(objectType.mapper, mapper); + return type.simplified = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType); } return type.simplified = type; } - function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) { - simplificationDepth++; - const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - const templateMapper = combineTypeMappers(objectType.mapper, mapper); - const result = mapType(instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper), getSimplifiedType); - simplificationDepth--; - return result; - } - function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName, missingType = accessNode ? errorType : unknownType): Type { if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; From 77d01ab332bce00322a0c76c5a94e77e45abf9db Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 15:12:47 -0800 Subject: [PATCH 171/322] Update tests --- .../conformance/types/keyof/keyofAndIndexedAccess.ts | 4 ++-- .../types/keyof/keyofAndIndexedAccessErrors.ts | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts index cf05bdfed81..b498310f13b 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts @@ -486,10 +486,10 @@ function onChangeGenericFunction(handler: Handler) { function updateIds, K extends string>( obj: T, idFields: K[], - idMapping: { [oldId: string]: string } + idMapping: Partial> ): Record { for (const idField of idFields) { - const newId = idMapping[obj[idField]]; + const newId: T[K] | undefined = idMapping[obj[idField]]; if (newId) { obj[idField] = newId; } diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts index a179935d0ec..d5fe7c24b5c 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts @@ -148,12 +148,6 @@ function f30() { let x: Partial>[K] = "hello"; } -// We simplify indexed accesses applied to mapped types up to five levels deep - function f31() { - let x: Partial>>>>[K] = "hello"; -} - -function f32() { - let x: Partial>>>>>[K] = "hello"; + let x: Partial>>>>>>>[K] = "hello"; } From c3a93944aad2dace975b778df442ad93b13ee6e8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 15:12:54 -0800 Subject: [PATCH 172/322] Accept new baselines --- .../reference/keyofAndIndexedAccess.js | 8 ++--- .../reference/keyofAndIndexedAccess.symbols | 13 ++++++-- .../reference/keyofAndIndexedAccess.types | 21 ++++++------- .../keyofAndIndexedAccessErrors.errors.txt | 13 ++------ .../reference/keyofAndIndexedAccessErrors.js | 12 +------ .../keyofAndIndexedAccessErrors.symbols | 31 +++++-------------- .../keyofAndIndexedAccessErrors.types | 14 ++------- 7 files changed, 35 insertions(+), 77 deletions(-) diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index b7d794285fa..793313fdaa5 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -484,10 +484,10 @@ function onChangeGenericFunction(handler: Handler) { function updateIds, K extends string>( obj: T, idFields: K[], - idMapping: { [oldId: string]: string } + idMapping: Partial> ): Record { for (const idField of idFields) { - const newId = idMapping[obj[idField]]; + const newId: T[K] | undefined = idMapping[obj[idField]]; if (newId) { obj[idField] = newId; } @@ -1312,9 +1312,7 @@ declare type Handler = { declare function onChangeGenericFunction(handler: Handler): void; -declare function updateIds, K extends string>(obj: T, idFields: K[], idMapping: { - [oldId: string]: string; -}): Record; +declare function updateIds, K extends string>(obj: T, idFields: K[], idMapping: Partial>): Record; declare function updateIds2(obj: T, key: K, stringMap: { diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols index 9881365b470..1d26f6dbec3 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols @@ -1767,9 +1767,14 @@ function updateIds, K extends string>( >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 483, 11)) >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) - idMapping: { [oldId: string]: string } + idMapping: Partial> >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 484, 18)) ->oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 485, 18)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) ): Record { >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) @@ -1779,8 +1784,10 @@ function updateIds, K extends string>( >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 487, 14)) >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 483, 11)) - const newId = idMapping[obj[idField]]; + const newId: T[K] | undefined = idMapping[obj[idField]]; >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 488, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 482, 19)) +>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 482, 47)) >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 484, 18)) >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 482, 66)) >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 487, 14)) diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index f4c47b26df0..bb395c562d6 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -1731,7 +1731,7 @@ function onChangeGenericFunction(handler: Handler) { // Repro from #13285 function updateIds, K extends string>( ->updateIds : , K extends string>(obj: T, idFields: K[], idMapping: { [oldId: string]: string; }) => Record +>updateIds : , K extends string>(obj: T, idFields: K[], idMapping: Partial>) => Record obj: T, >obj : T @@ -1739,32 +1739,31 @@ function updateIds, K extends string>( idFields: K[], >idFields : K[] - idMapping: { [oldId: string]: string } ->idMapping : { [oldId: string]: string; } ->oldId : string + idMapping: Partial> +>idMapping : Partial> ): Record { for (const idField of idFields) { >idField : K >idFields : K[] - const newId = idMapping[obj[idField]]; ->newId : { [oldId: string]: string; }[T[K]] ->idMapping[obj[idField]] : { [oldId: string]: string; }[T[K]] ->idMapping : { [oldId: string]: string; } + const newId: T[K] | undefined = idMapping[obj[idField]]; +>newId : T[K] | undefined +>idMapping[obj[idField]] : Partial>[T[K]] +>idMapping : Partial> >obj[idField] : T[K] >obj : T >idField : K if (newId) { ->newId : { [oldId: string]: string; }[T[K]] +>newId : T[K] | undefined obj[idField] = newId; ->obj[idField] = newId : { [oldId: string]: string; }[T[K]] +>obj[idField] = newId : T[K] >obj[idField] : T[K] >obj : T >idField : K ->newId : { [oldId: string]: string; }[T[K]] +>newId : T[K] } } return obj; diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt index 68669463d95..b0eaac39c6d 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt @@ -66,10 +66,9 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(123,5): error tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(140,5): error TS2322: Type '42' is not assignable to type 'T[K]'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(141,5): error TS2322: Type '"hello"' is not assignable to type 'T[K]'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error TS2322: Type 'number[]' is not assignable to type 'T[K]'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(158,9): error TS2322: Type '"hello"' is not assignable to type 'Record[K]'. -==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (42 errors) ==== +==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (41 errors) ==== class Shape { name: string; width: number; @@ -329,15 +328,7 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(158,9): error let x: Partial>[K] = "hello"; } - // We simplify indexed accesses applied to mapped types up to five levels deep - function f31() { - let x: Partial>>>>[K] = "hello"; - } - - function f32() { - let x: Partial>>>>>[K] = "hello"; - ~ -!!! error TS2322: Type '"hello"' is not assignable to type 'Record[K]'. + let x: Partial>>>>>>>[K] = "hello"; } \ No newline at end of file diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.js b/tests/baselines/reference/keyofAndIndexedAccessErrors.js index 0cf77e79ba6..f262f9a0d3c 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.js +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.js @@ -149,14 +149,8 @@ function f30() { let x: Partial>[K] = "hello"; } -// We simplify indexed accesses applied to mapped types up to five levels deep - function f31() { - let x: Partial>>>>[K] = "hello"; -} - -function f32() { - let x: Partial>>>>>[K] = "hello"; + let x: Partial>>>>>>>[K] = "hello"; } @@ -235,10 +229,6 @@ function test1(t, k) { function f30() { var x = "hello"; } -// We simplify indexed accesses applied to mapped types up to five levels deep function f31() { var x = "hello"; } -function f32() { - var x = "hello"; -} diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols b/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols index 3f32679a813..1dd7c0d5648 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.symbols @@ -502,40 +502,23 @@ function f30() { >K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 146, 15)) } -// We simplify indexed accesses applied to mapped types up to five levels deep - function f31() { >f31 : Symbol(f31, Decl(keyofAndIndexedAccessErrors.ts, 148, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 152, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 150, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 150, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 150, 13)) - let x: Partial>>>>[K] = "hello"; ->x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 153, 7)) + let x: Partial>>>>>>>[K] = "hello"; +>x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 151, 7)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 152, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 152, 15)) -} - -function f32() { ->f32 : Symbol(f32, Decl(keyofAndIndexedAccessErrors.ts, 154, 1)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 156, 15)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) - - let x: Partial>>>>>[K] = "hello"; ->x : Symbol(x, Decl(keyofAndIndexedAccessErrors.ts, 157, 7)) ->Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 156, 13)) ->K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 156, 15)) +>T : Symbol(T, Decl(keyofAndIndexedAccessErrors.ts, 150, 13)) +>K : Symbol(K, Decl(keyofAndIndexedAccessErrors.ts, 150, 15)) } diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index b9d17df0341..90df0e687a0 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -475,21 +475,11 @@ function f30() { >"hello" : "hello" } -// We simplify indexed accesses applied to mapped types up to five levels deep - function f31() { >f31 : () => void - let x: Partial>>>>[K] = "hello"; ->x : Partial>>>>[K] ->"hello" : "hello" -} - -function f32() { ->f32 : () => void - - let x: Partial>>>>>[K] = "hello"; ->x : Partial>>>>>[K] + let x: Partial>>>>>>>[K] = "hello"; +>x : Partial>>>>>>>[K] >"hello" : "hello" } From caa7441b1f8df613b7dd23b2ad7b7bcd1b00886b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Dec 2018 16:56:45 -0800 Subject: [PATCH 173/322] Accepted baselines. --- .../numericLiteralsWithTrailingDecimalPoints02.errors.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt index 4f83c9d031f..777a36031d4 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints02.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(3,3): error TS1005: ';' expected. -tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,15): error TS1005: ',' expected. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(3,3): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,15): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,23): error TS1005: ',' expected. tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,24): error TS1109: Expression expected. @@ -9,7 +9,7 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,24): error 1.0.toString(); 1.toString(); ~~~~~~~~ -!!! error TS1005: ';' expected. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. 1.+2.0 + 3. ; // Preserve whitespace where important for JS compatibility @@ -17,7 +17,7 @@ tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints02.ts(9,24): error var test1 = i.toString(); var test2 = 2.toString(); ~~~~~~~~ -!!! error TS1005: ',' expected. +!!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. ~ !!! error TS1005: ',' expected. ~ From 7c92d09e23bc6c94e4e1bd7bb893163f0e32f875 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 12 Dec 2018 13:00:30 -0800 Subject: [PATCH 174/322] When removing the errors for the exports from the file, apart from removing transitive exports, remove the diagnostics of file that import these exports Fixes #28983 --- src/compiler/builder.ts | 11 +- src/testRunner/unittests/tscWatchMode.ts | 175 +++++++++++++++++++---- 2 files changed, 159 insertions(+), 27 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 637e77c545f..7973a4cc8dd 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -281,10 +281,19 @@ namespace ts { } // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected - return !!forEachEntry(state.exportedModulesMap!, (exportedModules, exportedFromPath) => + if (forEachEntry(state.exportedModulesMap!, (exportedModules, exportedFromPath) => !state.currentAffectedFilesExportedModulesMap!.has(exportedFromPath) && // If we already iterated this through cache, ignore it exportedModules.has(filePath) && removeSemanticDiagnosticsOfFileAndExportsOfFile(state, exportedFromPath as Path, seenFileAndExportsOfFile) + )) { + return true; + } + + // Remove diagnostics of files that import this file (without going to exports of referencing files) + return !!forEachEntry(state.referencedMap!, (referencesInFile, referencingFilePath) => + referencesInFile.has(filePath) && + !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file + removeSemanticDiagnosticsOf(state, referencingFilePath as Path) // Dont add to seen since this is not yet done with the export removal ); } diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 65f64b9da78..38acc2963e2 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -27,11 +27,18 @@ namespace ts.tscWatch { return () => watch.getCurrentProgram(); } + interface Watch { + (): Program; + getBuilderProgram(): EmitAndSemanticDiagnosticsBuilderProgram; + } + export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; const watch = createWatchProgram(compilerHost); - return () => watch.getCurrentProgram().getProgram(); + const result = (() => watch.getCurrentProgram().getProgram()) as Watch; + result.getBuilderProgram = () => watch.getCurrentProgram(); + return result; } function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, maxNumberOfFilesToIterateForInvalidation?: number) { @@ -182,7 +189,22 @@ namespace ts.tscWatch { assert.equal(host.exitCode, expectedExitCode); } - function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { + function isDiagnosticMessageChain(message: DiagnosticMessage | DiagnosticMessageChain): message is DiagnosticMessageChain { + return !!(message as DiagnosticMessageChain).messageText; + } + function getDiagnosticOfFileFrom(file: SourceFile | undefined, start: number | undefined, length: number | undefined, message: DiagnosticMessage | DiagnosticMessageChain, ..._args: (string | number)[]): Diagnostic { + let text: DiagnosticMessageChain | string; + if (isDiagnosticMessageChain(message)) { + text = message; + } + else { + text = getLocaleSpecificMessage(message); + + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + } + return { file, start, @@ -194,24 +216,12 @@ namespace ts.tscWatch { }; } - function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); - - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } - - return getDiagnosticOfFileFrom(/*file*/ undefined, text, /*start*/ undefined, /*length*/ undefined, message); + function getDiagnosticWithoutFile(message: DiagnosticMessage | DiagnosticMessageChain, ...args: (string | number)[]): Diagnostic { + return getDiagnosticOfFileFrom(/*file*/ undefined, /*start*/ undefined, /*length*/ undefined, message, ...args); } - function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); - - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } - - return getDiagnosticOfFileFrom(file, text, start, length, message); + function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage | DiagnosticMessageChain, ...args: (string | number)[]): Diagnostic { + return getDiagnosticOfFileFrom(file, start, length, message, ...args); } function getUnknownCompilerOption(program: Program, configFile: File, option: string) { @@ -219,15 +229,9 @@ namespace ts.tscWatch { return getDiagnosticOfFile(program.getCompilerOptions().configFile!, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); } - function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); - - if (arguments.length > 5) { - text = formatStringFromArgs(text, arguments, 5); - } - + function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage | DiagnosticMessageChain, ...args: (string | number)[]): Diagnostic { return getDiagnosticOfFileFrom(program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase()))!, - text, start, length, message); + start, length, message, ...args); } function getDiagnosticModuleNotFoundOfFile(program: Program, file: File, moduleName: string) { @@ -1706,6 +1710,125 @@ interface Document { }); }); + describe("Emit times and Error updates in builder after program changes", () => { + function getOutputFileStampAndError(host: WatchedSystem, watch: Watch, file: File) { + const builderProgram = watch.getBuilderProgram(); + const state = builderProgram.getState(); + return { + file, + fileStamp: host.getModifiedTime(file.path.replace(".ts", ".js")), + errors: builderProgram.getSemanticDiagnostics(watch().getSourceFileByPath(file.path as Path)), + errorsFromOldState: !!state.semanticDiagnosticsFromOldState && state.semanticDiagnosticsFromOldState.has(file.path) + }; + } + + function getOutputFileStampsAndErrors(host: WatchedSystem, watch: Watch, directoryFiles: ReadonlyArray) { + return directoryFiles.map(d => getOutputFileStampAndError(host, watch, d)); + } + + function findStampAndErrors(stampsAndErrors: ReadonlyArray>, file: File) { + return find(stampsAndErrors, info => info.file === file)!; + } + + function verifyOutputFileStampsAndErrors( + file: File, + emitExpected: boolean, + errorRefershExpected: boolean, + beforeChangeFileStampsAndErrors: ReadonlyArray>, + afterChangeFileStampsAndErrors: ReadonlyArray> + ) { + const beforeChange = findStampAndErrors(beforeChangeFileStampsAndErrors, file); + const afterChange = findStampAndErrors(afterChangeFileStampsAndErrors, file); + if (emitExpected) { + assert.notStrictEqual(afterChange.fileStamp, beforeChange.fileStamp, `Expected emit for file ${file.path}`); + } + else { + assert.strictEqual(afterChange.fileStamp, beforeChange.fileStamp, `Did not expect new emit for file ${file.path}`); + } + if (errorRefershExpected) { + if (afterChange.errors !== emptyArray || beforeChange.errors !== emptyArray) { + assert.notStrictEqual(afterChange.errors, beforeChange.errors, `Expected new errors for file ${file.path}`); + } + assert.isFalse(afterChange.errorsFromOldState, `Expected errors to be not copied from old state for file ${file.path}`); + } + else { + assert.strictEqual(afterChange.errors, beforeChange.errors, `Expected errors to not change for file ${file.path}`); + assert.isTrue(afterChange.errorsFromOldState, `Expected errors to be copied from old state for file ${file.path}`); + } + } + + it("updates errors in file not exporting a deep multilevel import that changes", () => { + const currentDirectory = "/user/username/projects/myproject"; + const aFile: File = { + path: `${currentDirectory}/a.ts`, + content: `export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x2: number; + y: number; +}` + }; + const bFile: File = { + path: `${currentDirectory}/b.ts`, + content: `import { Point } from "./a"; +export interface PointWrapper extends Point { +}` + }; + const cFile: File = { + path: `${currentDirectory}/c.ts`, + content: `import { PointWrapper } from "./b"; +export function getPoint(): PointWrapper { + return { + name: "test", + c: { + x: 1, + y: 2 + } + } +};` + }; + const dFile: File = { + path: `${currentDirectory}/d.ts`, + content: `import { getPoint } from "./c"; +getPoint().c.x;` + }; + const eFile: File = { + path: `${currentDirectory}/e.ts`, + content: `import "./d";` + }; + const config: File = { + path: `${currentDirectory}/tsconfig.json`, + content: `{}` + }; + const directoryFiles = [aFile, bFile, cFile, dFile, eFile]; + const files = [...directoryFiles, config, libFile]; + const host = createWatchedSystem(files, { currentDirectory }); + const watch = createWatchOfConfigFile("tsconfig.json", host); + checkProgramActualFiles(watch(), [aFile.path, bFile.path, cFile.path, dFile.path, eFile.path, libFile.path]); + checkOutputErrorsInitial(host, [ + getDiagnosticOfFileFromProgram(watch(), cFile.path, cFile.content.indexOf("x: 1"), 4, chainDiagnosticMessages( + chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, "x", "Coords"), + Diagnostics.Type_0_is_not_assignable_to_type_1, + "{ x: number; y: number; }", + "Coords" + )), + getDiagnosticOfFileFromProgram(watch(), dFile.path, dFile.content.lastIndexOf("x"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "x", "Coords") + ]); + const beforeChange = getOutputFileStampsAndErrors(host, watch, directoryFiles); + host.writeFile(aFile.path, aFile.content.replace("x2", "x")); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + const afterChange = getOutputFileStampsAndErrors(host, watch, directoryFiles); + verifyOutputFileStampsAndErrors(aFile, /*emitExpected*/ true, /*errorRefershExpected*/ true, beforeChange, afterChange); + verifyOutputFileStampsAndErrors(bFile, /*emitExpected*/ true, /*errorRefershExpected*/ true, beforeChange, afterChange); + verifyOutputFileStampsAndErrors(cFile, /*emitExpected*/ false, /*errorRefershExpected*/ true, beforeChange, afterChange); + verifyOutputFileStampsAndErrors(dFile, /*emitExpected*/ false, /*errorRefershExpected*/ true, beforeChange, afterChange); + verifyOutputFileStampsAndErrors(eFile, /*emitExpected*/ false, /*errorRefershExpected*/ false, beforeChange, afterChange); + }); + }); + describe("tsc-watch emit with outFile or out setting", () => { function createWatchForOut(out?: string, outFile?: string) { const host = createWatchedSystem([]); From 5788446aa1757042a15d25b550e7a9bb95e58d97 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 12 Dec 2018 15:39:32 -0800 Subject: [PATCH 175/322] Use contextual parameter types over binding pattern initializer types (#28967) * Use contextual parameter types over binding pattern initializer types * Remove unneeded check --- src/compiler/checker.ts | 55 ++++++++++-------- ...ingArrayBindingPatternAndAssignment3.types | 4 +- ...ingInitializerContextualTypeFromContext.js | 50 ++++++++++++++++ ...itializerContextualTypeFromContext.symbols | 58 +++++++++++++++++++ ...InitializerContextualTypeFromContext.types | 57 ++++++++++++++++++ ...ameterInDestructuringWithInitializer.types | 2 +- ...tedObjectBindingPatternDefaultValues.types | 4 +- ...ingInitializerContextualTypeFromContext.ts | 19 ++++++ 8 files changed, 220 insertions(+), 29 deletions(-) create mode 100644 tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js create mode 100644 tests/baselines/reference/destructuringInitializerContextualTypeFromContext.symbols create mode 100644 tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types create mode 100644 tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index acf5125aa9b..356ddc2a28e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4849,7 +4849,7 @@ namespace ts { if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & TypeFlags.Undefined)) { type = getTypeWithFacts(type, TypeFacts.NEUndefined); } - return declaration.initializer && !getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration)) ? + return declaration.initializer && !getContextualTypeForVariableLikeDeclaration(walkUpBindingElementsAndPatterns(declaration)) ? getUnionType([type, checkDeclarationInitializer(declaration)], UnionReduction.Subtype) : type; } @@ -17009,6 +17009,32 @@ namespace ts { } } + function getContextualTypeForVariableLikeDeclaration(declaration: VariableLikeDeclaration): Type | undefined { + const typeNode = getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + switch (declaration.kind) { + case SyntaxKind.Parameter: + return getContextuallyTypedParameterType(declaration); + case SyntaxKind.BindingElement: + return getContextualTypeForBindingElement(declaration); + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent + } + } + + function getContextualTypeForBindingElement(declaration: BindingElement): Type | undefined { + const parentDeclaration = declaration.parent.parent; + const name = declaration.propertyName || declaration.name; + const parentType = getContextualTypeForVariableLikeDeclaration(parentDeclaration); + if (parentType && !isBindingPattern(name)) { + const text = getTextOfPropertyName(name); + if (text !== undefined) { + return getTypeOfPropertyOfType(parentType, text); + } + } + } + // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. // Otherwise, in a parameter declaration of a contextually typed function expression, @@ -17020,32 +17046,13 @@ namespace ts { function getContextualTypeForInitializerExpression(node: Expression): Type | undefined { const declaration = node.parent; if (hasInitializer(declaration) && node === declaration.initializer) { - const typeNode = getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - return getTypeFromTypeNode(typeNode); + const result = getContextualTypeForVariableLikeDeclaration(declaration); + if (result) { + return result; } - if (declaration.kind === SyntaxKind.Parameter) { - const type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (isBindingPattern(declaration.name)) { + if (isBindingPattern(declaration.name)) { // This is less a contextual type and more an implied shape - in some cases, this may be undesirable return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false); } - if (isBindingPattern(declaration.parent)) { - const parentDeclaration = declaration.parent.parent; - const name = (declaration as BindingElement).propertyName || declaration.name; - if (parentDeclaration.kind !== SyntaxKind.BindingElement) { - const parentTypeNode = getEffectiveTypeAnnotationNode(parentDeclaration); - if (parentTypeNode && !isBindingPattern(name)) { - const text = getTextOfPropertyName(name); - if (text) { - return getTypeOfPropertyOfType(getTypeFromTypeNode(parentTypeNode), text); - } - } - } - } } return undefined; } diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types index 0fb81ba6aa3..389b6b5e5f5 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types @@ -45,8 +45,8 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >c : number >d : number >c : number ->e : any ->e : any +>e : number +>e : number })([1]); >[1] : number[] diff --git a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js new file mode 100644 index 00000000000..2dd6b4ea11a --- /dev/null +++ b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js @@ -0,0 +1,50 @@ +//// [destructuringInitializerContextualTypeFromContext.ts] +interface SFC

{ + (props: P & { children?: any }): any | null; +} + +interface Props { + name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; +} + +const Parent: SFC = ({ + children, + name = "Artemis", + ...props +}) => Child({name, ...props}); + +const Child: SFC = ({ + children, + name = "Artemis", + ...props +}) => `name: ${name} props: ${JSON.stringify(props)}`; + +//// [destructuringInitializerContextualTypeFromContext.js] +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +var Parent = function (_a) { + var children = _a.children, _b = _a.name, name = _b === void 0 ? "Artemis" : _b, props = __rest(_a, ["children", "name"]); + return Child(__assign({ name: name }, props)); +}; +var Child = function (_a) { + var children = _a.children, _b = _a.name, name = _b === void 0 ? "Artemis" : _b, props = __rest(_a, ["children", "name"]); + return "name: " + name + " props: " + JSON.stringify(props); +}; diff --git a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.symbols b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.symbols new file mode 100644 index 00000000000..317a09ee105 --- /dev/null +++ b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.symbols @@ -0,0 +1,58 @@ +=== tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts === +interface SFC

{ +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) +>P : Symbol(P, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 14)) + + (props: P & { children?: any }): any | null; +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 1, 5)) +>P : Symbol(P, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 14)) +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 1, 17)) +} + +interface Props { +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) + + name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; +>name : Symbol(Props.name, Decl(destructuringInitializerContextualTypeFromContext.ts, 4, 17)) +} + +const Parent: SFC = ({ +>Parent : Symbol(Parent, Decl(destructuringInitializerContextualTypeFromContext.ts, 8, 5)) +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) + + children, +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 8, 29)) + + name = "Artemis", +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 9, 13)) + + ...props +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 10, 21)) + +}) => Child({name, ...props}); +>Child : Symbol(Child, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 5)) +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 12, 13)) +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 10, 21)) + +const Child: SFC = ({ +>Child : Symbol(Child, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 5)) +>SFC : Symbol(SFC, Decl(destructuringInitializerContextualTypeFromContext.ts, 0, 0)) +>Props : Symbol(Props, Decl(destructuringInitializerContextualTypeFromContext.ts, 2, 1)) + + children, +>children : Symbol(children, Decl(destructuringInitializerContextualTypeFromContext.ts, 14, 28)) + + name = "Artemis", +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 15, 13)) + + ...props +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 16, 21)) + +}) => `name: ${name} props: ${JSON.stringify(props)}`; +>name : Symbol(name, Decl(destructuringInitializerContextualTypeFromContext.ts, 15, 13)) +>JSON.stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>JSON : Symbol(JSON, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>props : Symbol(props, Decl(destructuringInitializerContextualTypeFromContext.ts, 16, 21)) + diff --git a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types new file mode 100644 index 00000000000..fa76e2eef25 --- /dev/null +++ b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types @@ -0,0 +1,57 @@ +=== tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts === +interface SFC

{ + (props: P & { children?: any }): any | null; +>props : P & { children?: any; } +>children : any +>null : null +} + +interface Props { + name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; +>name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" +} + +const Parent: SFC = ({ +>Parent : SFC +>({ children, name = "Artemis", ...props}) => Child({name, ...props}) : ({ children, name, ...props }: Props & { children?: any; }) => any + + children, +>children : any + + name = "Artemis", +>name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" +>"Artemis" : "Artemis" + + ...props +>props : {} + +}) => Child({name, ...props}); +>Child({name, ...props}) : any +>Child : SFC +>{name, ...props} : { name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; } +>name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" +>props : {} + +const Child: SFC = ({ +>Child : SFC +>({ children, name = "Artemis", ...props}) => `name: ${name} props: ${JSON.stringify(props)}` : ({ children, name, ...props }: Props & { children?: any; }) => string + + children, +>children : any + + name = "Artemis", +>name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" +>"Artemis" : "Artemis" + + ...props +>props : {} + +}) => `name: ${name} props: ${JSON.stringify(props)}`; +>`name: ${name} props: ${JSON.stringify(props)}` : string +>name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" +>JSON.stringify(props) : string +>JSON.stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } +>JSON : JSON +>stringify : { (value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; } +>props : {} + diff --git a/tests/baselines/reference/optionalParameterInDestructuringWithInitializer.types b/tests/baselines/reference/optionalParameterInDestructuringWithInitializer.types index 497bae6993a..7ffbc43b86a 100644 --- a/tests/baselines/reference/optionalParameterInDestructuringWithInitializer.types +++ b/tests/baselines/reference/optionalParameterInDestructuringWithInitializer.types @@ -167,7 +167,7 @@ function func7( {a: {b, c = 6} = {b: 4, c: 5}, d}: {a: {b: number, c?: number}, >b : number >c : number >6 : 6 ->{b: 4, c: 5} : { b: number; c?: number; } +>{b: 4, c: 5} : { b: number; c: number; } >b : number >4 : 4 >c : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index 82c3c8d35a6..8bfc93c3db7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -50,7 +50,7 @@ function foo1( >"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } ->{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } >primary : string >"SomeSkill" : "SomeSkill" >secondary : string @@ -88,7 +88,7 @@ function foo2( >"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } ->{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } >primary : string >"SomeSkill" : "SomeSkill" >secondary : string diff --git a/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts b/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts new file mode 100644 index 00000000000..6153b1e3a80 --- /dev/null +++ b/tests/cases/compiler/destructuringInitializerContextualTypeFromContext.ts @@ -0,0 +1,19 @@ +interface SFC

{ + (props: P & { children?: any }): any | null; +} + +interface Props { + name: "Apollo" | "Artemis" | "Dionysus" | "Persephone"; +} + +const Parent: SFC = ({ + children, + name = "Artemis", + ...props +}) => Child({name, ...props}); + +const Child: SFC = ({ + children, + name = "Artemis", + ...props +}) => `name: ${name} props: ${JSON.stringify(props)}`; \ No newline at end of file From f97a2b3f904b6194deea7166d083ea2b124bcd15 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 12 Dec 2018 15:33:46 -0800 Subject: [PATCH 176/322] Add more tests that verify semantic diagnostics cache --- src/testRunner/unittests/tscWatchMode.ts | 417 ++++++++++++----------- 1 file changed, 213 insertions(+), 204 deletions(-) diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 38acc2963e2..87e3e736367 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -1319,92 +1319,6 @@ export default test;`; } }); - it("updates errors when deep import file changes", () => { - const currentDirectory = "/user/username/projects/myproject"; - const aFile: File = { - path: `${currentDirectory}/a.ts`, - content: `import {B} from './b'; -declare var console: any; -let b = new B(); -console.log(b.c.d);` - }; - const bFile: File = { - path: `${currentDirectory}/b.ts`, - content: `import {C} from './c'; -export class B -{ - c = new C(); -}` - }; - const cFile: File = { - path: `${currentDirectory}/c.ts`, - content: `export class C -{ - d = 1; -}` - }; - const config: File = { - path: `${currentDirectory}/tsconfig.json`, - content: `{}` - }; - const files = [aFile, bFile, cFile, config, libFile]; - const host = createWatchedSystem(files, { currentDirectory }); - const watch = createWatchOfConfigFile("tsconfig.json", host); - checkProgramActualFiles(watch(), [aFile.path, bFile.path, cFile.path, libFile.path]); - checkOutputErrorsInitial(host, emptyArray); - const modifiedTimeOfAJs = host.getModifiedTime(`${currentDirectory}/a.js`); - host.writeFile(cFile.path, cFile.content.replace("d", "d2")); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, [ - getDiagnosticOfFileFromProgram(watch(), aFile.path, aFile.content.lastIndexOf("d"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "d", "C") - ]); - // File a need not be rewritten - assert.equal(host.getModifiedTime(`${currentDirectory}/a.js`), modifiedTimeOfAJs); - }); - - it("updates errors when deep import through declaration file changes", () => { - const currentDirectory = "/user/username/projects/myproject"; - const aFile: File = { - path: `${currentDirectory}/a.ts`, - content: `import {B} from './b'; -declare var console: any; -let b = new B(); -console.log(b.c.d);` - }; - const bFile: File = { - path: `${currentDirectory}/b.d.ts`, - content: `import {C} from './c'; -export class B -{ - c: C; -}` - }; - const cFile: File = { - path: `${currentDirectory}/c.d.ts`, - content: `export class C -{ - d: number; -}` - }; - const config: File = { - path: `${currentDirectory}/tsconfig.json`, - content: `{}` - }; - const files = [aFile, bFile, cFile, config, libFile]; - const host = createWatchedSystem(files, { currentDirectory }); - const watch = createWatchOfConfigFile("tsconfig.json", host); - checkProgramActualFiles(watch(), [aFile.path, bFile.path, cFile.path, libFile.path]); - checkOutputErrorsInitial(host, emptyArray); - const modifiedTimeOfAJs = host.getModifiedTime(`${currentDirectory}/a.js`); - host.writeFile(cFile.path, cFile.content.replace("d", "d2")); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, [ - getDiagnosticOfFileFromProgram(watch(), aFile.path, aFile.content.lastIndexOf("d"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "d", "C") - ]); - // File a need not be rewritten - assert.equal(host.getModifiedTime(`${currentDirectory}/a.js`), modifiedTimeOfAJs); - }); - it("updates errors when strictNullChecks changes", () => { const currentDirectory = "/user/username/projects/myproject"; const aFile: File = { @@ -1477,98 +1391,6 @@ foo().hello` checkOutputErrorsIncremental(host, emptyArray); }); - describe("updates errors when file transitively exported file changes", () => { - const projectLocation = "/user/username/projects/myproject"; - const config: File = { - path: `${projectLocation}/tsconfig.json`, - content: JSON.stringify({ - files: ["app.ts"], - compilerOptions: { baseUrl: "." } - }) - }; - const app: File = { - path: `${projectLocation}/app.ts`, - content: `import { Data } from "lib2/public"; -export class App { - public constructor() { - new Data().test(); - } -}` - }; - const lib2Public: File = { - path: `${projectLocation}/lib2/public.ts`, - content: `export * from "./data";` - }; - const lib2Data: File = { - path: `${projectLocation}/lib2/data.ts`, - content: `import { ITest } from "lib1/public"; -export class Data { - public test() { - const result: ITest = { - title: "title" - } - return result; - } -}` - }; - const lib1Public: File = { - path: `${projectLocation}/lib1/public.ts`, - content: `export * from "./tools/public";` - }; - const lib1ToolsPublic: File = { - path: `${projectLocation}/lib1/tools/public.ts`, - content: `export * from "./tools.interface";` - }; - const lib1ToolsInterface: File = { - path: `${projectLocation}/lib1/tools/tools.interface.ts`, - content: `export interface ITest { - title: string; -}` - }; - - function verifyTransitiveExports(filesWithoutConfig: ReadonlyArray) { - const files = [config, ...filesWithoutConfig]; - const host = createWatchedSystem(files, { currentDirectory: projectLocation }); - const watch = createWatchOfConfigFile(config.path, host); - checkProgramActualFiles(watch(), filesWithoutConfig.map(f => f.path)); - checkOutputErrorsInitial(host, emptyArray); - - host.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramActualFiles(watch(), filesWithoutConfig.map(f => f.path)); - checkOutputErrorsIncremental(host, [ - "lib2/data.ts(5,13): error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'.\n Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?\n" - ]); - - } - it("when there are no circular import and exports", () => { - verifyTransitiveExports([libFile, app, lib2Public, lib2Data, lib1Public, lib1ToolsPublic, lib1ToolsInterface]); - }); - - it("when there are circular import and exports", () => { - const lib2Data: File = { - path: `${projectLocation}/lib2/data.ts`, - content: `import { ITest } from "lib1/public"; import { Data2 } from "./data2"; -export class Data { - public dat?: Data2; public test() { - const result: ITest = { - title: "title" - } - return result; - } -}` - }; - const lib2Data2: File = { - path: `${projectLocation}/lib2/data2.ts`, - content: `import { Data } from "./data"; -export class Data2 { - public dat?: Data; -}` - }; - verifyTransitiveExports([libFile, app, lib2Public, lib2Data, lib2Data2, lib1Public, lib1ToolsPublic, lib1ToolsInterface]); - }); - }); - describe("updates errors in lib file", () => { const currentDirectory = "/user/username/projects/myproject"; const field = "fullscreen"; @@ -1711,6 +1533,11 @@ interface Document { }); describe("Emit times and Error updates in builder after program changes", () => { + const currentDirectory = "/user/username/projects/myproject"; + const config: File = { + path: `${currentDirectory}/tsconfig.json`, + content: `{}` + }; function getOutputFileStampAndError(host: WatchedSystem, watch: Watch, file: File) { const builderProgram = watch.getBuilderProgram(); const state = builderProgram.getState(); @@ -1757,8 +1584,108 @@ interface Document { } } + interface VerifyEmitAndErrorUpdates { + change: (host: WatchedSystem) => void; + getInitialErrors: (watch: Watch) => ReadonlyArray | ReadonlyArray; + getIncrementalErrors: (watch: Watch) => ReadonlyArray | ReadonlyArray; + filesWithNewEmit: ReadonlyArray; + filesWithOnlyErrorRefresh: ReadonlyArray; + filesNotTouched: ReadonlyArray; + configFile?: File; + } + + function verifyEmitAndErrorUpdates({ filesWithNewEmit, filesWithOnlyErrorRefresh, filesNotTouched, configFile = config, change, getInitialErrors, getIncrementalErrors }: VerifyEmitAndErrorUpdates) { + const nonLibFiles = [...filesWithNewEmit, ...filesWithOnlyErrorRefresh, ...filesNotTouched]; + const files = [...nonLibFiles, configFile, libFile]; + const host = createWatchedSystem(files, { currentDirectory }); + const watch = createWatchOfConfigFile("tsconfig.json", host); + checkProgramActualFiles(watch(), [...nonLibFiles.map(f => f.path), libFile.path]); + checkOutputErrorsInitial(host, getInitialErrors(watch)); + const beforeChange = getOutputFileStampsAndErrors(host, watch, nonLibFiles); + change(host); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, getIncrementalErrors(watch)); + const afterChange = getOutputFileStampsAndErrors(host, watch, nonLibFiles); + filesWithNewEmit.forEach(file => verifyOutputFileStampsAndErrors(file, /*emitExpected*/ true, /*errorRefershExpected*/ true, beforeChange, afterChange)); + filesWithOnlyErrorRefresh.forEach(file => verifyOutputFileStampsAndErrors(file, /*emitExpected*/ false, /*errorRefershExpected*/ true, beforeChange, afterChange)); + filesNotTouched.forEach(file => verifyOutputFileStampsAndErrors(file, /*emitExpected*/ false, /*errorRefershExpected*/ false, beforeChange, afterChange)); + } + + describe("deep import changes", () => { + const aFile: File = { + path: `${currentDirectory}/a.ts`, + content: `import {B} from './b'; +declare var console: any; +let b = new B(); +console.log(b.c.d);` + }; + + function verifyDeepImportChange(bFile: File, cFile: File) { + const filesWithNewEmit: File[] = []; + const filesWithOnlyErrorRefresh = [aFile]; + addImportedModule(bFile); + addImportedModule(cFile); + verifyEmitAndErrorUpdates({ + filesWithNewEmit, + filesWithOnlyErrorRefresh, + filesNotTouched: emptyArray, + change: host => host.writeFile(cFile.path, cFile.content.replace("d", "d2")), + getInitialErrors: () => emptyArray, + getIncrementalErrors: watch => [ + getDiagnosticOfFileFromProgram(watch(), aFile.path, aFile.content.lastIndexOf("d"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "d", "C") + ] + }); + + function addImportedModule(file: File) { + if (file.path.endsWith(".d.ts")) { + filesWithOnlyErrorRefresh.push(file); + } + else { + filesWithNewEmit.push(file); + } + } + } + + it("updates errors when deep import file changes", () => { + const bFile: File = { + path: `${currentDirectory}/b.ts`, + content: `import {C} from './c'; +export class B +{ + c = new C(); +}` + }; + const cFile: File = { + path: `${currentDirectory}/c.ts`, + content: `export class C +{ + d = 1; +}` + }; + verifyDeepImportChange(bFile, cFile); + }); + + it("updates errors when deep import through declaration file changes", () => { + const bFile: File = { + path: `${currentDirectory}/b.d.ts`, + content: `import {C} from './c'; +export class B +{ + c: C; +}` + }; + const cFile: File = { + path: `${currentDirectory}/c.d.ts`, + content: `export class C +{ + d: number; +}` + }; + verifyDeepImportChange(bFile, cFile); + }); + }); + it("updates errors in file not exporting a deep multilevel import that changes", () => { - const currentDirectory = "/user/username/projects/myproject"; const aFile: File = { path: `${currentDirectory}/a.ts`, content: `export interface Point { @@ -1798,34 +1725,116 @@ getPoint().c.x;` path: `${currentDirectory}/e.ts`, content: `import "./d";` }; + verifyEmitAndErrorUpdates({ + filesWithNewEmit: [aFile, bFile], + filesWithOnlyErrorRefresh: [cFile, dFile], + filesNotTouched: [eFile], + change: host => host.writeFile(aFile.path, aFile.content.replace("x2", "x")), + getInitialErrors: watch => [ + getDiagnosticOfFileFromProgram(watch(), cFile.path, cFile.content.indexOf("x: 1"), 4, chainDiagnosticMessages( + chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, "x", "Coords"), + Diagnostics.Type_0_is_not_assignable_to_type_1, + "{ x: number; y: number; }", + "Coords" + )), + getDiagnosticOfFileFromProgram(watch(), dFile.path, dFile.content.lastIndexOf("x"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "x", "Coords") + ], + getIncrementalErrors: () => emptyArray + }); + }); + + describe("updates errors when file transitively exported file changes", () => { const config: File = { path: `${currentDirectory}/tsconfig.json`, - content: `{}` + content: JSON.stringify({ + files: ["app.ts"], + compilerOptions: { baseUrl: "." } + }) }; - const directoryFiles = [aFile, bFile, cFile, dFile, eFile]; - const files = [...directoryFiles, config, libFile]; - const host = createWatchedSystem(files, { currentDirectory }); - const watch = createWatchOfConfigFile("tsconfig.json", host); - checkProgramActualFiles(watch(), [aFile.path, bFile.path, cFile.path, dFile.path, eFile.path, libFile.path]); - checkOutputErrorsInitial(host, [ - getDiagnosticOfFileFromProgram(watch(), cFile.path, cFile.content.indexOf("x: 1"), 4, chainDiagnosticMessages( - chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, "x", "Coords"), - Diagnostics.Type_0_is_not_assignable_to_type_1, - "{ x: number; y: number; }", - "Coords" - )), - getDiagnosticOfFileFromProgram(watch(), dFile.path, dFile.content.lastIndexOf("x"), 1, Diagnostics.Property_0_does_not_exist_on_type_1, "x", "Coords") - ]); - const beforeChange = getOutputFileStampsAndErrors(host, watch, directoryFiles); - host.writeFile(aFile.path, aFile.content.replace("x2", "x")); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - const afterChange = getOutputFileStampsAndErrors(host, watch, directoryFiles); - verifyOutputFileStampsAndErrors(aFile, /*emitExpected*/ true, /*errorRefershExpected*/ true, beforeChange, afterChange); - verifyOutputFileStampsAndErrors(bFile, /*emitExpected*/ true, /*errorRefershExpected*/ true, beforeChange, afterChange); - verifyOutputFileStampsAndErrors(cFile, /*emitExpected*/ false, /*errorRefershExpected*/ true, beforeChange, afterChange); - verifyOutputFileStampsAndErrors(dFile, /*emitExpected*/ false, /*errorRefershExpected*/ true, beforeChange, afterChange); - verifyOutputFileStampsAndErrors(eFile, /*emitExpected*/ false, /*errorRefershExpected*/ false, beforeChange, afterChange); + const app: File = { + path: `${currentDirectory}/app.ts`, + content: `import { Data } from "lib2/public"; +export class App { + public constructor() { + new Data().test(); + } +}` + }; + const lib2Public: File = { + path: `${currentDirectory}/lib2/public.ts`, + content: `export * from "./data";` + }; + const lib2Data: File = { + path: `${currentDirectory}/lib2/data.ts`, + content: `import { ITest } from "lib1/public"; +export class Data { + public test() { + const result: ITest = { + title: "title" + } + return result; + } +}` + }; + const lib1Public: File = { + path: `${currentDirectory}/lib1/public.ts`, + content: `export * from "./tools/public";` + }; + const lib1ToolsPublic: File = { + path: `${currentDirectory}/lib1/tools/public.ts`, + content: `export * from "./tools.interface";` + }; + const lib1ToolsInterface: File = { + path: `${currentDirectory}/lib1/tools/tools.interface.ts`, + content: `export interface ITest { + title: string; +}` + }; + + function verifyTransitiveExports(lib2Data: File, lib2Data2?: File) { + const filesWithNewEmit = [lib1ToolsInterface, lib1ToolsPublic]; + const filesWithOnlyErrorRefresh = [app, lib2Public, lib1Public, lib2Data]; + if (lib2Data2) { + filesWithOnlyErrorRefresh.push(lib2Data2); + } + verifyEmitAndErrorUpdates({ + filesWithNewEmit, + filesWithOnlyErrorRefresh, + filesNotTouched: emptyArray, + configFile: config, + change: host => host.writeFile(lib1ToolsInterface.path, lib1ToolsInterface.content.replace("title", "title2")), + getInitialErrors: () => emptyArray, + getIncrementalErrors: () => [ + "lib2/data.ts(5,13): error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'.\n Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?\n" + ] + }); + } + it("when there are no circular import and exports", () => { + verifyTransitiveExports(lib2Data); + }); + + it("when there are circular import and exports", () => { + const lib2Data: File = { + path: `${currentDirectory}/lib2/data.ts`, + content: `import { ITest } from "lib1/public"; import { Data2 } from "./data2"; +export class Data { + public dat?: Data2; public test() { + const result: ITest = { + title: "title" + } + return result; + } +}` + }; + const lib2Data2: File = { + path: `${currentDirectory}/lib2/data2.ts`, + content: `import { Data } from "./data"; +export class Data2 { + public dat?: Data; +}` + }; + verifyTransitiveExports(lib2Data, lib2Data2); + }); }); }); From 1b2ca96aadb6e6bbb4e3ce4551f83f53939b256c Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 13 Dec 2018 19:11:15 +1100 Subject: [PATCH 177/322] Build - List "pretty-hrtime" as a dev dependency in root "package.json". --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 3f5cb1223e9..d8c514363e5 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "mocha": "latest", "mocha-fivemat-progress-reporter": "latest", "plugin-error": "latest", + "pretty-hrtime": "^1.0.3", "prex": "^0.4.3", "q": "latest", "remove-internal": "^2.9.2", From de4803658e91c794fa9f2c81758f09403392a454 Mon Sep 17 00:00:00 2001 From: Kerem Date: Thu, 13 Dec 2018 20:21:36 +0100 Subject: [PATCH 178/322] Disable truncation for codefixes in signatureToMethodDeclaration. (#28188) --- src/services/codefixes/helpers.ts | 2 +- ...ixClassExtendAbstractMethodWithLongName.ts | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/codeFixClassExtendAbstractMethodWithLongName.ts diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index eec693bbb69..461771c0b5e 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -97,7 +97,7 @@ namespace ts.codefix { optional: boolean, body: Block | undefined, ): MethodDeclaration | undefined { - const signatureDeclaration = checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.SuppressAnyReturnType); + const signatureDeclaration = checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.NoTruncation | NodeBuilderFlags.SuppressAnyReturnType); if (!signatureDeclaration) { return undefined; } diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodWithLongName.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodWithLongName.ts new file mode 100644 index 00000000000..dd2eb9c1709 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodWithLongName.ts @@ -0,0 +1,50 @@ +/// + +////namespace some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple { +//// export interface Yah {} +////} +////namespace another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me { +//// export interface Yah {} +////} +////interface this_will_be_collapsed {} +////interface this_is_fine {} +////abstract class AbstractCstVisitor { +//// abstract Node( +//// arg1: [ +//// some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[], +//// another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[] +//// ], +//// arg2: [this_will_be_collapsed], +//// arg3: Set, +//// arg4: this_is_fine +//// ): Set; +////} +////class CstVisitorImplementation extends AbstractCstVisitor {} + +verify.codeFix({ + description: "Implement inherited abstract class", + newFileContent: `namespace some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple { + export interface Yah {} +} +namespace another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me { + export interface Yah {} +} +interface this_will_be_collapsed {} +interface this_is_fine {} +abstract class AbstractCstVisitor { + abstract Node( + arg1: [ + some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[], + another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[] + ], + arg2: [this_will_be_collapsed], + arg3: Set, + arg4: this_is_fine + ): Set; +} +class CstVisitorImplementation extends AbstractCstVisitor { + Node(arg1: [some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[], another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[]], arg2: [this_will_be_collapsed], arg3: any, arg4: this_is_fine) { + throw new Error("Method not implemented."); + } +}` +}); From 43811dd16f0d170d7eb56747cef08639d065147a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 13 Dec 2018 12:13:13 -0800 Subject: [PATCH 179/322] Use getIndexedAccessType when computing destructured types --- src/compiler/checker.ts | 115 ++++++++------------------- src/compiler/diagnosticMessages.json | 12 --- 2 files changed, 35 insertions(+), 92 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index acf5125aa9b..aaec0192f3d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4827,21 +4827,13 @@ namespace ts { mapType(parentType, t => sliceTupleType(t, index)) : createArrayType(elementType); } + else if (isArrayLikeType(parentType)) { + const indexType = getLiteralType(index); + const declaredType = getIndexedAccessType(parentType, indexType, createSyntheticExpression(declaration.name, indexType)); + type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name)); + } else { - // Use specific property type when parent is a tuple or numeric index type when parent is an array - const index = pattern.elements.indexOf(declaration); - type = everyType(parentType, isTupleLikeType) ? - getTupleElementType(parentType, index) || declaration.initializer && checkDeclarationInitializer(declaration) : - elementType; - if (!type) { - if (isTupleType(parentType)) { - error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), getTypeReferenceArity(parentType), pattern.elements.length); - } - else { - error(declaration, Diagnostics.Type_0_has_no_property_1, typeToString(parentType), "" + index); - } - return errorType; - } + type = elementType; } } // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -9523,7 +9515,7 @@ namespace ts { return false; } - function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | undefined, cacheSymbol: boolean, missingType: Type) { + function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression | undefined, cacheSymbol: boolean, missingType: Type) { const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined; const propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) @@ -9626,7 +9618,7 @@ namespace ts { return missingType; } - function getIndexNodeForAccessExpression(accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName) { + function getIndexNodeForAccessExpression(accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression) { return accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode.argumentExpression : accessNode.kind === SyntaxKind.IndexedAccessType @@ -9695,7 +9687,7 @@ namespace ts { return type.simplified = type; } - function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName, missingType = accessNode ? errorType : unknownType): Type { + function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression, missingType = accessNode ? errorType : unknownType): Type { if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } @@ -14628,7 +14620,7 @@ namespace ts { getAccessedPropertyName(source as PropertyAccessExpression | ElementAccessExpression) === getAccessedPropertyName(target) && isMatchingReference((source as PropertyAccessExpression | ElementAccessExpression).expression, target.expression); case SyntaxKind.BindingElement: - if (target.kind === SyntaxKind.PropertyAccessExpression && (target).name.escapedText === getBindingElementNameText(source)) { + if ((isPropertyAccessExpression(target) || isElementAccessExpression(target)) && getBindingElementNameText(source) === getAccessedPropertyName(target)) { const ancestor = source.parent.parent; if (ancestor.kind === SyntaxKind.BindingElement) { return isMatchingReference(ancestor, (target).expression); @@ -22010,21 +22002,17 @@ namespace ts { function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike, allProperties?: NodeArray, rightIsThis = false) { if (property.kind === SyntaxKind.PropertyAssignment || property.kind === SyntaxKind.ShorthandPropertyAssignment) { const name = property.name; - if (name.kind === SyntaxKind.ComputedPropertyName) { - checkComputedPropertyName(name); - } - if (isComputedNonLiteralName(name)) { - return undefined; - } - - const type = getTypeOfObjectLiteralDestructuringProperty(objectLiteralType, name, property, rightIsThis); - if (type) { - // non-shorthand property assignments should always have initializers - return checkDestructuringAssignment(property.kind === SyntaxKind.ShorthandPropertyAssignment ? property : property.initializer, type); - } - else { - error(name, Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), declarationNameToString(name)); + const text = getTextOfPropertyName(name); + if (text) { + const prop = getPropertyOfType(objectLiteralType, text); + if (prop) { + markPropertyAsReferenced(prop, property, rightIsThis); + checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); + } } + const exprType = getLiteralTypeFromPropertyName(name); + const type = getIndexedAccessType(objectLiteralType, exprType, name); + return checkDestructuringAssignment(property.kind === SyntaxKind.ShorthandPropertyAssignment ? property : property.initializer, type); } else if (property.kind === SyntaxKind.SpreadAssignment) { if (languageVersion < ScriptTarget.ESNext) { @@ -22045,31 +22033,11 @@ namespace ts { } } - function getTypeOfObjectLiteralDestructuringProperty(objectLiteralType: Type, name: PropertyName, property: PropertyAssignment | ShorthandPropertyAssignment, rightIsThis: boolean) { - if (isTypeAny(objectLiteralType)) { - return objectLiteralType; - } - - let type: Type | undefined; - const text = getTextOfPropertyName(name); - if (text) { // TODO: GH#26379 - const prop = getPropertyOfType(objectLiteralType, text); - if (prop) { - markPropertyAsReferenced(prop, property, rightIsThis); - checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); - type = getTypeOfSymbol(prop); - } - type = type || (isNumericLiteralName(text) ? getIndexTypeOfType(objectLiteralType, IndexKind.Number) : undefined); - } - return type || getIndexTypeOfType(objectLiteralType, IndexKind.String); - } - function checkArrayLiteralAssignment(node: ArrayLiteralExpression, sourceType: Type, checkMode?: CheckMode): Type { const elements = node.elements; if (languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, ExternalEmitHelpers.Read); } - // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). @@ -22086,39 +22054,26 @@ namespace ts { const element = elements[elementIndex]; if (element.kind !== SyntaxKind.OmittedExpression) { if (element.kind !== SyntaxKind.SpreadElement) { - const propName = "" + elementIndex as __String; - const type = isTypeAny(sourceType) ? sourceType : - everyType(sourceType, isTupleLikeType) ? getTupleElementType(sourceType, elementIndex) : + const indexType = getLiteralType(elementIndex); + const type = isArrayLikeType(sourceType) ? + getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)) : elementType; - if (type) { - return checkDestructuringAssignment(element, type, checkMode); - } - // We still need to check element expression here because we may need to set appropriate flag on the expression - // such as NodeCheckFlags.LexicalThis on "this"expression. - checkExpression(element); - if (isTupleType(sourceType)) { - error(element, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), getTypeReferenceArity(sourceType), elements.length); - } - else { - error(element, Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName as string); - } + return checkDestructuringAssignment(element, type, checkMode); + } + if (elementIndex < elements.length - 1) { + error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } else { - if (elementIndex < elements.length - 1) { - error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + const restExpression = (element).expression; + if (restExpression.kind === SyntaxKind.BinaryExpression && (restExpression).operatorToken.kind === SyntaxKind.EqualsToken) { + error((restExpression).operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); } else { - const restExpression = (element).expression; - if (restExpression.kind === SyntaxKind.BinaryExpression && (restExpression).operatorToken.kind === SyntaxKind.EqualsToken) { - error((restExpression).operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); - } - else { - checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - const type = everyType(sourceType, isTupleType) ? - mapType(sourceType, t => sliceTupleType(t, elementIndex)) : - createArrayType(elementType); - return checkDestructuringAssignment(restExpression, type, checkMode); - } + checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + const type = everyType(sourceType, isTupleType) ? + mapType(sourceType, t => sliceTupleType(t, elementIndex)) : + createArrayType(elementType); + return checkDestructuringAssignment(restExpression, type, checkMode); } } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2cbf5784d07..73ae0b69022 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1636,14 +1636,6 @@ "category": "Error", "code": 2458 }, - "Type '{0}' has no property '{1}' and no string index signature.": { - "category": "Error", - "code": 2459 - }, - "Type '{0}' has no property '{1}'.": { - "category": "Error", - "code": 2460 - }, "Type '{0}' is not an array type.": { "category": "Error", "code": 2461 @@ -1760,10 +1752,6 @@ "category": "Error", "code": 2492 }, - "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'.": { - "category": "Error", - "code": 2493 - }, "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.": { "category": "Error", "code": 2494 From 57ed26409f04d8bafd89238c4d5f010d9d6c7650 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 13 Dec 2018 12:16:24 -0800 Subject: [PATCH 180/322] Accept new baselines --- .../reference/ES5For-of31.errors.txt | 8 ++++---- .../arityAndOrderCompatibility01.errors.txt | 12 +++-------- .../arityAndOrderCompatibility01.types | 8 ++++---- ...putedPropertiesInDestructuring1.errors.txt | 20 ++++++++++++++++++- ...dPropertiesInDestructuring1_ES6.errors.txt | 20 ++++++++++++++++++- .../declarationsAndAssignments.types | 4 ++-- ...ingArrayBindingPatternAndAssignment2.types | 2 +- ...turingThisInTupleDestructuring1.errors.txt | 8 ++++---- ...turingThisInTupleDestructuring2.errors.txt | 4 ++-- .../reference/iterableArrayPattern21.types | 4 ++-- .../baselines/reference/objectRest.errors.txt | 8 +++++++- ...stElementWithAssignmentPattern2.errors.txt | 4 ++-- ...stElementWithAssignmentPattern4.errors.txt | 4 ++-- ...pertyAssignmentsInDestructuring.errors.txt | 8 ++++---- ...yAssignmentsInDestructuring_ES6.errors.txt | 8 ++++---- .../reference/unionsOfTupleTypes1.errors.txt | 16 +++++++-------- .../reference/unionsOfTupleTypes1.types | 12 +++++------ 17 files changed, 93 insertions(+), 57 deletions(-) diff --git a/tests/baselines/reference/ES5For-of31.errors.txt b/tests/baselines/reference/ES5For-of31.errors.txt index 4a49e1fdf92..4424a870071 100644 --- a/tests/baselines/reference/ES5For-of31.errors.txt +++ b/tests/baselines/reference/ES5For-of31.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,8): error TS2459: Type 'undefined' has no property 'a' and no string index signature. -tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,18): error TS2459: Type 'undefined' has no property 'b' and no string index signature. +tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,8): error TS2339: Property 'a' does not exist on type 'undefined'. +tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,18): error TS2339: Property 'b' does not exist on type 'undefined'. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,18): error for ({ a: b = 1, b: a = ""} of []) { ~ -!!! error TS2459: Type 'undefined' has no property 'a' and no string index signature. +!!! error TS2339: Property 'a' does not exist on type 'undefined'. ~ -!!! error TS2459: Type 'undefined' has no property 'b' and no string index signature. +!!! error TS2339: Property 'b' does not exist on type 'undefined'. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt index 50678ea4bb3..5eeaef51566 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt +++ b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt @@ -1,7 +1,5 @@ -tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(15,12): error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. -tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(16,12): error TS2460: Type 'StrNum' has no property '2'. +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(15,12): error TS2339: Property '2' does not exist on type '[string, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,5): error TS2461: Type '{ 0: string; 1: number; length: 2; }' is not an array type. -tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,12): error TS2460: Type '{ 0: string; 1: number; length: 2; }' has no property '2'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(18,5): error TS2741: Property '2' is missing in type '[string, number]' but required in type '[number, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(19,5): error TS2741: Property '2' is missing in type 'StrNum' but required in type '[number, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(20,5): error TS2740: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, number, number]': 2, pop, push, concat, and 16 more. @@ -30,7 +28,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(31,5): error tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error TS2740: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, string]': pop, push, concat, join, and 15 more. -==== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts (19 errors) ==== +==== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts (17 errors) ==== interface StrNum extends Array { 0: string; 1: number; @@ -47,15 +45,11 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var [a, b, c] = x; ~ -!!! error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '2' does not exist on type '[string, number]'. var [d, e, f] = y; - ~ -!!! error TS2460: Type 'StrNum' has no property '2'. var [g, h, i] = z; ~~~~~~~~~ !!! error TS2461: Type '{ 0: string; 1: number; length: 2; }' is not an array type. - ~ -!!! error TS2460: Type '{ 0: string; 1: number; length: 2; }' has no property '2'. var j1: [number, number, number] = x; ~~ !!! error TS2741: Property '2' is missing in type '[string, number]' but required in type '[number, number, number]'. diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.types b/tests/baselines/reference/arityAndOrderCompatibility01.types index d7a0923d964..aa658ba7629 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.types +++ b/tests/baselines/reference/arityAndOrderCompatibility01.types @@ -32,18 +32,18 @@ var z: { var [a, b, c] = x; >a : string >b : number ->c : any +>c : undefined >x : [string, number] var [d, e, f] = y; >d : string >e : number ->f : any +>f : string | number >y : StrNum var [g, h, i] = z; ->g : string ->h : number +>g : any +>h : any >i : any >z : { 0: string; 1: number; length: 2; } diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt index 31b938fb3fb..dc71d916a36 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.errors.txt @@ -10,11 +10,17 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,8): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(24,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(28,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(30,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(31,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2538: Type 'any' cannot be used as an index type. +tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,4): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. -==== tests/cases/compiler/computedPropertiesInDestructuring1.ts (14 errors) ==== +==== tests/cases/compiler/computedPropertiesInDestructuring1.ts (20 errors) ==== // destructuring in variable declarations let foo = "bar"; let {[foo]: bar} = {bar: "bar"}; @@ -63,18 +69,30 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: // destructuring assignment ({[foo]: bar} = {bar: "bar"}); + ~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. ({["bar"]: bar2} = {bar: "bar"}); ({[foo2()]: bar3} = {bar: "bar"}); + ~~~~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo]: bar4}] = [{bar: "bar"}]; + ~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo2()]: bar5}] = [{bar: "bar"}]; + ~~~~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo()]: bar4}] = [{bar: "bar"}]; ~~~~~ !!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. + ~~~~~ +!!! error TS2538: Type 'any' cannot be used as an index type. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; + ~~~~~~~~ +!!! error TS2538: Type 'any' cannot be used as an index type. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt index 610b8e56ab3..b839a209743 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.errors.txt @@ -10,11 +10,17 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS23 tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,8): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,12): error TS2339: Property 'toExponential' does not exist on type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(25,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(29,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(31,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(32,4): error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2538: Type 'any' cannot be used as an index type. +tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,4): error TS2538: Type 'any' cannot be used as an index type. tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'. -==== tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts (14 errors) ==== +==== tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts (20 errors) ==== // destructuring in variable declarations let foo = "bar"; let {[foo]: bar} = {bar: "bar"}; @@ -64,18 +70,30 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23 // destructuring assignment ({[foo]: bar} = {bar: "bar"}); + ~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. ({["bar"]: bar2} = {bar: "bar"}); ({[foo2()]: bar3} = {bar: "bar"}); + ~~~~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo]: bar4}] = [{bar: "bar"}]; + ~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo2()]: bar5}] = [{bar: "bar"}]; + ~~~~~~ +!!! error TS2537: Type '{ bar: string; }' has no matching index signature for type 'string'. [{[foo()]: bar4}] = [{bar: "bar"}]; ~~~~~ !!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures. + ~~~~~ +!!! error TS2538: Type 'any' cannot be used as an index type. [{[(1 + {})]: bar4}] = [{bar: "bar"}]; + ~~~~~~~~ +!!! error TS2538: Type 'any' cannot be used as an index type. ~~~~~~ !!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/declarationsAndAssignments.types b/tests/baselines/reference/declarationsAndAssignments.types index edb00c9879b..89ddd0eb5e5 100644 --- a/tests/baselines/reference/declarationsAndAssignments.types +++ b/tests/baselines/reference/declarationsAndAssignments.types @@ -277,8 +277,8 @@ function f9() { >{} : {} var [c, d] = { 0: 10, 1: 20 }; // Error, not array type ->c : number ->d : number +>c : any +>d : any >{ 0: 10, 1: 20 } : { 0: number; 1: number; } >0 : number >10 : 10 diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types index aa4f3a73b09..77681f8d8c8 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types @@ -42,7 +42,7 @@ var [b3 = "string", b4, b5] = bar(); // Error >b3 : string | Number >"string" : "string" >b4 : Number ->b5 : Number +>b5 : number >bar() : J >bar : () => J diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt b/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt index d0f11d056ca..8fba60b9cd0 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'. -tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2339: Property '1' does not exist on type '[any]'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2339: Property '2' does not exist on type '[any]'. ==== tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts (2 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS24 wrapper((array: [any]) => { [this.test, this.test1, this.test2] = array; // even though there is a compiler error, we should still emit lexical capture for "this" ~~~~~~~~~~ -!!! error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '1' does not exist on type '[any]'. ~~~~~~~~~~ -!!! error TS2493: Tuple type '[any]' with length '1' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '2' does not exist on type '[any]'. }); \ No newline at end of file diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt index 25207e28c79..22a8e1ca63e 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2493: Tuple type '[number, number]' with length '2' cannot be assigned to tuple with length '3'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2339: Property '2' does not exist on type '[number, number]'. ==== tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS24 method() { () => [this.test, this.test1, this.test2] = array1; // even though there is a compiler error, we should still emit lexical capture for "this" ~~~~~~~~~~ -!!! error TS2493: Tuple type '[number, number]' with length '2' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '2' does not exist on type '[number, number]'. } } \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern21.types b/tests/baselines/reference/iterableArrayPattern21.types index aefaec14194..beaa3c48d9d 100644 --- a/tests/baselines/reference/iterableArrayPattern21.types +++ b/tests/baselines/reference/iterableArrayPattern21.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/destructuring/iterableArrayPattern21.ts === var [a, b] = { 0: "", 1: true }; ->a : string ->b : boolean +>a : any +>b : any >{ 0: "", 1: true } : { 0: string; 1: boolean; } >0 : string >"" : "" diff --git a/tests/baselines/reference/objectRest.errors.txt b/tests/baselines/reference/objectRest.errors.txt index 0bbd4b2f84d..02f64fbd4e2 100644 --- a/tests/baselines/reference/objectRest.errors.txt +++ b/tests/baselines/reference/objectRest.errors.txt @@ -3,10 +3,12 @@ tests/cases/conformance/types/rest/objectRest.ts(7,20): error TS2339: Property ' tests/cases/conformance/types/rest/objectRest.ts(43,8): error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. tests/cases/conformance/types/rest/objectRest.ts(43,35): error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. tests/cases/conformance/types/rest/objectRest.ts(43,57): error TS2403: Subsequent variable declarations must have the same type. Variable 'o' must be of type '{ a: number; b: string; }', but here has type '{}'. +tests/cases/conformance/types/rest/objectRest.ts(44,5): error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. +tests/cases/conformance/types/rest/objectRest.ts(44,32): error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. tests/cases/conformance/types/rest/objectRest.ts(44,53): error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: string; }': a, b -==== tests/cases/conformance/types/rest/objectRest.ts (6 errors) ==== +==== tests/cases/conformance/types/rest/objectRest.ts (8 errors) ==== var o = { a: 1, b: 'no' } var { ...clone } = o; var { a, ...justB } = o; @@ -61,6 +63,10 @@ tests/cases/conformance/types/rest/objectRest.ts(44,53): error TS2739: Type '{}' ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o' must be of type '{ a: number; b: string; }', but here has type '{}'. ({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o); + ~~~~~~~~ +!!! error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. + ~~~~~~~~~ +!!! error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. ~ !!! error TS2739: Type '{}' is missing the following properties from type '{ a: number; b: string; }': a, b diff --git a/tests/baselines/reference/restElementWithAssignmentPattern2.errors.txt b/tests/baselines/reference/restElementWithAssignmentPattern2.errors.txt index f9b11b5694c..595e047e4e8 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern2.errors.txt +++ b/tests/baselines/reference/restElementWithAssignmentPattern2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2,10): error TS2322: Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2,18): error TS2459: Type '(string | number)[]' has no property 'b' and no string index signature. +tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2,18): error TS2339: Property 'b' does not exist on type '(string | number)[]'. ==== tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts (2 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts(2 !!! error TS2322: Type 'string | number' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. ~ -!!! error TS2459: Type '(string | number)[]' has no property 'b' and no string index signature. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type '(string | number)[]'. \ No newline at end of file diff --git a/tests/baselines/reference/restElementWithAssignmentPattern4.errors.txt b/tests/baselines/reference/restElementWithAssignmentPattern4.errors.txt index f455d3fc04a..5a4636cf12c 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern4.errors.txt +++ b/tests/baselines/reference/restElementWithAssignmentPattern4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern4.ts(3,18): error TS2459: Type '[string, number]' has no property 'b' and no string index signature. +tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern4.ts(3,18): error TS2339: Property 'b' does not exist on type '[string, number]'. ==== tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern4.ts (1 errors) ==== @@ -6,4 +6,4 @@ tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern4.ts(3 var tuple: [string, number] = ["", 1]; [...{ 0: a = "", b }] = tuple; ~ -!!! error TS2459: Type '[string, number]' has no property 'b' and no string index signature. \ No newline at end of file +!!! error TS2339: Property 'b' does not exist on type '[string, number]'. \ No newline at end of file diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt index 67ecf208561..7d2ebd38c35 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(14,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(20,9): error TS2459: Type '{}' has no property 's1' and no string index signature. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(14,9): error TS2339: Property 's1' does not exist on type '{}'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(20,9): error TS2339: Property 's1' does not exist on type '{}'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(38,9): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(44,12): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(70,5): error TS2322: Type '5' is not assignable to type 'string'. @@ -33,7 +33,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err var s1; for ({ s1 = 5 } of [{}]) { ~~ -!!! error TS2459: Type '{}' has no property 's1' and no string index signature. +!!! error TS2339: Property 's1' does not exist on type '{}'. } }); @@ -41,7 +41,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring.ts(111,14): err var s1; for ({ s1:s1 = 5 } of [{}]) { ~~ -!!! error TS2459: Type '{}' has no property 's1' and no string index signature. +!!! error TS2339: Property 's1' does not exist on type '{}'. } }); diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt index c5937c9d6c4..fa821aa51b6 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(14,9): error TS2459: Type '{}' has no property 's1' and no string index signature. -tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(20,9): error TS2459: Type '{}' has no property 's1' and no string index signature. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(14,9): error TS2339: Property 's1' does not exist on type '{}'. +tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(20,9): error TS2339: Property 's1' does not exist on type '{}'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(38,9): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(44,12): error TS2322: Type '5' is not assignable to type 'string'. tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(70,5): error TS2322: Type '5' is not assignable to type 'string'. @@ -33,7 +33,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): var s1; for ({ s1 = 5 } of [{}]) { ~~ -!!! error TS2459: Type '{}' has no property 's1' and no string index signature. +!!! error TS2339: Property 's1' does not exist on type '{}'. } }); @@ -41,7 +41,7 @@ tests/cases/compiler/shorthandPropertyAssignmentsInDestructuring_ES6.ts(111,14): var s1; for ({ s1:s1 = 5 } of [{}]) { ~~ -!!! error TS2459: Type '{}' has no property 's1' and no string index signature. +!!! error TS2339: Property 's1' does not exist on type '{}'. } }); diff --git a/tests/baselines/reference/unionsOfTupleTypes1.errors.txt b/tests/baselines/reference/unionsOfTupleTypes1.errors.txt index d9cad5f1b11..402dfcad340 100644 --- a/tests/baselines/reference/unionsOfTupleTypes1.errors.txt +++ b/tests/baselines/reference/unionsOfTupleTypes1.errors.txt @@ -1,9 +1,9 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(8,15): error TS2339: Property '2' does not exist on type '[string, number]'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(13,15): error TS2339: Property '2' does not exist on type 'T2'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(27,20): error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(28,20): error TS2460: Type 'T2' has no property '2'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(31,16): error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(32,16): error TS2460: Type 'T2' has no property '2'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(27,20): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(28,20): error TS2339: Property '2' does not exist on type 'T2'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(31,16): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(32,16): error TS2339: Property '2' does not exist on type 'T2'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(37,18): error TS2339: Property '2' does not exist on type '[string, number]'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: Property '2' does not exist on type 'T2'. @@ -41,18 +41,18 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: function f1(t1: T1, t2: T2, t3: T3, t4: T4, x: number) { let [d10, d11, d12] = t1; // string, number ~~~ -!!! error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '2' does not exist on type '[string, number]'. let [d20, d21, d22] = t2; // string | boolean, number | undefined ~~~ -!!! error TS2460: Type 'T2' has no property '2'. +!!! error TS2339: Property '2' does not exist on type 'T2'. let [d30, d31, d32] = t3; // string, number, number let [d40, d41, d42] = t4; // string | boolean, number | undefined, number | undefined [d10, d11, d12] = t1; ~~~ -!!! error TS2493: Tuple type '[string, number]' with length '2' cannot be assigned to tuple with length '3'. +!!! error TS2339: Property '2' does not exist on type '[string, number]'. [d20, d21, d22] = t2; ~~~ -!!! error TS2460: Type 'T2' has no property '2'. +!!! error TS2339: Property '2' does not exist on type 'T2'. [d30, d31, d32] = t3; [d40, d41, d42] = t4; let t10 = t1[0]; // string diff --git a/tests/baselines/reference/unionsOfTupleTypes1.types b/tests/baselines/reference/unionsOfTupleTypes1.types index e44114f5a6a..e0867cd1045 100644 --- a/tests/baselines/reference/unionsOfTupleTypes1.types +++ b/tests/baselines/reference/unionsOfTupleTypes1.types @@ -70,13 +70,13 @@ function f1(t1: T1, t2: T2, t3: T3, t4: T4, x: number) { let [d10, d11, d12] = t1; // string, number >d10 : string >d11 : number ->d12 : any +>d12 : undefined >t1 : [string, number] let [d20, d21, d22] = t2; // string | boolean, number | undefined >d20 : string | boolean >d21 : number | undefined ->d22 : any +>d22 : undefined >t2 : T2 let [d30, d31, d32] = t3; // string, number, number @@ -93,18 +93,18 @@ function f1(t1: T1, t2: T2, t3: T3, t4: T4, x: number) { [d10, d11, d12] = t1; >[d10, d11, d12] = t1 : [string, number] ->[d10, d11, d12] : [string, number, any] +>[d10, d11, d12] : [string, number, undefined] >d10 : string >d11 : number ->d12 : any +>d12 : undefined >t1 : [string, number] [d20, d21, d22] = t2; >[d20, d21, d22] = t2 : T2 ->[d20, d21, d22] : [string | boolean, number | undefined, any] +>[d20, d21, d22] : [string | boolean, number | undefined, undefined] >d20 : string | boolean >d21 : number | undefined ->d22 : any +>d22 : undefined >t2 : T2 [d30, d31, d32] = t3; From 99c7fc4a88660ecb6b364e74be459807672f8170 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Fri, 14 Dec 2018 21:23:46 +0100 Subject: [PATCH 181/322] #28977 Change const enum error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 356ddc2a28e..140575b9436 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -26903,7 +26903,7 @@ namespace ts { return 0; } else if (isConstEnum) { - error(initializer, Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); + error(initializer, Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_const_enums_values); } else if (member.parent.flags & NodeFlags.Ambient) { error(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2cbf5784d07..89498f32d42 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1696,7 +1696,7 @@ "category": "Error", "code": 2473 }, - "In 'const' enum declarations member initializer must be constant expression.": { + "const enum member initializers can only contain literal values and other const enums values.": { "category": "Error", "code": 2474 }, From aadc2cd5f78f589802f4529d26ed44628e02dff2 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Fri, 14 Dec 2018 21:24:04 +0100 Subject: [PATCH 182/322] #28977 Fix test baselines --- tests/baselines/reference/constEnum2.errors.txt | 12 ++++++------ tests/baselines/reference/constEnumErrors.errors.txt | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/baselines/reference/constEnum2.errors.txt b/tests/baselines/reference/constEnum2.errors.txt index cfec4d9055b..536626daf65 100644 --- a/tests/baselines/reference/constEnum2.errors.txt +++ b/tests/baselines/reference/constEnum2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/constEnums/constEnum2.ts(10,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. -tests/cases/conformance/constEnums/constEnum2.ts(11,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. +tests/cases/conformance/constEnums/constEnum2.ts(10,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. +tests/cases/conformance/constEnums/constEnum2.ts(11,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. tests/cases/conformance/constEnums/constEnum2.ts(12,5): error TS1005: ',' expected. -tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. +tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. ==== tests/cases/conformance/constEnums/constEnum2.ts (4 errors) ==== @@ -16,13 +16,13 @@ tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: In 'const' d = 10, e = 199 * Math.floor(Math.random() * 1000), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. +!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. f = d - (100 * Math.floor(Math.random() % 8)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. +!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. g = CONST, ~ !!! error TS1005: ',' expected. ~~~~~ -!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. +!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt index 3763a218336..07ae77cf926 100644 --- a/tests/baselines/reference/constEnumErrors.errors.txt +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/constEnumErrors.ts(1,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/constEnumErrors.ts(5,8): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/constEnumErrors.ts(12,9): error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums. -tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. -tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: In 'const' enum declarations member initializer must be constant expression. +tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. +tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: const enum member initializers can only contain literal values and other const enums values. tests/cases/compiler/constEnumErrors.ts(22,13): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/compiler/constEnumErrors.ts(24,13): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/compiler/constEnumErrors.ts(26,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query. @@ -35,10 +35,10 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member // forward reference to the element of the same enum Y = E1.Z, ~~~~ -!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. +!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. Y1 = E1["Z"] ~~~~~~~ -!!! error TS2474: In 'const' enum declarations member initializer must be constant expression. +!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. } const enum E2 { From 1a5ecbb6ac1f722fe2026adc79e74427eab946b6 Mon Sep 17 00:00:00 2001 From: Ali Sabzevari Date: Fri, 14 Dec 2018 23:42:59 +0100 Subject: [PATCH 183/322] #28977 Change error message according to review comments --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- tests/baselines/reference/constEnum2.errors.txt | 12 ++++++------ tests/baselines/reference/constEnumErrors.errors.txt | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 140575b9436..81f838e6ee5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -26903,7 +26903,7 @@ namespace ts { return 0; } else if (isConstEnum) { - error(initializer, Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_const_enums_values); + error(initializer, Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values); } else if (member.parent.flags & NodeFlags.Ambient) { error(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 89498f32d42..4abdf2b0bb7 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1696,7 +1696,7 @@ "category": "Error", "code": 2473 }, - "const enum member initializers can only contain literal values and other const enums values.": { + "const enum member initializers can only contain literal values and other computed enum values.": { "category": "Error", "code": 2474 }, diff --git a/tests/baselines/reference/constEnum2.errors.txt b/tests/baselines/reference/constEnum2.errors.txt index 536626daf65..4748b1840b8 100644 --- a/tests/baselines/reference/constEnum2.errors.txt +++ b/tests/baselines/reference/constEnum2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/constEnums/constEnum2.ts(10,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. -tests/cases/conformance/constEnums/constEnum2.ts(11,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. +tests/cases/conformance/constEnums/constEnum2.ts(10,9): error TS2474: const enum member initializers can only contain literal values and other computed enum values. +tests/cases/conformance/constEnums/constEnum2.ts(11,9): error TS2474: const enum member initializers can only contain literal values and other computed enum values. tests/cases/conformance/constEnums/constEnum2.ts(12,5): error TS1005: ',' expected. -tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. +tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: const enum member initializers can only contain literal values and other computed enum values. ==== tests/cases/conformance/constEnums/constEnum2.ts (4 errors) ==== @@ -16,13 +16,13 @@ tests/cases/conformance/constEnums/constEnum2.ts(12,9): error TS2474: const enum d = 10, e = 199 * Math.floor(Math.random() * 1000), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. +!!! error TS2474: const enum member initializers can only contain literal values and other computed enum values. f = d - (100 * Math.floor(Math.random() % 8)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. +!!! error TS2474: const enum member initializers can only contain literal values and other computed enum values. g = CONST, ~ !!! error TS1005: ',' expected. ~~~~~ -!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. +!!! error TS2474: const enum member initializers can only contain literal values and other computed enum values. } \ No newline at end of file diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt index 07ae77cf926..0d278197c9b 100644 --- a/tests/baselines/reference/constEnumErrors.errors.txt +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/constEnumErrors.ts(1,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/constEnumErrors.ts(5,8): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/constEnumErrors.ts(12,9): error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums. -tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: const enum member initializers can only contain literal values and other const enums values. -tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: const enum member initializers can only contain literal values and other const enums values. +tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: const enum member initializers can only contain literal values and other computed enum values. +tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: const enum member initializers can only contain literal values and other computed enum values. tests/cases/compiler/constEnumErrors.ts(22,13): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/compiler/constEnumErrors.ts(24,13): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/compiler/constEnumErrors.ts(26,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query. @@ -35,10 +35,10 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member // forward reference to the element of the same enum Y = E1.Z, ~~~~ -!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. +!!! error TS2474: const enum member initializers can only contain literal values and other computed enum values. Y1 = E1["Z"] ~~~~~~~ -!!! error TS2474: const enum member initializers can only contain literal values and other const enums values. +!!! error TS2474: const enum member initializers can only contain literal values and other computed enum values. } const enum E2 { From 92f47a7a7b83a8bc761e4be17426066d4c8ec3d4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 15 Dec 2018 16:49:53 -0800 Subject: [PATCH 184/322] Use synthetic access expressions for destructuring control flow analysis --- src/compiler/checker.ts | 256 ++++++++++++++++++++------------------ src/compiler/types.ts | 2 + src/compiler/utilities.ts | 4 + 3 files changed, 144 insertions(+), 118 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index aaec0192f3d..17c10c01235 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4768,6 +4768,69 @@ namespace ts { return createAnonymousType(symbol, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); } + // Determine the control flow type associated with a destructuring declaration or assignment. The following + // forms of destructuring are possible: + // let { x } = obj; // BindingElement + // let [ x ] = obj; // BindingElement + // { x } = obj; // ShorthandPropertyAssignment + // { x: v } = obj; // PropertyAssignment + // [ x ] = obj; // Expression + // We construct a synthetic element access expression corresponding to 'obj.x' such that the control + // flow analyzer doesn't have to handle all the different syntactic forms. + function getFlowTypeOfDestructuring(node: BindingElement | PropertyAssignment | ShorthandPropertyAssignment | Expression, declaredType: Type) { + const reference = getSyntheticElementAccess(node); + return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; + } + + function getSyntheticElementAccess(node: BindingElement | PropertyAssignment | ShorthandPropertyAssignment | Expression): ElementAccessExpression | undefined { + const parentAccess = getParentElementAccess(node); + if (parentAccess && parentAccess.flowNode) { + const propName = getDestructuringPropertyName(node); + if (propName) { + const result = createNode(SyntaxKind.ElementAccessExpression, node.pos, node.end); + result.parent = node; + result.expression = parentAccess; + const literal = createNode(SyntaxKind.StringLiteral, node.pos, node.end); + literal.parent = result; + literal.text = propName; + result.argumentExpression = literal; + result.flowNode = parentAccess.flowNode; + return result; + } + } + } + + function getParentElementAccess(node: BindingElement | PropertyAssignment | ShorthandPropertyAssignment | Expression) { + const ancestor = node.parent.parent; + switch (ancestor.kind) { + case SyntaxKind.BindingElement: + case SyntaxKind.PropertyAssignment: + return getSyntheticElementAccess(ancestor); + case SyntaxKind.ArrayLiteralExpression: + return getSyntheticElementAccess(node.parent); + case SyntaxKind.VariableDeclaration: + return (ancestor).initializer; + case SyntaxKind.BinaryExpression: + return (ancestor).right; + } + } + + function getDestructuringPropertyName(node: BindingElement | PropertyAssignment | ShorthandPropertyAssignment | Expression) { + const parent = node.parent; + if (node.kind === SyntaxKind.BindingElement && parent.kind === SyntaxKind.ObjectBindingPattern) { + return getLiteralPropertyNameText((node).propertyName || (node).name); + } + if (node.kind === SyntaxKind.PropertyAssignment || node.kind === SyntaxKind.ShorthandPropertyAssignment) { + return getLiteralPropertyNameText((node).name); + } + return "" + (>(parent).elements).indexOf(node); + } + + function getLiteralPropertyNameText(name: PropertyName) { + const type = getLiteralTypeFromPropertyName(name); + return type.flags & (TypeFlags.StringLiteral | TypeFlags.NumberLiteral) ? "" + (type).value : undefined; + } + /** Return the inferred type for a binding element */ function getTypeForBindingElement(declaration: BindingElement): Type | undefined { const pattern = declaration.parent; @@ -4808,9 +4871,9 @@ namespace ts { else { // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) const name = declaration.propertyName || declaration.name; - const exprType = getLiteralTypeFromPropertyName(name); - const declaredType = checkIndexedAccessIndexType(getIndexedAccessType(parentType, exprType, name), name); - type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name)); + const indexType = getLiteralTypeFromPropertyName(name); + const declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); } } else { @@ -4829,8 +4892,8 @@ namespace ts { } else if (isArrayLikeType(parentType)) { const indexType = getLiteralType(index); - const declaredType = getIndexedAccessType(parentType, indexType, createSyntheticExpression(declaration.name, indexType)); - type = getFlowTypeOfReference(declaration, getConstraintForLocation(declaredType, declaration.name)); + const declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, declaration.name), declaration.name); + type = getFlowTypeOfDestructuring(declaration, declaredType); } else { type = elementType; @@ -9515,16 +9578,16 @@ namespace ts { return false; } - function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression | undefined, cacheSymbol: boolean, missingType: Type) { + function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression | undefined, cacheSymbol: boolean, missingType: Type) { const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined; - const propName = isTypeUsableAsLateBoundName(indexType) - ? getLateBoundNameFromType(indexType) - : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) - ? getPropertyNameForKnownSymbolName(idText((accessExpression.argumentExpression).name)) - : accessNode && isPropertyName(accessNode) + const propName = isTypeUsableAsLateBoundName(indexType) ? + getLateBoundNameFromType(indexType) : + accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? + getPropertyNameForKnownSymbolName(idText((accessExpression.argumentExpression).name)) : + accessNode && isPropertyName(accessNode) ? // late bound names are handled in the first branch, so here we only need to handle normal names - ? getPropertyNameForPropertyNameNode(accessNode) - : undefined; + getPropertyNameForPropertyNameNode(accessNode) : + undefined; if (propName !== undefined) { const prop = getPropertyOfType(objectType, propName); if (prop) { @@ -9618,7 +9681,7 @@ namespace ts { return missingType; } - function getIndexNodeForAccessExpression(accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression) { + function getIndexNodeForAccessExpression(accessNode: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression) { return accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode.argumentExpression : accessNode.kind === SyntaxKind.IndexedAccessType @@ -9687,7 +9750,7 @@ namespace ts { return type.simplified = type; } - function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | SyntheticExpression, missingType = accessNode ? errorType : unknownType): Type { + function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode | PropertyName | BindingName | SyntheticExpression, missingType = accessNode ? errorType : unknownType): Type { if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } @@ -14561,49 +14624,23 @@ namespace ts { // occurring in an apparent type position with '@' because the control flow type // of such nodes may be based on the apparent type instead of the declared type. function getFlowCacheKey(node: Node): string | undefined { - if (node.kind === SyntaxKind.Identifier) { - const symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; - } - if (node.kind === SyntaxKind.ThisKeyword) { - return "0"; - } - if (node.kind === SyntaxKind.PropertyAccessExpression) { - const key = getFlowCacheKey((node).expression); - return key && key + "." + idText((node).name); - } - if (node.kind === SyntaxKind.BindingElement) { - const container = (node as BindingElement).parent.parent; - const key = container.kind === SyntaxKind.BindingElement ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); - const text = getBindingElementNameText(node as BindingElement); - const result = key && text && (key + "." + text); - return result; + switch (node.kind) { + case SyntaxKind.Identifier: + const symbol = getResolvedSymbol(node); + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + case SyntaxKind.ThisKeyword: + return "0"; + case SyntaxKind.PropertyAccessExpression: + case SyntaxKind.ElementAccessExpression: + const propName = getAccessedPropertyName(node); + if (propName) { + const key = getFlowCacheKey((node).expression); + return key && key + "." + propName; + } } return undefined; } - function getBindingElementNameText(element: BindingElement): string | undefined { - const parent = element.parent; - if (parent.kind === SyntaxKind.ObjectBindingPattern) { - const name = element.propertyName || element.name; - switch (name.kind) { - case SyntaxKind.Identifier: - return idText(name); - case SyntaxKind.ComputedPropertyName: - return isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined; - case SyntaxKind.StringLiteral: - case SyntaxKind.NumericLiteral: - return name.text; - default: - // Per types, array and object binding patterns remain, however they should never be present if propertyName is not defined - Debug.fail("Unexpected name kind for binding element name"); - } - } - else { - return "" + parent.elements.indexOf(element); - } - } - function isMatchingReference(source: Node, target: Node): boolean { switch (source.kind) { case SyntaxKind.Identifier: @@ -14616,49 +14653,27 @@ namespace ts { return target.kind === SyntaxKind.SuperKeyword; case SyntaxKind.PropertyAccessExpression: case SyntaxKind.ElementAccessExpression: - return (isPropertyAccessExpression(target) || isElementAccessExpression(target)) && - getAccessedPropertyName(source as PropertyAccessExpression | ElementAccessExpression) === getAccessedPropertyName(target) && - isMatchingReference((source as PropertyAccessExpression | ElementAccessExpression).expression, target.expression); - case SyntaxKind.BindingElement: - if ((isPropertyAccessExpression(target) || isElementAccessExpression(target)) && getBindingElementNameText(source) === getAccessedPropertyName(target)) { - const ancestor = source.parent.parent; - if (ancestor.kind === SyntaxKind.BindingElement) { - return isMatchingReference(ancestor, (target).expression); - } - if (ancestor.kind === SyntaxKind.VariableDeclaration) { - const initializer = (ancestor).initializer; - return !!initializer && isMatchingReference(initializer, (target).expression); - } - } + return isAccessExpression(target) && + getAccessedPropertyName(source) === getAccessedPropertyName(target) && + isMatchingReference((source).expression, target.expression); } return false; } - function getAccessedPropertyName(access: PropertyAccessExpression | ElementAccessExpression): __String | undefined { - return isPropertyAccessExpression(access) ? access.name.escapedText : + function getAccessedPropertyName(access: AccessExpression): __String | undefined { + return access.kind === SyntaxKind.PropertyAccessExpression ? access.name.escapedText : isStringLiteral(access.argumentExpression) || isNumericLiteral(access.argumentExpression) ? escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } - function getReferenceParent(source: Node) { - if (source.kind === SyntaxKind.PropertyAccessExpression) { - return (source).expression; - } - if (source.kind === SyntaxKind.BindingElement) { - const ancestor = source.parent.parent; - return ancestor.kind === SyntaxKind.VariableDeclaration ? (ancestor).initializer : ancestor; - } - return undefined; - } - function containsMatchingReference(source: Node, target: Node) { - let parent = getReferenceParent(source); - while (parent) { - if (isMatchingReference(parent, target)) { + while (isAccessExpression(source)) { + source = source.expression; + if (isMatchingReference(source, target)) { return true; } - parent = getReferenceParent(parent); } + return false; } // Return true if target is a property access xxx.yyy, source is a property access xxx.zzz, the declared @@ -14666,18 +14681,21 @@ namespace ts { // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source: Node, target: Node) { - return target.kind === SyntaxKind.PropertyAccessExpression && - containsMatchingReference(source, (target).expression) && - isDiscriminantProperty(getDeclaredTypeOfReference((target).expression), (target).name.escapedText); + return isAccessExpression(target) && + containsMatchingReference(source, target.expression) && + isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), getAccessedPropertyName(target)); } function getDeclaredTypeOfReference(expr: Node): Type | undefined { if (expr.kind === SyntaxKind.Identifier) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === SyntaxKind.PropertyAccessExpression) { - const type = getDeclaredTypeOfReference((expr).expression); - return type && getTypeOfPropertyOfType(type, (expr).name.escapedText); + if (isAccessExpression(expr)) { + const type = getDeclaredTypeOfReference(expr.expression); + if (type) { + const propName = getAccessedPropertyName(expr); + return propName && getTypeOfPropertyOfType(type, propName); + } } return undefined; } @@ -14696,8 +14714,8 @@ namespace ts { return false; } - function isDiscriminantProperty(type: Type | undefined, name: __String) { - if (type && type.flags & TypeFlags.Union) { + function isDiscriminantProperty(type: Type | undefined, name: __String | undefined) { + if (type && name && type.flags & TypeFlags.Union) { const prop = getUnionOrIntersectionProperty(type, name); if (prop && getCheckFlags(prop) & CheckFlags.SyntheticProperty) { if ((prop).isDiscriminantProperty === undefined) { @@ -15503,7 +15521,7 @@ namespace ts { else if (isMatchingReferenceDiscriminant(expr, type)) { type = narrowTypeByDiscriminant( type, - expr as PropertyAccessExpression | ElementAccessExpression, + expr as AccessExpression, t => narrowTypeBySwitchOnDiscriminant(t, flow.switchStatement, flow.clauseStart, flow.clauseEnd)); } else if (expr.kind === SyntaxKind.TypeOfExpression && isMatchingReference(reference, (expr as TypeOfExpression).expression)) { @@ -15623,19 +15641,17 @@ namespace ts { } function isMatchingReferenceDiscriminant(expr: Expression, computedType: Type) { - if (!(computedType.flags & TypeFlags.Union) || - expr.kind !== SyntaxKind.PropertyAccessExpression && expr.kind !== SyntaxKind.ElementAccessExpression) { + if (!(computedType.flags & TypeFlags.Union) || !isAccessExpression(expr)) { return false; } - const access = expr as PropertyAccessExpression | ElementAccessExpression; - const name = getAccessedPropertyName(access); + const name = getAccessedPropertyName(expr); if (!name) { return false; } - return isMatchingReference(reference, access.expression) && isDiscriminantProperty(computedType, name); + return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, name); } - function narrowTypeByDiscriminant(type: Type, access: PropertyAccessExpression | ElementAccessExpression, narrowType: (t: Type) => Type): Type { + function narrowTypeByDiscriminant(type: Type, access: AccessExpression, narrowType: (t: Type) => Type): Type { const propName = getAccessedPropertyName(access); if (!propName) { return type; @@ -15650,7 +15666,7 @@ namespace ts { return getTypeWithFacts(type, assumeTrue ? TypeFacts.Truthy : TypeFacts.Falsy); } if (isMatchingReferenceDiscriminant(expr, declaredType)) { - return narrowTypeByDiscriminant(type, expr, t => getTypeWithFacts(t, assumeTrue ? TypeFacts.Truthy : TypeFacts.Falsy)); + return narrowTypeByDiscriminant(type, expr, t => getTypeWithFacts(t, assumeTrue ? TypeFacts.Truthy : TypeFacts.Falsy)); } if (containsMatchingReferenceDiscriminant(reference, expr)) { return declaredType; @@ -15701,10 +15717,10 @@ namespace ts { return narrowTypeByEquality(type, operator, left, assumeTrue); } if (isMatchingReferenceDiscriminant(left, declaredType)) { - return narrowTypeByDiscriminant(type, left, t => narrowTypeByEquality(t, operator, right, assumeTrue)); + return narrowTypeByDiscriminant(type, left, t => narrowTypeByEquality(t, operator, right, assumeTrue)); } if (isMatchingReferenceDiscriminant(right, declaredType)) { - return narrowTypeByDiscriminant(type, right, t => narrowTypeByEquality(t, operator, left, assumeTrue)); + return narrowTypeByDiscriminant(type, right, t => narrowTypeByEquality(t, operator, left, assumeTrue)); } if (containsMatchingReferenceDiscriminant(reference, left) || containsMatchingReferenceDiscriminant(reference, right)) { return declaredType; @@ -16009,9 +16025,8 @@ namespace ts { } else { const invokedExpression = skipParentheses(callExpression.expression); - if (invokedExpression.kind === SyntaxKind.ElementAccessExpression || invokedExpression.kind === SyntaxKind.PropertyAccessExpression) { - const accessExpression = invokedExpression as ElementAccessExpression | PropertyAccessExpression; - const possibleReference = skipParentheses(accessExpression.expression); + if (isAccessExpression(invokedExpression)) { + const possibleReference = skipParentheses(invokedExpression.expression); if (isMatchingReference(reference, possibleReference)) { return getNarrowedType(type, predicate.type, assumeTrue, isTypeSubtypeOf); } @@ -16954,7 +16969,7 @@ namespace ts { if (parent.kind === SyntaxKind.BinaryExpression && (parent).operatorToken.kind === SyntaxKind.EqualsToken) { const target = (parent).left; if (target.kind === SyntaxKind.PropertyAccessExpression || target.kind === SyntaxKind.ElementAccessExpression) { - const { expression } = target as PropertyAccessExpression | ElementAccessExpression; + const { expression } = target as AccessExpression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && isIdentifier(expression)) { const sourceFile = getSourceFileOfNode(parent); @@ -19703,7 +19718,7 @@ namespace ts { if (node.kind === SyntaxKind.CallExpression) { const callee = skipOuterExpressions(node.expression); if (callee.kind === SyntaxKind.PropertyAccessExpression || callee.kind === SyntaxKind.ElementAccessExpression) { - return (callee as PropertyAccessExpression | ElementAccessExpression).expression; + return (callee as AccessExpression).expression; } } } @@ -21735,7 +21750,7 @@ namespace ts { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & SymbolFlags.Property && (expr.kind === SyntaxKind.PropertyAccessExpression || expr.kind === SyntaxKind.ElementAccessExpression) && - (expr as PropertyAccessExpression | ElementAccessExpression).expression.kind === SyntaxKind.ThisKeyword) { + (expr as AccessExpression).expression.kind === SyntaxKind.ThisKeyword) { // Look for if this is the constructor for the class that `symbol` is a property of. const func = getContainingFunction(expr); if (!(func && func.kind === SyntaxKind.Constructor)) { @@ -21753,7 +21768,7 @@ namespace ts { function isReferenceThroughNamespaceImport(expr: Expression): boolean { if (expr.kind === SyntaxKind.PropertyAccessExpression || expr.kind === SyntaxKind.ElementAccessExpression) { - const node = skipParentheses((expr as PropertyAccessExpression | ElementAccessExpression).expression); + const node = skipParentheses((expr as AccessExpression).expression); if (node.kind === SyntaxKind.Identifier) { const symbol = getNodeLinks(node).resolvedSymbol!; if (symbol.flags & SymbolFlags.Alias) { @@ -22011,7 +22026,8 @@ namespace ts { } } const exprType = getLiteralTypeFromPropertyName(name); - const type = getIndexedAccessType(objectLiteralType, exprType, name); + const elementType = getIndexedAccessType(objectLiteralType, exprType, name); + const type = getFlowTypeOfDestructuring(property, elementType); return checkDestructuringAssignment(property.kind === SyntaxKind.ShorthandPropertyAssignment ? property : property.initializer, type); } else if (property.kind === SyntaxKind.SpreadAssignment) { @@ -22055,10 +22071,14 @@ namespace ts { if (element.kind !== SyntaxKind.OmittedExpression) { if (element.kind !== SyntaxKind.SpreadElement) { const indexType = getLiteralType(elementIndex); - const type = isArrayLikeType(sourceType) ? - getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)) : - elementType; - return checkDestructuringAssignment(element, type, checkMode); + if (isArrayLikeType(sourceType)) { + // We create a synthetic expression so that getIndexedAccessType doesn't get confused + // when the element is a SyntaxKind.ElementAccessExpression. + const elementType = getIndexedAccessType(sourceType, indexType, createSyntheticExpression(element, indexType)); + const type = getFlowTypeOfDestructuring(element, elementType); + return checkDestructuringAssignment(element, type, checkMode); + } + return checkDestructuringAssignment(element, elementType, checkMode); } if (elementIndex < elements.length - 1) { error(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); @@ -26912,7 +26932,7 @@ namespace ts { return nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); case SyntaxKind.ElementAccessExpression: case SyntaxKind.PropertyAccessExpression: - const ex = expr; + const ex = expr; if (isConstantMemberAccess(ex)) { const type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & SymbolFlags.Enum) { @@ -28886,7 +28906,7 @@ namespace ts { return getNodeLinks(node).enumMemberValue; } - function canHaveConstantValue(node: Node): node is EnumMember | PropertyAccessExpression | ElementAccessExpression { + function canHaveConstantValue(node: Node): node is EnumMember | AccessExpression { switch (node.kind) { case SyntaxKind.EnumMember: case SyntaxKind.PropertyAccessExpression: @@ -28896,7 +28916,7 @@ namespace ts { return false; } - function getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined { + function getConstantValue(node: EnumMember | AccessExpression): string | number | undefined { if (node.kind === SyntaxKind.EnumMember) { return getEnumMemberValue(node); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 495465f7032..8047c31930e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1745,6 +1745,8 @@ namespace ts { export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; + export type AccessExpression = PropertyAccessExpression | ElementAccessExpression; + export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 966149f2a6c..fe0d8b84527 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5586,6 +5586,10 @@ namespace ts { return node.kind === SyntaxKind.ElementAccessExpression; } + export function isAccessExpression(node: Node): node is AccessExpression { + return node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.ElementAccessExpression; + } + export function isCallExpression(node: Node): node is CallExpression { return node.kind === SyntaxKind.CallExpression; } From c1ab2b089a5341756831e1590cb1ce2f8ef917db Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 15 Dec 2018 16:50:22 -0800 Subject: [PATCH 185/322] Accept new baselines --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2b78178587e..dfb7acf2aba 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1054,6 +1054,7 @@ declare namespace ts { } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; + type AccessExpression = PropertyAccessExpression | ElementAccessExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; @@ -3350,6 +3351,7 @@ declare namespace ts { function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; function isElementAccessExpression(node: Node): node is ElementAccessExpression; + function isAccessExpression(node: Node): node is AccessExpression; function isCallExpression(node: Node): node is CallExpression; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 0e693f698f2..66d71f2080b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1054,6 +1054,7 @@ declare namespace ts { } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; + type AccessExpression = PropertyAccessExpression | ElementAccessExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; @@ -3350,6 +3351,7 @@ declare namespace ts { function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; function isElementAccessExpression(node: Node): node is ElementAccessExpression; + function isAccessExpression(node: Node): node is AccessExpression; function isCallExpression(node: Node): node is CallExpression; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; From 307a9b66afb593e02af5100412d3aac4191610b6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 16 Dec 2018 07:23:28 -0800 Subject: [PATCH 186/322] Add tests --- .../destructuring/destructuringControlFlow.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts diff --git a/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts b/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts new file mode 100644 index 00000000000..033f2bdb75e --- /dev/null +++ b/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts @@ -0,0 +1,36 @@ +// @strict: true + +function f1(obj: { a?: string }) { + if (obj.a) { + obj = {}; + let a1 = obj["a"]; // string | undefined + let a2 = obj.a; // string | undefined + } +} + +function f2(obj: [number, string] | null[]) { + let a0 = obj[0]; // number | null + let a1 = obj[1]; // string | null + let [b0, b1] = obj; + ([a0, a1] = obj); + if (obj[0] && obj[1]) { + let c0 = obj[0]; // number + let c1 = obj[1]; // string + let [d0, d1] = obj; + ([c0, c1] = obj); + } +} + +function f3(obj: { a?: number, b?: string }) { + if (obj.a && obj.b) { + let { a, b } = obj; // number, string + ({ a, b } = obj); + } +} + +function f4() { + let x: boolean; + ({ x } = 0); // Error + ({ ["x"]: x } = 0); // Error + ({ ["x" + ""]: x } = 0); // Errpr +} From 519e19ae03e033d19ffa89d55a88ead6a59a5b9d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 16 Dec 2018 07:23:37 -0800 Subject: [PATCH 187/322] Accept new baselines --- .../destructuringControlFlow.errors.txt | 47 +++++ .../reference/destructuringControlFlow.js | 71 ++++++++ .../destructuringControlFlow.symbols | 124 ++++++++++++++ .../reference/destructuringControlFlow.types | 160 ++++++++++++++++++ 4 files changed, 402 insertions(+) create mode 100644 tests/baselines/reference/destructuringControlFlow.errors.txt create mode 100644 tests/baselines/reference/destructuringControlFlow.js create mode 100644 tests/baselines/reference/destructuringControlFlow.symbols create mode 100644 tests/baselines/reference/destructuringControlFlow.types diff --git a/tests/baselines/reference/destructuringControlFlow.errors.txt b/tests/baselines/reference/destructuringControlFlow.errors.txt new file mode 100644 index 00000000000..2bc85fdd638 --- /dev/null +++ b/tests/baselines/reference/destructuringControlFlow.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(31,8): error TS2339: Property 'x' does not exist on type 'Number'. +tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(32,9): error TS2339: Property 'x' does not exist on type 'Number'. +tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts(33,9): error TS2537: Type 'Number' has no matching index signature for type 'string'. + + +==== tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts (3 errors) ==== + function f1(obj: { a?: string }) { + if (obj.a) { + obj = {}; + let a1 = obj["a"]; // string | undefined + let a2 = obj.a; // string | undefined + } + } + + function f2(obj: [number, string] | null[]) { + let a0 = obj[0]; // number | null + let a1 = obj[1]; // string | null + let [b0, b1] = obj; + ([a0, a1] = obj); + if (obj[0] && obj[1]) { + let c0 = obj[0]; // number + let c1 = obj[1]; // string + let [d0, d1] = obj; + ([c0, c1] = obj); + } + } + + function f3(obj: { a?: number, b?: string }) { + if (obj.a && obj.b) { + let { a, b } = obj; // number, string + ({ a, b } = obj); + } + } + + function f4() { + let x: boolean; + ({ x } = 0); // Error + ~ +!!! error TS2339: Property 'x' does not exist on type 'Number'. + ({ ["x"]: x } = 0); // Error + ~~~ +!!! error TS2339: Property 'x' does not exist on type 'Number'. + ({ ["x" + ""]: x } = 0); // Errpr + ~~~~~~~~ +!!! error TS2537: Type 'Number' has no matching index signature for type 'string'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringControlFlow.js b/tests/baselines/reference/destructuringControlFlow.js new file mode 100644 index 00000000000..2d02fb5a40f --- /dev/null +++ b/tests/baselines/reference/destructuringControlFlow.js @@ -0,0 +1,71 @@ +//// [destructuringControlFlow.ts] +function f1(obj: { a?: string }) { + if (obj.a) { + obj = {}; + let a1 = obj["a"]; // string | undefined + let a2 = obj.a; // string | undefined + } +} + +function f2(obj: [number, string] | null[]) { + let a0 = obj[0]; // number | null + let a1 = obj[1]; // string | null + let [b0, b1] = obj; + ([a0, a1] = obj); + if (obj[0] && obj[1]) { + let c0 = obj[0]; // number + let c1 = obj[1]; // string + let [d0, d1] = obj; + ([c0, c1] = obj); + } +} + +function f3(obj: { a?: number, b?: string }) { + if (obj.a && obj.b) { + let { a, b } = obj; // number, string + ({ a, b } = obj); + } +} + +function f4() { + let x: boolean; + ({ x } = 0); // Error + ({ ["x"]: x } = 0); // Error + ({ ["x" + ""]: x } = 0); // Errpr +} + + +//// [destructuringControlFlow.js] +"use strict"; +function f1(obj) { + if (obj.a) { + obj = {}; + var a1 = obj["a"]; // string | undefined + var a2 = obj.a; // string | undefined + } +} +function f2(obj) { + var a0 = obj[0]; // number | null + var a1 = obj[1]; // string | null + var b0 = obj[0], b1 = obj[1]; + (a0 = obj[0], a1 = obj[1]); + if (obj[0] && obj[1]) { + var c0 = obj[0]; // number + var c1 = obj[1]; // string + var d0 = obj[0], d1 = obj[1]; + (c0 = obj[0], c1 = obj[1]); + } +} +function f3(obj) { + if (obj.a && obj.b) { + var a = obj.a, b = obj.b; // number, string + (a = obj.a, b = obj.b); + } +} +function f4() { + var _a; + var x; + (x = 0..x); // Error + (x = 0["x"]); // Error + (_a = "x" + "", x = 0[_a]); // Errpr +} diff --git a/tests/baselines/reference/destructuringControlFlow.symbols b/tests/baselines/reference/destructuringControlFlow.symbols new file mode 100644 index 00000000000..75cbfcdb481 --- /dev/null +++ b/tests/baselines/reference/destructuringControlFlow.symbols @@ -0,0 +1,124 @@ +=== tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts === +function f1(obj: { a?: string }) { +>f1 : Symbol(f1, Decl(destructuringControlFlow.ts, 0, 0)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 0, 12)) +>a : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) + + if (obj.a) { +>obj.a : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 0, 12)) +>a : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) + + obj = {}; +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 0, 12)) + + let a1 = obj["a"]; // string | undefined +>a1 : Symbol(a1, Decl(destructuringControlFlow.ts, 3, 11)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 0, 12)) +>"a" : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) + + let a2 = obj.a; // string | undefined +>a2 : Symbol(a2, Decl(destructuringControlFlow.ts, 4, 11)) +>obj.a : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 0, 12)) +>a : Symbol(a, Decl(destructuringControlFlow.ts, 0, 18)) + } +} + +function f2(obj: [number, string] | null[]) { +>f2 : Symbol(f2, Decl(destructuringControlFlow.ts, 6, 1)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) + + let a0 = obj[0]; // number | null +>a0 : Symbol(a0, Decl(destructuringControlFlow.ts, 9, 7)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>0 : Symbol(0) + + let a1 = obj[1]; // string | null +>a1 : Symbol(a1, Decl(destructuringControlFlow.ts, 10, 7)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>1 : Symbol(1) + + let [b0, b1] = obj; +>b0 : Symbol(b0, Decl(destructuringControlFlow.ts, 11, 9)) +>b1 : Symbol(b1, Decl(destructuringControlFlow.ts, 11, 12)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) + + ([a0, a1] = obj); +>a0 : Symbol(a0, Decl(destructuringControlFlow.ts, 9, 7)) +>a1 : Symbol(a1, Decl(destructuringControlFlow.ts, 10, 7)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) + + if (obj[0] && obj[1]) { +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>0 : Symbol(0) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>1 : Symbol(1) + + let c0 = obj[0]; // number +>c0 : Symbol(c0, Decl(destructuringControlFlow.ts, 14, 11)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>0 : Symbol(0) + + let c1 = obj[1]; // string +>c1 : Symbol(c1, Decl(destructuringControlFlow.ts, 15, 11)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) +>1 : Symbol(1) + + let [d0, d1] = obj; +>d0 : Symbol(d0, Decl(destructuringControlFlow.ts, 16, 13)) +>d1 : Symbol(d1, Decl(destructuringControlFlow.ts, 16, 16)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) + + ([c0, c1] = obj); +>c0 : Symbol(c0, Decl(destructuringControlFlow.ts, 14, 11)) +>c1 : Symbol(c1, Decl(destructuringControlFlow.ts, 15, 11)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 8, 12)) + } +} + +function f3(obj: { a?: number, b?: string }) { +>f3 : Symbol(f3, Decl(destructuringControlFlow.ts, 19, 1)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 21, 12)) +>a : Symbol(a, Decl(destructuringControlFlow.ts, 21, 18)) +>b : Symbol(b, Decl(destructuringControlFlow.ts, 21, 30)) + + if (obj.a && obj.b) { +>obj.a : Symbol(a, Decl(destructuringControlFlow.ts, 21, 18)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 21, 12)) +>a : Symbol(a, Decl(destructuringControlFlow.ts, 21, 18)) +>obj.b : Symbol(b, Decl(destructuringControlFlow.ts, 21, 30)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 21, 12)) +>b : Symbol(b, Decl(destructuringControlFlow.ts, 21, 30)) + + let { a, b } = obj; // number, string +>a : Symbol(a, Decl(destructuringControlFlow.ts, 23, 13)) +>b : Symbol(b, Decl(destructuringControlFlow.ts, 23, 16)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 21, 12)) + + ({ a, b } = obj); +>a : Symbol(a, Decl(destructuringControlFlow.ts, 24, 10)) +>b : Symbol(b, Decl(destructuringControlFlow.ts, 24, 13)) +>obj : Symbol(obj, Decl(destructuringControlFlow.ts, 21, 12)) + } +} + +function f4() { +>f4 : Symbol(f4, Decl(destructuringControlFlow.ts, 26, 1)) + + let x: boolean; +>x : Symbol(x, Decl(destructuringControlFlow.ts, 29, 7)) + + ({ x } = 0); // Error +>x : Symbol(x, Decl(destructuringControlFlow.ts, 30, 6)) + + ({ ["x"]: x } = 0); // Error +>["x"] : Symbol(["x"], Decl(destructuringControlFlow.ts, 31, 6)) +>"x" : Symbol(["x"], Decl(destructuringControlFlow.ts, 31, 6)) +>x : Symbol(x, Decl(destructuringControlFlow.ts, 29, 7)) + + ({ ["x" + ""]: x } = 0); // Errpr +>["x" + ""] : Symbol(["x" + ""], Decl(destructuringControlFlow.ts, 32, 6)) +>x : Symbol(x, Decl(destructuringControlFlow.ts, 29, 7)) +} + diff --git a/tests/baselines/reference/destructuringControlFlow.types b/tests/baselines/reference/destructuringControlFlow.types new file mode 100644 index 00000000000..b831d116740 --- /dev/null +++ b/tests/baselines/reference/destructuringControlFlow.types @@ -0,0 +1,160 @@ +=== tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts === +function f1(obj: { a?: string }) { +>f1 : (obj: { a?: string | undefined; }) => void +>obj : { a?: string | undefined; } +>a : string | undefined + + if (obj.a) { +>obj.a : string | undefined +>obj : { a?: string | undefined; } +>a : string | undefined + + obj = {}; +>obj = {} : {} +>obj : { a?: string | undefined; } +>{} : {} + + let a1 = obj["a"]; // string | undefined +>a1 : string | undefined +>obj["a"] : string | undefined +>obj : { a?: string | undefined; } +>"a" : "a" + + let a2 = obj.a; // string | undefined +>a2 : string | undefined +>obj.a : string | undefined +>obj : { a?: string | undefined; } +>a : string | undefined + } +} + +function f2(obj: [number, string] | null[]) { +>f2 : (obj: [number, string] | null[]) => void +>obj : [number, string] | null[] +>null : null + + let a0 = obj[0]; // number | null +>a0 : number | null +>obj[0] : number | null +>obj : [number, string] | null[] +>0 : 0 + + let a1 = obj[1]; // string | null +>a1 : string | null +>obj[1] : string | null +>obj : [number, string] | null[] +>1 : 1 + + let [b0, b1] = obj; +>b0 : number | null +>b1 : string | null +>obj : [number, string] | null[] + + ([a0, a1] = obj); +>([a0, a1] = obj) : [number, string] | null[] +>[a0, a1] = obj : [number, string] | null[] +>[a0, a1] : [number | null, string | null] +>a0 : number | null +>a1 : string | null +>obj : [number, string] | null[] + + if (obj[0] && obj[1]) { +>obj[0] && obj[1] : string | 0 | null +>obj[0] : number | null +>obj : [number, string] | null[] +>0 : 0 +>obj[1] : string | null +>obj : [number, string] | null[] +>1 : 1 + + let c0 = obj[0]; // number +>c0 : number +>obj[0] : number +>obj : [number, string] | null[] +>0 : 0 + + let c1 = obj[1]; // string +>c1 : string +>obj[1] : string +>obj : [number, string] | null[] +>1 : 1 + + let [d0, d1] = obj; +>d0 : number +>d1 : string +>obj : [number, string] | null[] + + ([c0, c1] = obj); +>([c0, c1] = obj) : [number, string] | null[] +>[c0, c1] = obj : [number, string] | null[] +>[c0, c1] : [number, string] +>c0 : number +>c1 : string +>obj : [number, string] | null[] + } +} + +function f3(obj: { a?: number, b?: string }) { +>f3 : (obj: { a?: number | undefined; b?: string | undefined; }) => void +>obj : { a?: number | undefined; b?: string | undefined; } +>a : number | undefined +>b : string | undefined + + if (obj.a && obj.b) { +>obj.a && obj.b : string | 0 | undefined +>obj.a : number | undefined +>obj : { a?: number | undefined; b?: string | undefined; } +>a : number | undefined +>obj.b : string | undefined +>obj : { a?: number | undefined; b?: string | undefined; } +>b : string | undefined + + let { a, b } = obj; // number, string +>a : number +>b : string +>obj : { a?: number | undefined; b?: string | undefined; } + + ({ a, b } = obj); +>({ a, b } = obj) : { a?: number | undefined; b?: string | undefined; } +>{ a, b } = obj : { a?: number | undefined; b?: string | undefined; } +>{ a, b } : { a: number; b: string; } +>a : number +>b : string +>obj : { a?: number | undefined; b?: string | undefined; } + } +} + +function f4() { +>f4 : () => void + + let x: boolean; +>x : boolean + + ({ x } = 0); // Error +>({ x } = 0) : 0 +>{ x } = 0 : 0 +>{ x } : { x: boolean; } +>x : boolean +>0 : 0 + + ({ ["x"]: x } = 0); // Error +>({ ["x"]: x } = 0) : 0 +>{ ["x"]: x } = 0 : 0 +>{ ["x"]: x } : { ["x"]: boolean; } +>["x"] : boolean +>"x" : "x" +>x : boolean +>0 : 0 + + ({ ["x" + ""]: x } = 0); // Errpr +>({ ["x" + ""]: x } = 0) : 0 +>{ ["x" + ""]: x } = 0 : 0 +>{ ["x" + ""]: x } : { [x: string]: boolean; } +>["x" + ""] : boolean +>"x" + "" : string +>"x" : "x" +>"" : "" +>x : boolean +>0 : 0 +} + From 93c0f0ca0fd8d1996e11eccff19d12b29ce8b338 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 17 Dec 2018 14:08:01 -0800 Subject: [PATCH 188/322] isEmptyObjectType should check that argument is not generic mapped type --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 356ddc2a28e..3f129802194 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11386,7 +11386,7 @@ namespace ts { } function isEmptyObjectType(type: Type): boolean { - return type.flags & TypeFlags.Object ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : + return type.flags & TypeFlags.Object ? !isGenericMappedType(type) && isEmptyResolvedType(resolveStructuredTypeMembers(type)) : type.flags & TypeFlags.NonPrimitive ? true : type.flags & TypeFlags.Union ? some((type).types, isEmptyObjectType) : type.flags & TypeFlags.Intersection ? every((type).types, isEmptyObjectType) : @@ -12361,7 +12361,7 @@ namespace ts { } else { // An empty object type is related to any mapped type that includes a '?' modifier. - if (isPartialMappedType(target) && !isGenericMappedType(source) && isEmptyObjectType(source)) { + if (isPartialMappedType(target) && isEmptyObjectType(source)) { return Ternary.True; } if (isGenericMappedType(target)) { From ab797df977398445cd07bec647b055fb52fc8702 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 17 Dec 2018 14:14:54 -0800 Subject: [PATCH 189/322] Add regression test --- tests/cases/compiler/genericIsNeverEmptyObject.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/cases/compiler/genericIsNeverEmptyObject.ts diff --git a/tests/cases/compiler/genericIsNeverEmptyObject.ts b/tests/cases/compiler/genericIsNeverEmptyObject.ts new file mode 100644 index 00000000000..4431e743e95 --- /dev/null +++ b/tests/cases/compiler/genericIsNeverEmptyObject.ts @@ -0,0 +1,11 @@ +// @strict: true + +// Repro from #29067 + +function test(obj: T) { + let { a, ...rest } = obj; + return { ...rest, b: a }; +} + +let o1 = { a: 'hello', x: 42 }; +let o2: { b: string, x: number } = test(o1); From b4545987719e62019e44e1311b70b8beef55b5d1 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 17 Dec 2018 14:15:03 -0800 Subject: [PATCH 190/322] Accept new baselines --- .../reference/genericIsNeverEmptyObject.js | 41 +++++++++++++++++++ .../genericIsNeverEmptyObject.symbols | 33 +++++++++++++++ .../reference/genericIsNeverEmptyObject.types | 36 ++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 tests/baselines/reference/genericIsNeverEmptyObject.js create mode 100644 tests/baselines/reference/genericIsNeverEmptyObject.symbols create mode 100644 tests/baselines/reference/genericIsNeverEmptyObject.types diff --git a/tests/baselines/reference/genericIsNeverEmptyObject.js b/tests/baselines/reference/genericIsNeverEmptyObject.js new file mode 100644 index 00000000000..d914813ed99 --- /dev/null +++ b/tests/baselines/reference/genericIsNeverEmptyObject.js @@ -0,0 +1,41 @@ +//// [genericIsNeverEmptyObject.ts] +// Repro from #29067 + +function test(obj: T) { + let { a, ...rest } = obj; + return { ...rest, b: a }; +} + +let o1 = { a: 'hello', x: 42 }; +let o2: { b: string, x: number } = test(o1); + + +//// [genericIsNeverEmptyObject.js] +"use strict"; +// Repro from #29067 +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; +function test(obj) { + var a = obj.a, rest = __rest(obj, ["a"]); + return __assign({}, rest, { b: a }); +} +var o1 = { a: 'hello', x: 42 }; +var o2 = test(o1); diff --git a/tests/baselines/reference/genericIsNeverEmptyObject.symbols b/tests/baselines/reference/genericIsNeverEmptyObject.symbols new file mode 100644 index 00000000000..21cc6a21ca6 --- /dev/null +++ b/tests/baselines/reference/genericIsNeverEmptyObject.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/genericIsNeverEmptyObject.ts === +// Repro from #29067 + +function test(obj: T) { +>test : Symbol(test, Decl(genericIsNeverEmptyObject.ts, 0, 0)) +>T : Symbol(T, Decl(genericIsNeverEmptyObject.ts, 2, 14)) +>a : Symbol(a, Decl(genericIsNeverEmptyObject.ts, 2, 25)) +>obj : Symbol(obj, Decl(genericIsNeverEmptyObject.ts, 2, 39)) +>T : Symbol(T, Decl(genericIsNeverEmptyObject.ts, 2, 14)) + + let { a, ...rest } = obj; +>a : Symbol(a, Decl(genericIsNeverEmptyObject.ts, 3, 9)) +>rest : Symbol(rest, Decl(genericIsNeverEmptyObject.ts, 3, 12)) +>obj : Symbol(obj, Decl(genericIsNeverEmptyObject.ts, 2, 39)) + + return { ...rest, b: a }; +>rest : Symbol(rest, Decl(genericIsNeverEmptyObject.ts, 3, 12)) +>b : Symbol(b, Decl(genericIsNeverEmptyObject.ts, 4, 21)) +>a : Symbol(a, Decl(genericIsNeverEmptyObject.ts, 3, 9)) +} + +let o1 = { a: 'hello', x: 42 }; +>o1 : Symbol(o1, Decl(genericIsNeverEmptyObject.ts, 7, 3)) +>a : Symbol(a, Decl(genericIsNeverEmptyObject.ts, 7, 10)) +>x : Symbol(x, Decl(genericIsNeverEmptyObject.ts, 7, 22)) + +let o2: { b: string, x: number } = test(o1); +>o2 : Symbol(o2, Decl(genericIsNeverEmptyObject.ts, 8, 3)) +>b : Symbol(b, Decl(genericIsNeverEmptyObject.ts, 8, 9)) +>x : Symbol(x, Decl(genericIsNeverEmptyObject.ts, 8, 20)) +>test : Symbol(test, Decl(genericIsNeverEmptyObject.ts, 0, 0)) +>o1 : Symbol(o1, Decl(genericIsNeverEmptyObject.ts, 7, 3)) + diff --git a/tests/baselines/reference/genericIsNeverEmptyObject.types b/tests/baselines/reference/genericIsNeverEmptyObject.types new file mode 100644 index 00000000000..5d2b4d9d57f --- /dev/null +++ b/tests/baselines/reference/genericIsNeverEmptyObject.types @@ -0,0 +1,36 @@ +=== tests/cases/compiler/genericIsNeverEmptyObject.ts === +// Repro from #29067 + +function test(obj: T) { +>test : (obj: T) => Pick> & { b: string; } +>a : string +>obj : T + + let { a, ...rest } = obj; +>a : string +>rest : Pick> +>obj : T + + return { ...rest, b: a }; +>{ ...rest, b: a } : Pick> & { b: string; } +>rest : Pick> +>b : string +>a : string +} + +let o1 = { a: 'hello', x: 42 }; +>o1 : { a: string; x: number; } +>{ a: 'hello', x: 42 } : { a: string; x: number; } +>a : string +>'hello' : "hello" +>x : number +>42 : 42 + +let o2: { b: string, x: number } = test(o1); +>o2 : { b: string; x: number; } +>b : string +>x : number +>test(o1) : Pick<{ a: string; x: number; }, "x"> & { b: string; } +>test : (obj: T) => Pick> & { b: string; } +>o1 : { a: string; x: number; } + From d2885eab4a94dd52c54b4df004c3706ddde93ad7 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 17 Dec 2018 14:56:48 -0800 Subject: [PATCH 191/322] Add regression test for #29047 (#29066) --- ...eventEmitterPatternWithRecordOfFunction.js | 15 +++++++ ...EmitterPatternWithRecordOfFunction.symbols | 40 +++++++++++++++++++ ...ntEmitterPatternWithRecordOfFunction.types | 21 ++++++++++ ...eventEmitterPatternWithRecordOfFunction.ts | 12 ++++++ 4 files changed, 88 insertions(+) create mode 100644 tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.js create mode 100644 tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.symbols create mode 100644 tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.types create mode 100644 tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts diff --git a/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.js b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.js new file mode 100644 index 00000000000..9fa1d2b3989 --- /dev/null +++ b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.js @@ -0,0 +1,15 @@ +//// [eventEmitterPatternWithRecordOfFunction.ts] +interface A { + emit(event: string, ...args: any[]): boolean; +} + +type Args = F extends (...args: infer A) => void ? A : never; + +type EventMap = Record; + +interface B extends A { + emit(event: Event, ...args: Args): boolean; +} + +//// [eventEmitterPatternWithRecordOfFunction.js] +"use strict"; diff --git a/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.symbols b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.symbols new file mode 100644 index 00000000000..003cb298e18 --- /dev/null +++ b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.symbols @@ -0,0 +1,40 @@ +=== tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts === +interface A { +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 0)) + + emit(event: string, ...args: any[]): boolean; +>emit : Symbol(A.emit, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 13)) +>event : Symbol(event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 1, 9)) +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 1, 23)) +} + +type Args = F extends (...args: infer A) => void ? A : never; +>Args : Symbol(Args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 2, 1)) +>F : Symbol(F, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 10)) +>F : Symbol(F, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 10)) +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 26)) +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 40)) +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 40)) + +type EventMap = Record; +>EventMap : Symbol(EventMap, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 64)) +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +interface B extends A { +>B : Symbol(B, Decl(eventEmitterPatternWithRecordOfFunction.ts, 6, 41)) +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) +>EventMap : Symbol(EventMap, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 64)) +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 0)) + + emit(event: Event, ...args: Args): boolean; +>emit : Symbol(B.emit, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 43)) +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) +>event : Symbol(event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 32)) +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 45)) +>Args : Symbol(Args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 2, 1)) +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) +} diff --git a/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.types b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.types new file mode 100644 index 00000000000..d2d1895780f --- /dev/null +++ b/tests/baselines/reference/eventEmitterPatternWithRecordOfFunction.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts === +interface A { + emit(event: string, ...args: any[]): boolean; +>emit : (event: string, ...args: any[]) => boolean +>event : string +>args : any[] +} + +type Args = F extends (...args: infer A) => void ? A : never; +>Args : Args +>args : A + +type EventMap = Record; +>EventMap : Record + +interface B extends A { + emit(event: Event, ...args: Args): boolean; +>emit : (event: Event, ...args: Args) => boolean +>event : Event +>args : Args +} diff --git a/tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts b/tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts new file mode 100644 index 00000000000..389b0553b22 --- /dev/null +++ b/tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts @@ -0,0 +1,12 @@ +// @strict: true +interface A { + emit(event: string, ...args: any[]): boolean; +} + +type Args = F extends (...args: infer A) => void ? A : never; + +type EventMap = Record; + +interface B extends A { + emit(event: Event, ...args: Args): boolean; +} \ No newline at end of file From 109fcd5d438054ab609efed546939a368de126ce Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 17 Dec 2018 15:06:15 -0800 Subject: [PATCH 192/322] Address CR feedback --- src/compiler/checker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 17c10c01235..b78d54a03be 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14633,7 +14633,7 @@ namespace ts { case SyntaxKind.PropertyAccessExpression: case SyntaxKind.ElementAccessExpression: const propName = getAccessedPropertyName(node); - if (propName) { + if (propName !== undefined) { const key = getFlowCacheKey((node).expression); return key && key + "." + propName; } @@ -14694,7 +14694,7 @@ namespace ts { const type = getDeclaredTypeOfReference(expr.expression); if (type) { const propName = getAccessedPropertyName(expr); - return propName && getTypeOfPropertyOfType(type, propName); + return propName !== undefined ? getTypeOfPropertyOfType(type, propName) : undefined; } } return undefined; @@ -15645,7 +15645,7 @@ namespace ts { return false; } const name = getAccessedPropertyName(expr); - if (!name) { + if (name === undefined) { return false; } return isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, name); @@ -15653,7 +15653,7 @@ namespace ts { function narrowTypeByDiscriminant(type: Type, access: AccessExpression, narrowType: (t: Type) => Type): Type { const propName = getAccessedPropertyName(access); - if (!propName) { + if (propName === undefined) { return type; } const propType = getTypeOfPropertyOfType(type, propName); From 55852c495e85784c384514cfbb31ee7733776338 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 17 Dec 2018 15:52:32 -0800 Subject: [PATCH 193/322] Remove duplicate function from checker --- src/compiler/checker.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 356ddc2a28e..9c802bb9b82 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7158,7 +7158,7 @@ namespace ts { return list.some(property => { const name = property.name && getTextOfPropertyName(property.name); const expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name); - return !!expected && typeIsLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); + return !!expected && isLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); }); } @@ -30937,8 +30937,4 @@ namespace ts { export const LibraryManagedAttributes = "LibraryManagedAttributes" as __String; // tslint:enable variable-name } - - function typeIsLiteralType(type: Type): type is LiteralType { - return !!(type.flags & TypeFlags.Literal); - } } From 54b46d74b5b909e44c81b58e8dd4986a80a0d04f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 17 Dec 2018 15:59:12 -0800 Subject: [PATCH 194/322] Address CR feedback, take two --- src/compiler/checker.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b78d54a03be..b5c477068a4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14681,9 +14681,11 @@ namespace ts { // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source: Node, target: Node) { + let name; return isAccessExpression(target) && containsMatchingReference(source, target.expression) && - isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), getAccessedPropertyName(target)); + (name = getAccessedPropertyName(target)) !== undefined && + isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), name); } function getDeclaredTypeOfReference(expr: Node): Type | undefined { @@ -14714,8 +14716,8 @@ namespace ts { return false; } - function isDiscriminantProperty(type: Type | undefined, name: __String | undefined) { - if (type && name && type.flags & TypeFlags.Union) { + function isDiscriminantProperty(type: Type | undefined, name: __String) { + if (type && type.flags & TypeFlags.Union) { const prop = getUnionOrIntersectionProperty(type, name); if (prop && getCheckFlags(prop) & CheckFlags.SyntheticProperty) { if ((prop).isDiscriminantProperty === undefined) { From ec83a53273da4d75bd1fc58f4fbebdf3ac21b010 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 17 Dec 2018 21:05:06 -0800 Subject: [PATCH 195/322] Update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fbce8186fac..e1c9490f3c4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,11 +90,11 @@ Library files in `built/local/` are updated by running jake ``` -The files in `lib/` are used to bootstrap compilation and usually do not need to be updated. +**Note**: The files in `lib/` are used to bootstrap compilation and usually do not need to be updated. -#### `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` +#### Generated library files -These two files represent the DOM typings and are auto-generated. To make any modifications to them, please submit a PR to https://github.com/Microsoft/TSJS-lib-generator +The files `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` both represent type declarations for the DOM and are auto-generated. To make any modifications to them, you will have to direct changes to https://github.com/Microsoft/TSJS-lib-generator ## Running the Tests From a58f7dfb1e03fd4b25619777a53ba9128e3b38eb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 17 Dec 2018 21:06:00 -0800 Subject: [PATCH 196/322] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1c9490f3c4..97926ed54a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,7 +92,7 @@ jake **Note**: The files in `lib/` are used to bootstrap compilation and usually do not need to be updated. -#### Generated library files +### Modifying generated library files The files `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts` both represent type declarations for the DOM and are auto-generated. To make any modifications to them, you will have to direct changes to https://github.com/Microsoft/TSJS-lib-generator From c5ee5ea7f2440a11886e78b48f3d3010b2aafbaf Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 17 Dec 2018 21:13:23 -0800 Subject: [PATCH 197/322] Update CONTRIBUTING.md --- CONTRIBUTING.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97926ed54a6..683c47817b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,15 +82,22 @@ Your pull request should: * To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration ## Contributing `lib.d.ts` fixes - -The library sources are in: [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib) -Library files in `built/local/` are updated by running -```Shell +There are three relevant locations to be aware of when it comes to TypeScript's library declaration files: + +* `src/lib`: the location of the sources themselves. +* `lib`: the location of the last-known-good (LKG) versions of the files which are updated periodically. +* `built/local`: the build output location, including where `src/lib` files will be copied to. + +Any changes should be made to [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib). **Most** of these files can be updated by hand, with the exception of any generated files (see below). + +Library files in `built/local/` are updated automatically by running the standard build task: + +```sh jake ``` -**Note**: The files in `lib/` are used to bootstrap compilation and usually do not need to be updated. +The files in `lib/` are used to bootstrap compilation and usually **should not** be updated unless publishing a new version or updating the LKG. ### Modifying generated library files From c70cd38e98f98756186a640332c9bdcd8b91825a Mon Sep 17 00:00:00 2001 From: Alexander T Date: Thu, 25 Oct 2018 18:38:13 +0300 Subject: [PATCH 198/322] --downlevelIteration errors should mention using later targets --- src/compiler/checker.ts | 2 +- tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4305227dab7..78726896a95 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25209,7 +25209,7 @@ namespace ts { ? downlevelIteration ? Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator : isIterable - ? Diagnostics.Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators + ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators : Diagnostics.Type_0_is_not_an_array_type : downlevelIteration ? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt index 3a03491f110..316a7a63a3b 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2568: Type 'Set' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2568: Type 'Set' is not an array type. Either use the '--downlevelIteration' compiler option to allow iterating on iterators, or set the '--target' option to 'es2015' or above. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts (1 errors) ==== var union: string | Set for (const e of union) { } ~~~~~ -!!! error TS2568: Type 'Set' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators. \ No newline at end of file +!!! error TS2568: Type 'Set' is not an array type. Either use the '--downlevelIteration' compiler option to allow iterating on iterators, or set the '--target' option to 'es2015' or above. \ No newline at end of file From 7eff4b2eb0c66197e97e1e9b961d8335d4e7e317 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 18 Dec 2018 08:52:21 +0200 Subject: [PATCH 199/322] update baseline --- tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt index 316a7a63a3b..1fde67722db 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2568: Type 'Set' is not an array type. Either use the '--downlevelIteration' compiler option to allow iterating on iterators, or set the '--target' option to 'es2015' or above. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts (1 errors) ==== var union: string | Set for (const e of union) { } ~~~~~ -!!! error TS2568: Type 'Set' is not an array type. Either use the '--downlevelIteration' compiler option to allow iterating on iterators, or set the '--target' option to 'es2015' or above. \ No newline at end of file +!!! error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. \ No newline at end of file From 332c88e57db6a5450b2aae3ef0465d134daffdbc Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 18 Dec 2018 10:39:32 +0200 Subject: [PATCH 200/322] PR feedback: change error #2497 message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f451c91046b..b70d5cf876b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2381,7 +2381,7 @@ namespace ts { ? "allowSyntheticDefaultImports" : "esModuleInterop"; - error(referencingLocation, Diagnostics.When_writing_ECMAScript_imports_callable_export_style_modules_can_only_be_imported_by_turning_on_the_0_flag_and_using_a_default_import, compilerOptionName); + error(referencingLocation, Diagnostics.This_module_can_only_be_imported_with_ECMAScript_imports_by_turning_on_the_0_flag_and_using_a_default_import, compilerOptionName); return symbol; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 907940c4f6a..a27aa17efb9 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1768,7 +1768,7 @@ "category": "Error", "code": 2496 }, - "When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the '{0}' flag and using a default import.": { + "This module can only be imported with ECMAScript imports by turning on the '{0}' flag and using a default import.": { "category": "Error", "code": 2497 }, From 4e46f4b95a7773b290aa8c8e56a01d505d33a4b9 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 18 Dec 2018 10:41:04 +0200 Subject: [PATCH 201/322] update baseline --- .../es6ExportEqualsInterop.errors.txt | 36 +++++++++---------- ...EqualsExportModuleCommonJsError.errors.txt | 4 +-- ...rtEqualsExportModuleEs2015Error.errors.txt | 4 +-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt index bebe3f45940..986aae2245f 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.errors.txt +++ b/tests/baselines/reference/es6ExportEqualsInterop.errors.txt @@ -11,24 +11,24 @@ tests/cases/compiler/main.ts(33,8): error TS1192: Module '"function"' has no def tests/cases/compiler/main.ts(34,8): error TS1192: Module '"function-module"' has no default export. tests/cases/compiler/main.ts(35,8): error TS1192: Module '"class"' has no default export. tests/cases/compiler/main.ts(36,8): error TS1192: Module '"class-module"' has no default export. -tests/cases/compiler/main.ts(39,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. -tests/cases/compiler/main.ts(45,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. -tests/cases/compiler/main.ts(47,21): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(39,21): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(45,21): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(47,21): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(50,1): error TS2693: 'y1' only refers to a type, but is being used as a value here. tests/cases/compiler/main.ts(56,4): error TS2339: Property 'a' does not exist on type '() => any'. tests/cases/compiler/main.ts(58,4): error TS2339: Property 'a' does not exist on type 'typeof Foo'. tests/cases/compiler/main.ts(62,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(62,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(62,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(68,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(68,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(68,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(70,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(70,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(70,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(85,10): error TS2305: Module '"interface"' has no exported member 'a'. -tests/cases/compiler/main.ts(85,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(85,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(91,10): error TS2305: Module '"function"' has no exported member 'a'. -tests/cases/compiler/main.ts(91,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(91,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(93,10): error TS2305: Module '"class"' has no exported member 'a'. -tests/cases/compiler/main.ts(93,25): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(93,25): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. tests/cases/compiler/main.ts(97,15): error TS2498: Module '"interface"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(98,15): error TS2498: Module '"variable"' uses 'export =' and cannot be used with 'export *'. tests/cases/compiler/main.ts(99,15): error TS2498: Module '"interface-variable"' uses 'export =' and cannot be used with 'export *'. @@ -108,7 +108,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses // namespace import import * as y1 from "interface"; ~~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import * as y2 from "variable"; import * as y3 from "interface-variable"; import * as y4 from "module"; @@ -116,11 +116,11 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses import * as y6 from "variable-module"; import * as y7 from "function"; ~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import * as y8 from "function-module"; import * as y9 from "class"; ~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import * as y0 from "class-module"; y1.a; @@ -145,7 +145,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import { a as a2 } from "variable"; import { a as a3 } from "interface-variable"; import { a as a4 } from "module"; @@ -155,13 +155,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import { a as a8 } from "function-module"; import { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. import { a as a0 } from "class-module"; a1; @@ -180,7 +180,7 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"interface"' has no exported member 'a'. ~~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. export { a as a2 } from "variable"; export { a as a3 } from "interface-variable"; export { a as a4 } from "module"; @@ -190,13 +190,13 @@ tests/cases/compiler/main.ts(106,15): error TS2498: Module '"class-module"' uses ~ !!! error TS2305: Module '"function"' has no exported member 'a'. ~~~~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. export { a as a8 } from "function-module"; export { a as a9 } from "class"; ~ !!! error TS2305: Module '"class"' has no exported member 'a'. ~~~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. export { a as a0 } from "class-module"; // export-star diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt index 96d2f55ed27..1c19b4c3104 100644 --- a/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt +++ b/tests/baselines/reference/es6ImportEqualsExportModuleCommonJsError.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +tests/cases/compiler/main.ts(1,20): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. ==== tests/cases/compiler/a.ts (0 errors) ==== @@ -8,7 +8,7 @@ tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript import ==== tests/cases/compiler/main.ts (1 errors) ==== import * as a from "./a"; ~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'esModuleInterop' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'esModuleInterop' flag and using a default import. a; diff --git a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt index ee3e9cfff17..4aa467f8b6a 100644 --- a/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt +++ b/tests/baselines/reference/es6ImportEqualsExportModuleEs2015Error.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/a.ts(2,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'allowSyntheticDefaultImports' flag and using a default import. +tests/cases/compiler/main.ts(1,20): error TS2497: This module can only be imported with ECMAScript imports by turning on the 'allowSyntheticDefaultImports' flag and using a default import. ==== tests/cases/compiler/a.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/main.ts(1,20): error TS2497: When writing ECMAScript import ==== tests/cases/compiler/main.ts (1 errors) ==== import * as a from "./a"; ~~~~~ -!!! error TS2497: When writing ECMAScript imports, callable 'export ='-style modules can only be imported by turning on the 'allowSyntheticDefaultImports' flag and using a default import. +!!! error TS2497: This module can only be imported with ECMAScript imports by turning on the 'allowSyntheticDefaultImports' flag and using a default import. a; From 0d7e3f82d40885a29b42a190e758fa00f194ed97 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 18 Dec 2018 00:56:00 -0800 Subject: [PATCH 202/322] Stretched the error to the end of 'n's --- src/compiler/scanner.ts | 13 ++++++------ ...ntifierStartAfterNumericLiteral.errors.txt | 20 ++++++++++++------- .../identifierStartAfterNumericLiteral.js | 6 ++---- .../identifierStartAfterNumericLiteral.types | 10 ++++------ .../reference/parseBigInt.errors.txt | 12 +++++------ tests/baselines/reference/parseBigInt.js | 6 +++--- tests/baselines/reference/parseBigInt.symbols | 3 --- tests/baselines/reference/parseBigInt.types | 9 +++------ 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 1a6da02bbd0..742ff4a32f1 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -976,7 +976,7 @@ namespace ts { } if (decimalFragment !== undefined || tokenFlags & TokenFlags.Scientific) { - checkForIdentifierStartAfterNumericLiteral(decimalFragment === undefined && !!(tokenFlags & TokenFlags.Scientific)); + checkForIdentifierStartAfterNumericLiteral(start, decimalFragment === undefined && !!(tokenFlags & TokenFlags.Scientific)); return { type: SyntaxKind.NumericLiteral, value: "" + +result // if value is not an integer, it can be safely coerced to a number @@ -985,12 +985,12 @@ namespace ts { else { tokenValue = result; const type = checkBigIntSuffix(); // if value is an integer, check whether it is a bigint - checkForIdentifierStartAfterNumericLiteral(); + checkForIdentifierStartAfterNumericLiteral(start); return { type, value: tokenValue }; } } - function checkForIdentifierStartAfterNumericLiteral(isScientific?: boolean) { + function checkForIdentifierStartAfterNumericLiteral(numericStart: number, isScientific?: boolean) { if (!isIdentifierStart(text.charCodeAt(pos), languageVersion)) { return; } @@ -1000,17 +1000,16 @@ namespace ts { if (length === 1 && text[identifierStart] === "n") { if (isScientific) { - error(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, identifierStart, length); + error(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); } else { - error(Diagnostics.A_bigint_literal_must_be_an_integer, identifierStart, length); + error(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); } } else { error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length); + pos = identifierStart; } - - pos = identifierStart; } function scanOctalDigits(): number { diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt index 2b4884f7303..7482ee62fec 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.errors.txt @@ -9,10 +9,12 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,5): error TS1124: D tests/cases/compiler/identifierStartAfterNumericLiteral.ts(6,6): error TS2538: Type 'null' cannot be used as an index type. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(7,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(8,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,1): error TS1352: A bigint literal cannot use exponential notation. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,3): error TS2304: Cannot find name 'n'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(9,5): error TS2538: Type 'null' cannot be used as an index type. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,1): error TS1352: A bigint literal cannot use exponential notation. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS1124: Digit expected. -tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,5): error TS2304: Cannot find name 'n'. +tests/cases/compiler/identifierStartAfterNumericLiteral.ts(10,7): error TS2538: Type 'null' cannot be used as an index type. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(11,2): error TS2304: Cannot find name 'a'. tests/cases/compiler/identifierStartAfterNumericLiteral.ts(12,4): error TS1351: An identifier or keyword cannot immediately follow a numeric literal. @@ -35,7 +37,7 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS1351: tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS2304: Cannot find name 'abc'. -==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (35 errors) ==== +==== tests/cases/compiler/identifierStartAfterNumericLiteral.ts (37 errors) ==== let valueIn = 3in[null]; ~~ !!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. @@ -67,15 +69,19 @@ tests/cases/compiler/identifierStartAfterNumericLiteral.ts(26,5): error TS2304: ~~ !!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. 3en[null] + ~~~ +!!! error TS1352: A bigint literal cannot use exponential notation. !!! error TS1124: Digit expected. - ~ -!!! error TS2304: Cannot find name 'n'. + ~~~~ +!!! error TS2538: Type 'null' cannot be used as an index type. 123en[null] + ~~~~~ +!!! error TS1352: A bigint literal cannot use exponential notation. !!! error TS1124: Digit expected. - ~ -!!! error TS2304: Cannot find name 'n'. + ~~~~ +!!! error TS2538: Type 'null' cannot be used as an index type. 1a ~ !!! error TS1351: An identifier or keyword cannot immediately follow a numeric literal. diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.js b/tests/baselines/reference/identifierStartAfterNumericLiteral.js index 59ece3e1c7e..a37524489f2 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.js +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.js @@ -37,10 +37,8 @@ a[null]; 123e[null]; 3 in [null]; 123 in [null]; -3e; -n[null]; -123e; -n[null]; +3en[null]; +123en[null]; 1; a; 123; diff --git a/tests/baselines/reference/identifierStartAfterNumericLiteral.types b/tests/baselines/reference/identifierStartAfterNumericLiteral.types index af3399a6d13..41a601874fa 100644 --- a/tests/baselines/reference/identifierStartAfterNumericLiteral.types +++ b/tests/baselines/reference/identifierStartAfterNumericLiteral.types @@ -41,15 +41,13 @@ let valueIn = 3in[null]; >null : null 3en[null] ->3e : 3 ->n[null] : any ->n : any +>3en[null] : any +>3en : 3 >null : null 123en[null] ->123e : 123 ->n[null] : any ->n : any +>123en[null] : any +>123en : 123 >null : null 1a diff --git a/tests/baselines/reference/parseBigInt.errors.txt b/tests/baselines/reference/parseBigInt.errors.txt index 72f98ee0f46..dc791e3325e 100644 --- a/tests/baselines/reference/parseBigInt.errors.txt +++ b/tests/baselines/reference/parseBigInt.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/parseBigInt.ts(51,20): error TS2736: Operator '+' cannot be applied to type '123n'. tests/cases/compiler/parseBigInt.ts(52,23): error TS2736: Operator '+' cannot be applied to type '291n'. tests/cases/compiler/parseBigInt.ts(56,25): error TS1005: ',' expected. -tests/cases/compiler/parseBigInt.ts(57,25): error TS1352: A bigint literal cannot use exponential notation. -tests/cases/compiler/parseBigInt.ts(58,22): error TS1353: A bigint literal must be an integer. -tests/cases/compiler/parseBigInt.ts(59,28): error TS1353: A bigint literal must be an integer. +tests/cases/compiler/parseBigInt.ts(57,22): error TS1352: A bigint literal cannot use exponential notation. +tests/cases/compiler/parseBigInt.ts(58,19): error TS1353: A bigint literal must be an integer. +tests/cases/compiler/parseBigInt.ts(59,26): error TS1353: A bigint literal must be an integer. tests/cases/compiler/parseBigInt.ts(60,23): error TS1177: Binary digit expected. tests/cases/compiler/parseBigInt.ts(61,20): error TS1178: Octal digit expected. tests/cases/compiler/parseBigInt.ts(62,20): error TS1125: Hexadecimal digit expected. @@ -81,13 +81,13 @@ tests/cases/compiler/parseBigInt.ts(70,72): error TS2345: Argument of type '3' i ~ !!! error TS1005: ',' expected. { const scientific = 1e2n; } - ~ + ~~~~ !!! error TS1352: A bigint literal cannot use exponential notation. { const decimal = 4.1n; } - ~ + ~~~~ !!! error TS1353: A bigint literal must be an integer. { const leadingDecimal = .1n; } - ~ + ~~~ !!! error TS1353: A bigint literal must be an integer. const emptyBinary = 0bn; // should error but infer 0n diff --git a/tests/baselines/reference/parseBigInt.js b/tests/baselines/reference/parseBigInt.js index 1e8b06743d5..1ffccb11e64 100644 --- a/tests/baselines/reference/parseBigInt.js +++ b/tests/baselines/reference/parseBigInt.js @@ -123,13 +123,13 @@ const unaryPlusHex = +0x123n; const legacyOct = 0123, n; } { - const scientific = 1e2, n; + const scientific = 1e2n; } { - const decimal = 4.1, n; + const decimal = 4.1n; } { - const leadingDecimal = .1, n; + const leadingDecimal = .1n; } const emptyBinary = 0n; // should error but infer 0n const emptyOct = 0n; // should error but infer 0n diff --git a/tests/baselines/reference/parseBigInt.symbols b/tests/baselines/reference/parseBigInt.symbols index 4649d7d678a..89ce1a8173b 100644 --- a/tests/baselines/reference/parseBigInt.symbols +++ b/tests/baselines/reference/parseBigInt.symbols @@ -131,15 +131,12 @@ const unaryPlusHex = +0x123n; { const scientific = 1e2n; } >scientific : Symbol(scientific, Decl(parseBigInt.ts, 56, 7)) ->n : Symbol(n, Decl(parseBigInt.ts, 56, 24)) { const decimal = 4.1n; } >decimal : Symbol(decimal, Decl(parseBigInt.ts, 57, 7)) ->n : Symbol(n, Decl(parseBigInt.ts, 57, 21)) { const leadingDecimal = .1n; } >leadingDecimal : Symbol(leadingDecimal, Decl(parseBigInt.ts, 58, 7)) ->n : Symbol(n, Decl(parseBigInt.ts, 58, 27)) const emptyBinary = 0bn; // should error but infer 0n >emptyBinary : Symbol(emptyBinary, Decl(parseBigInt.ts, 59, 5)) diff --git a/tests/baselines/reference/parseBigInt.types b/tests/baselines/reference/parseBigInt.types index cbf80b69db0..98a8b0d9c74 100644 --- a/tests/baselines/reference/parseBigInt.types +++ b/tests/baselines/reference/parseBigInt.types @@ -180,18 +180,15 @@ const unaryPlusHex = +0x123n; { const scientific = 1e2n; } >scientific : 100 ->1e2 : 100 ->n : any +>1e2n : 100 { const decimal = 4.1n; } >decimal : 4.1 ->4.1 : 4.1 ->n : any +>4.1n : 4.1 { const leadingDecimal = .1n; } >leadingDecimal : 0.1 ->.1 : 0.1 ->n : any +>.1n : 0.1 const emptyBinary = 0bn; // should error but infer 0n >emptyBinary : 0n From 4f7184a587bfe75c12b5af36dabb34dc42276dee Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 18 Dec 2018 11:34:02 -0800 Subject: [PATCH 203/322] Fix all new lint failures (#29080) --- src/compiler/binder.ts | 2 +- src/compiler/core.ts | 4 ++-- src/compiler/utilities.ts | 2 +- src/harness/fourslash.ts | 2 +- src/harness/harness.ts | 6 ++---- src/services/refactors/extractSymbol.ts | 6 ++---- src/tsserver/server.ts | 15 +++++---------- 7 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 7cb321a95fa..21bc30cfdc8 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -143,7 +143,7 @@ namespace ts { let symbolCount = 0; - let Symbol: { new (flags: SymbolFlags, name: __String): Symbol }; // tslint:disable-line variable-name + let Symbol: new (flags: SymbolFlags, name: __String) => Symbol; // tslint:disable-line variable-name let classifiableNames: UnderscoreEscapedMap; const unreachableFlow: FlowNode = { flags: FlowFlags.Unreachable }; diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 322355117ec..cb9e385b366 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -112,13 +112,13 @@ namespace ts { } // The global Map object. This may not be available, so we must test for it. - declare const Map: { new (): Map } | undefined; + declare const Map: (new () => Map) | undefined; // Internet Explorer's Map doesn't support iteration, so don't use it. // tslint:disable-next-line no-in-operator variable-name export const MapCtr = typeof Map !== "undefined" && "entries" in Map.prototype ? Map : shimMap(); // Keep the class inside a function so it doesn't get compiled if it's not used. - function shimMap(): { new (): Map } { + function shimMap(): new () => Map { class MapIterator { private data: MapLike; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 966149f2a6c..69f63a4a303 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6925,7 +6925,7 @@ namespace ts { export interface ObjectAllocator { getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; - getTokenConstructor(): { new (kind: TKind, pos?: number, end?: number): Token }; + getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; getIdentifierConstructor(): new (kind: SyntaxKind.Identifier, pos?: number, end?: number) => Identifier; getSourceFileConstructor(): new (kind: SyntaxKind.SourceFile, pos?: number, end?: number) => SourceFile; getSymbolConstructor(): new (flags: SymbolFlags, name: __String) => Symbol; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index b02aff523d1..db1c326a504 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -600,7 +600,7 @@ namespace FourSlash { throw new Error("Expected exactly one output from emit of " + this.activeFile.fileName); } - const evaluation = new Function(`${emit.outputFiles[0].text};\r\nreturn (${expr});`)(); + const evaluation = new Function(`${emit.outputFiles[0].text};\r\nreturn (${expr});`)(); // tslint:disable-line:function-constructor if (evaluation !== value) { this.raiseError(`Expected evaluation of expression "${expr}" to equal "${value}", but got "${evaluation}"`); } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index fc275529258..13ef2adbf90 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -28,12 +28,10 @@ var assert: typeof _chai.assert = _chai.assert; }; } -var global: NodeJS.Global = Function("return this").call(undefined); +var global: NodeJS.Global = Function("return this").call(undefined); // tslint:disable-line:function-constructor declare var window: {}; -declare var XMLHttpRequest: { - new(): XMLHttpRequest; -}; +declare var XMLHttpRequest: new() => XMLHttpRequest; interface XMLHttpRequest { readonly readyState: number; readonly responseText: string; diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index c1915a66431..823bd640a59 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -449,8 +449,7 @@ namespace ts.refactor.extractSymbol { case SyntaxKind.ThisKeyword: rangeFacts |= RangeFacts.UsesThis; break; - case SyntaxKind.LabeledStatement: - { + case SyntaxKind.LabeledStatement: { const label = (node).label; (seenLabels || (seenLabels = [])).push(label.escapedText); forEachChild(node, visit); @@ -458,8 +457,7 @@ namespace ts.refactor.extractSymbol { break; } case SyntaxKind.BreakStatement: - case SyntaxKind.ContinueStatement: - { + case SyntaxKind.ContinueStatement: { const label = (node).label; if (label) { if (!contains(seenLabels, label.escapedText)) { diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 66574ceaac1..e5820260d5f 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -388,8 +388,7 @@ namespace ts.server { this.inspectValuePromise!.resolve(response.result); this.inspectValuePromise = undefined; break; - case EventInitializationFailed: - { + case EventInitializationFailed: { const body: protocol.TypesInstallerInitializationFailedEventBody = { message: response.message }; @@ -397,8 +396,7 @@ namespace ts.server { this.event(body, eventName); break; } - case EventBeginInstallTypes: - { + case EventBeginInstallTypes: { const body: protocol.BeginInstallTypesEventBody = { eventId: response.eventId, packages: response.packagesToInstall, @@ -407,8 +405,7 @@ namespace ts.server { this.event(body, eventName); break; } - case EventEndInstallTypes: - { + case EventEndInstallTypes: { if (this.telemetryEnabled) { const body: protocol.TypingsInstalledTelemetryEventBody = { telemetryEventName: "typingsInstalled", @@ -431,13 +428,11 @@ namespace ts.server { this.event(body, eventName); break; } - case ActionInvalidate: - { + case ActionInvalidate: { this.projectService.updateTypingsForProject(response); break; } - case ActionSet: - { + case ActionSet: { if (this.activeRequestCount > 0) { this.activeRequestCount--; } From 67491414f1d343856c0fa8b032bd64b92566f3a5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 18 Dec 2018 11:50:29 -0800 Subject: [PATCH 204/322] Handle intersection types in getWidenedType --- src/compiler/checker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a5f1515b94a..c751c37c6d5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13597,6 +13597,9 @@ namespace ts { // union includes empty object types (e.g. reducing {} | string to just {}). return getUnionType(widenedTypes, some(widenedTypes, isEmptyObjectType) ? UnionReduction.Subtype : UnionReduction.Literal); } + if (type.flags & TypeFlags.Intersection) { + return getIntersectionType(sameMap((type).types, getWidenedType)); + } if (isArrayType(type) || isTupleType(type)) { return createTypeReference((type).target, sameMap((type).typeArguments, getWidenedType)); } From 519c501ea5d4830c5d6d4458a556e2083e2c03ce Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 18 Dec 2018 11:58:06 -0800 Subject: [PATCH 205/322] Add regression test --- .../cases/conformance/types/literal/literalTypeWidening.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cases/conformance/types/literal/literalTypeWidening.ts b/tests/cases/conformance/types/literal/literalTypeWidening.ts index 4c818793142..17daedb3b0e 100644 --- a/tests/cases/conformance/types/literal/literalTypeWidening.ts +++ b/tests/cases/conformance/types/literal/literalTypeWidening.ts @@ -127,3 +127,10 @@ export type LangCode = keyof typeof langCodeSet export const langCodes = keys(langCodeSet) const arr: Obj[] = langCodes.map(code => ({ code })) + +// Repro from #29081 + +function test(obj: T): T { + let { a, ...rest } = obj; + return { a: 'hello', ...rest } as T; +} From 7c2f4b3be826ac180f0b0c4271c003062c192dad Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 18 Dec 2018 11:58:12 -0800 Subject: [PATCH 206/322] Accept new baselines --- .../reference/literalTypeWidening.js | 32 +++++++++++++++++++ .../reference/literalTypeWidening.symbols | 22 +++++++++++++ .../reference/literalTypeWidening.types | 21 ++++++++++++ 3 files changed, 75 insertions(+) diff --git a/tests/baselines/reference/literalTypeWidening.js b/tests/baselines/reference/literalTypeWidening.js index fc805ac6706..93655fe0fc9 100644 --- a/tests/baselines/reference/literalTypeWidening.js +++ b/tests/baselines/reference/literalTypeWidening.js @@ -128,11 +128,38 @@ export type LangCode = keyof typeof langCodeSet export const langCodes = keys(langCodeSet) const arr: Obj[] = langCodes.map(code => ({ code })) + +// Repro from #29081 + +function test(obj: T): T { + let { a, ...rest } = obj; + return { a: 'hello', ...rest } as T; +} //// [literalTypeWidening.js] "use strict"; // Widening vs. non-widening literal types +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +}; exports.__esModule = true; function f1() { var c1 = "hello"; // Widening type "hello" @@ -233,3 +260,8 @@ exports.keys = keys; var langCodeSet = Set('fr', 'en', 'es', 'it', 'nl'); exports.langCodes = keys(langCodeSet); var arr = exports.langCodes.map(function (code) { return ({ code: code }); }); +// Repro from #29081 +function test(obj) { + var a = obj.a, rest = __rest(obj, ["a"]); + return __assign({ a: 'hello' }, rest); +} diff --git a/tests/baselines/reference/literalTypeWidening.symbols b/tests/baselines/reference/literalTypeWidening.symbols index 09b9164c199..4ce9c9a9468 100644 --- a/tests/baselines/reference/literalTypeWidening.symbols +++ b/tests/baselines/reference/literalTypeWidening.symbols @@ -400,3 +400,25 @@ const arr: Obj[] = langCodes.map(code => ({ code })) >code : Symbol(code, Decl(literalTypeWidening.ts, 128, 33)) >code : Symbol(code, Decl(literalTypeWidening.ts, 128, 43)) +// Repro from #29081 + +function test(obj: T): T { +>test : Symbol(test, Decl(literalTypeWidening.ts, 128, 52)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 132, 14)) +>a : Symbol(a, Decl(literalTypeWidening.ts, 132, 25)) +>b : Symbol(b, Decl(literalTypeWidening.ts, 132, 36)) +>obj : Symbol(obj, Decl(literalTypeWidening.ts, 132, 50)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 132, 14)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 132, 14)) + + let { a, ...rest } = obj; +>a : Symbol(a, Decl(literalTypeWidening.ts, 133, 9)) +>rest : Symbol(rest, Decl(literalTypeWidening.ts, 133, 12)) +>obj : Symbol(obj, Decl(literalTypeWidening.ts, 132, 50)) + + return { a: 'hello', ...rest } as T; +>a : Symbol(a, Decl(literalTypeWidening.ts, 134, 12)) +>rest : Symbol(rest, Decl(literalTypeWidening.ts, 133, 12)) +>T : Symbol(T, Decl(literalTypeWidening.ts, 132, 14)) +} + diff --git a/tests/baselines/reference/literalTypeWidening.types b/tests/baselines/reference/literalTypeWidening.types index 51813d726f1..a96ddc8c5da 100644 --- a/tests/baselines/reference/literalTypeWidening.types +++ b/tests/baselines/reference/literalTypeWidening.types @@ -433,3 +433,24 @@ const arr: Obj[] = langCodes.map(code => ({ code })) >{ code } : { code: "fr" | "en" | "es" | "it" | "nl"; } >code : "fr" | "en" | "es" | "it" | "nl" +// Repro from #29081 + +function test(obj: T): T { +>test : (obj: T) => T +>a : string +>b : string +>obj : T + + let { a, ...rest } = obj; +>a : string +>rest : Pick> +>obj : T + + return { a: 'hello', ...rest } as T; +>{ a: 'hello', ...rest } as T : T +>{ a: 'hello', ...rest } : { a: string; } & Pick> +>a : string +>'hello' : "hello" +>rest : Pick> +} + From 4e3bc9e35a155f52eef67e2ce49af46416f124b9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 18 Dec 2018 12:31:53 -0800 Subject: [PATCH 207/322] Reset constEnumOnlyModule flag on relevant symbol merges in binder (#29079) --- src/compiler/binder.ts | 5 +++ ...tClassMergedWithConstNamespaceNotElided.js | 25 +++++++++++ ...sMergedWithConstNamespaceNotElided.symbols | 37 +++++++++++++++++ ...assMergedWithConstNamespaceNotElided.types | 41 +++++++++++++++++++ ...tClassMergedWithConstNamespaceNotElided.ts | 18 ++++++++ 5 files changed, 126 insertions(+) create mode 100644 tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.js create mode 100644 tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.symbols create mode 100644 tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.types create mode 100644 tests/cases/compiler/emitClassMergedWithConstNamespaceNotElided.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 21bc30cfdc8..7216af4e817 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -233,6 +233,11 @@ namespace ts { symbol.members = createSymbolTable(); } + // On merge of const enum module with class or function, reset const enum only flag (namespaces will already recalculate) + if (symbol.constEnumOnlyModule && (symbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.RegularEnum))) { + symbol.constEnumOnlyModule = false; + } + if (symbolFlags & SymbolFlags.Value) { setValueDeclaration(symbol, node); } diff --git a/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.js b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.js new file mode 100644 index 00000000000..953f5c1508d --- /dev/null +++ b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/emitClassMergedWithConstNamespaceNotElided.ts] //// + +//// [enum.d.ts] +export namespace Clone { + const enum LOCAL { + AUTO = 0, + LOCAL = 1, + NO_LOCAL = 2, + NO_LINKS = 3 + } +} + +export class Clone { + static clone(url: string): void; +} +//// [usage.ts] +import {Clone} from "./enum"; + +Clone.clone("ok"); + +//// [usage.js] +"use strict"; +exports.__esModule = true; +var enum_1 = require("./enum"); +enum_1.Clone.clone("ok"); diff --git a/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.symbols b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.symbols new file mode 100644 index 00000000000..a6a624d5e61 --- /dev/null +++ b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/enum.d.ts === +export namespace Clone { +>Clone : Symbol(Clone, Decl(enum.d.ts, 0, 0), Decl(enum.d.ts, 7, 1)) + + const enum LOCAL { +>LOCAL : Symbol(LOCAL, Decl(enum.d.ts, 0, 24)) + + AUTO = 0, +>AUTO : Symbol(LOCAL.AUTO, Decl(enum.d.ts, 1, 22)) + + LOCAL = 1, +>LOCAL : Symbol(LOCAL.LOCAL, Decl(enum.d.ts, 2, 17)) + + NO_LOCAL = 2, +>NO_LOCAL : Symbol(LOCAL.NO_LOCAL, Decl(enum.d.ts, 3, 18)) + + NO_LINKS = 3 +>NO_LINKS : Symbol(LOCAL.NO_LINKS, Decl(enum.d.ts, 4, 21)) + } +} + +export class Clone { +>Clone : Symbol(Clone, Decl(enum.d.ts, 0, 0), Decl(enum.d.ts, 7, 1)) + + static clone(url: string): void; +>clone : Symbol(Clone.clone, Decl(enum.d.ts, 9, 20)) +>url : Symbol(url, Decl(enum.d.ts, 10, 17)) +} +=== tests/cases/compiler/usage.ts === +import {Clone} from "./enum"; +>Clone : Symbol(Clone, Decl(usage.ts, 0, 8)) + +Clone.clone("ok"); +>Clone.clone : Symbol(Clone.clone, Decl(enum.d.ts, 9, 20)) +>Clone : Symbol(Clone, Decl(usage.ts, 0, 8)) +>clone : Symbol(Clone.clone, Decl(enum.d.ts, 9, 20)) + diff --git a/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.types b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.types new file mode 100644 index 00000000000..582c128d608 --- /dev/null +++ b/tests/baselines/reference/emitClassMergedWithConstNamespaceNotElided.types @@ -0,0 +1,41 @@ +=== tests/cases/compiler/enum.d.ts === +export namespace Clone { + const enum LOCAL { +>LOCAL : LOCAL + + AUTO = 0, +>AUTO : LOCAL.AUTO +>0 : 0 + + LOCAL = 1, +>LOCAL : LOCAL.LOCAL +>1 : 1 + + NO_LOCAL = 2, +>NO_LOCAL : LOCAL.NO_LOCAL +>2 : 2 + + NO_LINKS = 3 +>NO_LINKS : LOCAL.NO_LINKS +>3 : 3 + } +} + +export class Clone { +>Clone : Clone + + static clone(url: string): void; +>clone : (url: string) => void +>url : string +} +=== tests/cases/compiler/usage.ts === +import {Clone} from "./enum"; +>Clone : typeof Clone + +Clone.clone("ok"); +>Clone.clone("ok") : void +>Clone.clone : (url: string) => void +>Clone : typeof Clone +>clone : (url: string) => void +>"ok" : "ok" + diff --git a/tests/cases/compiler/emitClassMergedWithConstNamespaceNotElided.ts b/tests/cases/compiler/emitClassMergedWithConstNamespaceNotElided.ts new file mode 100644 index 00000000000..e34dcc33463 --- /dev/null +++ b/tests/cases/compiler/emitClassMergedWithConstNamespaceNotElided.ts @@ -0,0 +1,18 @@ +// @esModuleInterop: true +// @filename: enum.d.ts +export namespace Clone { + const enum LOCAL { + AUTO = 0, + LOCAL = 1, + NO_LOCAL = 2, + NO_LINKS = 3 + } +} + +export class Clone { + static clone(url: string): void; +} +// @filename: usage.ts +import {Clone} from "./enum"; + +Clone.clone("ok"); \ No newline at end of file From c05bfb774f7edc46e85d402ef64c0c959635f149 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 18 Dec 2018 15:21:44 -0800 Subject: [PATCH 208/322] Adjust travis branch spec to capture all release branches (#29086) --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20b47dbe30c..0f720b7375e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,7 @@ matrix: branches: only: - master - - release-2.7 - - release-2.8 - - release-2.9 - - release-3.0 - - release-3.1 + - /^release-.*/ install: - npm uninstall typescript --no-save From fd7fd133e28908b8911389a9acca53ac41a288a0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 18 Dec 2018 16:41:02 -0800 Subject: [PATCH 209/322] Fix the up-to-date-ness checks of sucessive `gulp` invocations (#29088) --- scripts/build/project.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/build/project.js b/scripts/build/project.js index 0375faa2820..6c1ac0f3e04 100644 --- a/scripts/build/project.js +++ b/scripts/build/project.js @@ -683,11 +683,17 @@ function ensureCompileTask(projectGraph, options) { } }); } - const js = (projectGraphConfig.resolvedOptions.js ? projectGraphConfig.resolvedOptions.js(stream.js) : stream.js) + + const additionalJsOutputs = projectGraphConfig.resolvedOptions.js ? projectGraphConfig.resolvedOptions.js(stream.js) + .pipe(gulpif(sourceMap || inlineSourceMap, sourcemaps.write(sourceMapPath, sourceMapOptions))) : undefined; + const additionalDtsOutputs = projectGraphConfig.resolvedOptions.dts ? projectGraphConfig.resolvedOptions.dts(stream.dts) + .pipe(gulpif(declarationMap, sourcemaps.write(sourceMapPath, sourceMapOptions))) : undefined; + + const js = stream.js .pipe(gulpif(sourceMap || inlineSourceMap, sourcemaps.write(sourceMapPath, sourceMapOptions))); - const dts = (projectGraphConfig.resolvedOptions.dts ? projectGraphConfig.resolvedOptions.dts(stream.dts) : stream.dts) + const dts = stream.dts .pipe(gulpif(declarationMap, sourcemaps.write(sourceMapPath, sourceMapOptions))); - return merge2([js, dts]) + return merge2([js, dts, additionalJsOutputs, additionalDtsOutputs].filter(x => !!x)) .pipe(gulp.dest(destPath)); }); } From d23effc200cc31b464dfce5096860d484d19694d Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 18 Dec 2018 17:02:34 -0800 Subject: [PATCH 210/322] Non-latebound computed property names should print as their underlying name type (#29084) --- src/compiler/checker.ts | 35 ++++++++++----- ...clarationEmitComputedNameConstEnumAlias.js | 44 +++++++++++++++++++ ...tionEmitComputedNameConstEnumAlias.symbols | 23 ++++++++++ ...rationEmitComputedNameConstEnumAlias.types | 27 ++++++++++++ .../parserComputedPropertyName35.types | 2 +- ...clarationEmitComputedNameConstEnumAlias.ts | 14 ++++++ 6 files changed, 134 insertions(+), 11 deletions(-) create mode 100644 tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.js create mode 100644 tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.symbols create mode 100644 tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.types create mode 100644 tests/cases/compiler/declarationEmitComputedNameConstEnumAlias.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c751c37c6d5..787604b3d41 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4426,6 +4426,22 @@ namespace ts { return location.kind === SyntaxKind.SourceFile || isAmbientModule(location); } + function getNameOfSymbolFromNameType(symbol: Symbol, context?: NodeBuilderContext) { + const nameType = symbol.nameType; + if (nameType) { + if (nameType.flags & TypeFlags.StringOrNumberLiteral) { + const name = "" + (nameType).value; + if (!isIdentifierText(name, compilerOptions.target) && !isNumericLiteralName(name)) { + return `"${escapeString(name, CharacterCodes.doubleQuote)}"`; + } + return name; + } + if (nameType.flags & TypeFlags.UniqueESSymbol) { + return `[${getNameOfSymbolAsWritten((nameType).symbol, context)}]`; + } + } + } + /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -4450,6 +4466,13 @@ namespace ts { if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { return symbolName(symbol); } + if (isComputedPropertyName(name) && !(getCheckFlags(symbol) & CheckFlags.Late) && symbol.nameType && symbol.nameType.flags & TypeFlags.StringOrNumberLiteral) { + // Computed property name isn't late bound, but has a well-known name type - use name type to generate a symbol name + const result = getNameOfSymbolFromNameType(symbol, context); + if (result !== undefined) { + return result; + } + } return declarationNameToString(name); } if (declaration.parent && declaration.parent.kind === SyntaxKind.VariableDeclaration) { @@ -4465,16 +4488,8 @@ namespace ts { return declaration.kind === SyntaxKind.ClassExpression ? "(Anonymous class)" : "(Anonymous function)"; } } - const nameType = symbol.nameType; - if (nameType) { - if (nameType.flags & TypeFlags.StringLiteral && !isIdentifierText((nameType).value, compilerOptions.target)) { - return `"${escapeString((nameType).value, CharacterCodes.doubleQuote)}"`; - } - if (nameType && nameType.flags & TypeFlags.UniqueESSymbol) { - return `[${getNameOfSymbolAsWritten((nameType).symbol, context)}]`; - } - } - return symbolName(symbol); + const name = getNameOfSymbolFromNameType(symbol, context); + return name !== undefined ? name : symbolName(symbol); } function isDeclarationVisible(node: Node): boolean { diff --git a/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.js b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.js new file mode 100644 index 00000000000..461eb21087e --- /dev/null +++ b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.js @@ -0,0 +1,44 @@ +//// [tests/cases/compiler/declarationEmitComputedNameConstEnumAlias.ts] //// + +//// [EnumExample.ts] +enum EnumExample { + TEST = 'TEST', +} + +export default EnumExample; + +//// [index.ts] +import EnumExample from './EnumExample'; + +export default { + [EnumExample.TEST]: {}, +}; + +//// [EnumExample.js] +"use strict"; +exports.__esModule = true; +var EnumExample; +(function (EnumExample) { + EnumExample["TEST"] = "TEST"; +})(EnumExample || (EnumExample = {})); +exports["default"] = EnumExample; +//// [index.js] +"use strict"; +exports.__esModule = true; +var _a; +var EnumExample_1 = require("./EnumExample"); +exports["default"] = (_a = {}, + _a[EnumExample_1["default"].TEST] = {}, + _a); + + +//// [EnumExample.d.ts] +declare enum EnumExample { + TEST = "TEST" +} +export default EnumExample; +//// [index.d.ts] +declare const _default: { + TEST: {}; +}; +export default _default; diff --git a/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.symbols b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.symbols new file mode 100644 index 00000000000..fa5fc6aa482 --- /dev/null +++ b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/EnumExample.ts === +enum EnumExample { +>EnumExample : Symbol(EnumExample, Decl(EnumExample.ts, 0, 0)) + + TEST = 'TEST', +>TEST : Symbol(EnumExample.TEST, Decl(EnumExample.ts, 0, 18)) +} + +export default EnumExample; +>EnumExample : Symbol(EnumExample, Decl(EnumExample.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import EnumExample from './EnumExample'; +>EnumExample : Symbol(EnumExample, Decl(index.ts, 0, 6)) + +export default { + [EnumExample.TEST]: {}, +>[EnumExample.TEST] : Symbol([EnumExample.TEST], Decl(index.ts, 2, 16)) +>EnumExample.TEST : Symbol(EnumExample.TEST, Decl(EnumExample.ts, 0, 18)) +>EnumExample : Symbol(EnumExample, Decl(index.ts, 0, 6)) +>TEST : Symbol(EnumExample.TEST, Decl(EnumExample.ts, 0, 18)) + +}; diff --git a/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.types b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.types new file mode 100644 index 00000000000..97be9ac5a1b --- /dev/null +++ b/tests/baselines/reference/declarationEmitComputedNameConstEnumAlias.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/EnumExample.ts === +enum EnumExample { +>EnumExample : EnumExample + + TEST = 'TEST', +>TEST : EnumExample.TEST +>'TEST' : "TEST" +} + +export default EnumExample; +>EnumExample : EnumExample + +=== tests/cases/compiler/index.ts === +import EnumExample from './EnumExample'; +>EnumExample : typeof EnumExample + +export default { +>{ [EnumExample.TEST]: {},} : { [EnumExample.TEST]: {}; } + + [EnumExample.TEST]: {}, +>[EnumExample.TEST] : {} +>EnumExample.TEST : EnumExample +>EnumExample : typeof EnumExample +>TEST : EnumExample +>{} : {} + +}; diff --git a/tests/baselines/reference/parserComputedPropertyName35.types b/tests/baselines/reference/parserComputedPropertyName35.types index bfaaca1f942..6c4a9c785e5 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.types +++ b/tests/baselines/reference/parserComputedPropertyName35.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts === var x = { ->x : { [0, 1]: {}; } +>x : { 1: {}; } >{ [0, 1]: { }} : { [0, 1]: {}; } [0, 1]: { } diff --git a/tests/cases/compiler/declarationEmitComputedNameConstEnumAlias.ts b/tests/cases/compiler/declarationEmitComputedNameConstEnumAlias.ts new file mode 100644 index 00000000000..951ec0b0a9d --- /dev/null +++ b/tests/cases/compiler/declarationEmitComputedNameConstEnumAlias.ts @@ -0,0 +1,14 @@ +// @declaration: true +// @filename: EnumExample.ts +enum EnumExample { + TEST = 'TEST', +} + +export default EnumExample; + +// @filename: index.ts +import EnumExample from './EnumExample'; + +export default { + [EnumExample.TEST]: {}, +}; \ No newline at end of file From 676338971d4bd4f5adb18557486c85eab7d1aad4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 19 Dec 2018 08:45:18 -0800 Subject: [PATCH 211/322] Improve error message for out-of-bounds tuple element access --- src/compiler/checker.ts | 8 +++++++- src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b5c477068a4..b2b34d7aec1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9609,7 +9609,13 @@ namespace ts { if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) { if (accessNode && everyType(objectType, t => !(t).target.hasRestElement)) { const indexNode = getIndexNodeForAccessExpression(accessNode); - error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); + if (isTupleType(objectType)) { + error(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, + typeToString(objectType), getTypeReferenceArity(objectType), unescapeLeadingUnderscores(propName)); + } + else { + error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName), typeToString(objectType)); + } } return mapType(objectType, t => getRestTypeOfTupleType(t) || undefinedType); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 73ae0b69022..94142196614 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1752,6 +1752,10 @@ "category": "Error", "code": 2492 }, + "Tuple type '{0}' of length '{1}' has no element at index '{2}'.": { + "category": "Error", + "code": 2493 + }, "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.": { "category": "Error", "code": 2494 From 43d92f0525e1241348ccd7027f05676f90d02b08 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 19 Dec 2018 08:45:27 -0800 Subject: [PATCH 212/322] Accept new baselines --- .../arityAndOrderCompatibility01.errors.txt | 4 ++-- .../bestCommonTypeOfTuple.errors.txt | 16 +++++++-------- .../bestCommonTypeOfTuple2.errors.txt | 20 +++++++++---------- .../reference/castingTuple.errors.txt | 4 ++-- ...turingThisInTupleDestructuring1.errors.txt | 8 ++++---- ...turingThisInTupleDestructuring2.errors.txt | 4 ++-- .../emptyTuplesTypeAssertion01.errors.txt | 4 ++-- .../emptyTuplesTypeAssertion02.errors.txt | 4 ++-- .../genericCallWithTupleType.errors.txt | 12 +++++------ .../reference/indexerWithTuple.errors.txt | 16 +++++++-------- .../reference/tupleLengthCheck.errors.txt | 8 ++++---- .../baselines/reference/tupleTypes.errors.txt | 8 ++++---- .../reference/unionsOfTupleTypes1.errors.txt | 16 +++++++-------- 13 files changed, 62 insertions(+), 62 deletions(-) diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt index 5eeaef51566..b34b8896919 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt +++ b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(15,12): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(15,12): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,5): error TS2461: Type '{ 0: string; 1: number; length: 2; }' is not an array type. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(18,5): error TS2741: Property '2' is missing in type '[string, number]' but required in type '[number, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(19,5): error TS2741: Property '2' is missing in type 'StrNum' but required in type '[number, number, number]'. @@ -45,7 +45,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var [a, b, c] = x; ~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. var [d, e, f] = y; var [g, h, i] = z; ~~~~~~~~~ diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.errors.txt b/tests/baselines/reference/bestCommonTypeOfTuple.errors.txt index e3c5dcc7986..0349ce1ebe4 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.errors.txt +++ b/tests/baselines/reference/bestCommonTypeOfTuple.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(22,13): error TS2339: Property '2' does not exist on type '[(x: number) => string, (x: number) => number]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(23,13): error TS2339: Property '2' does not exist on type '[E1, E2]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(24,13): error TS2339: Property '2' does not exist on type '[number, any]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(25,13): error TS2339: Property '3' does not exist on type '[E1, E2, number]'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(22,13): error TS2493: Tuple type '[(x: number) => string, (x: number) => number]' of length '2' has no element at index '2'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(23,13): error TS2493: Tuple type '[E1, E2]' of length '2' has no element at index '2'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(24,13): error TS2493: Tuple type '[number, any]' of length '2' has no element at index '2'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts(25,13): error TS2493: Tuple type '[E1, E2, number]' of length '3' has no element at index '3'. ==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts (4 errors) ==== @@ -28,13 +28,13 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfT t4 = [E1.one, E2.two, 20]; var e1 = t1[2]; // {} ~ -!!! error TS2339: Property '2' does not exist on type '[(x: number) => string, (x: number) => number]'. +!!! error TS2493: Tuple type '[(x: number) => string, (x: number) => number]' of length '2' has no element at index '2'. var e2 = t2[2]; // {} ~ -!!! error TS2339: Property '2' does not exist on type '[E1, E2]'. +!!! error TS2493: Tuple type '[E1, E2]' of length '2' has no element at index '2'. var e3 = t3[2]; // any ~ -!!! error TS2339: Property '2' does not exist on type '[number, any]'. +!!! error TS2493: Tuple type '[number, any]' of length '2' has no element at index '2'. var e4 = t4[3]; // number ~ -!!! error TS2339: Property '3' does not exist on type '[E1, E2, number]'. \ No newline at end of file +!!! error TS2493: Tuple type '[E1, E2, number]' of length '3' has no element at index '3'. \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt b/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt index d2fd301e131..602e9fdeef2 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(17,14): error TS2339: Property '4' does not exist on type '[C, base]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(18,14): error TS2339: Property '4' does not exist on type '[C, D]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(19,14): error TS2339: Property '4' does not exist on type '[C1, D1]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(20,14): error TS2339: Property '2' does not exist on type '[base1, C1]'. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(21,14): error TS2339: Property '2' does not exist on type '[C1, F]'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(17,14): error TS2493: Tuple type '[C, base]' of length '2' has no element at index '4'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(18,14): error TS2493: Tuple type '[C, D]' of length '2' has no element at index '4'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(19,14): error TS2493: Tuple type '[C1, D1]' of length '2' has no element at index '4'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(20,14): error TS2493: Tuple type '[base1, C1]' of length '2' has no element at index '2'. +tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts(21,14): error TS2493: Tuple type '[C1, F]' of length '2' has no element at index '2'. ==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts (5 errors) ==== @@ -24,17 +24,17 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfT var e11 = t1[4]; // base ~ -!!! error TS2339: Property '4' does not exist on type '[C, base]'. +!!! error TS2493: Tuple type '[C, base]' of length '2' has no element at index '4'. var e21 = t2[4]; // {} ~ -!!! error TS2339: Property '4' does not exist on type '[C, D]'. +!!! error TS2493: Tuple type '[C, D]' of length '2' has no element at index '4'. var e31 = t3[4]; // C1 ~ -!!! error TS2339: Property '4' does not exist on type '[C1, D1]'. +!!! error TS2493: Tuple type '[C1, D1]' of length '2' has no element at index '4'. var e41 = t4[2]; // base1 ~ -!!! error TS2339: Property '2' does not exist on type '[base1, C1]'. +!!! error TS2493: Tuple type '[base1, C1]' of length '2' has no element at index '2'. var e51 = t5[2]; // {} ~ -!!! error TS2339: Property '2' does not exist on type '[C1, F]'. +!!! error TS2493: Tuple type '[C1, F]' of length '2' has no element at index '2'. \ No newline at end of file diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 4587612cb76..4ddb42ed2d9 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(14,15): error TS2352: Conver tests/cases/conformance/types/tuple/castingTuple.ts(15,14): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. tests/cases/conformance/types/tuple/castingTuple.ts(18,21): error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property '2' is missing in type '[C, D]' but required in type '[C, D, A]'. -tests/cases/conformance/types/tuple/castingTuple.ts(20,33): error TS2339: Property '5' does not exist on type '[C, D, A]'. +tests/cases/conformance/types/tuple/castingTuple.ts(20,33): error TS2493: Tuple type '[C, D, A]' of length '3' has no element at index '5'. tests/cases/conformance/types/tuple/castingTuple.ts(30,10): error TS2352: Conversion of type '[number, string]' to type '[number, number]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'string' is not comparable to type 'number'. tests/cases/conformance/types/tuple/castingTuple.ts(31,10): error TS2352: Conversion of type '[C, D]' to type '[A, I]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -49,7 +49,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var eleFromCDA1 = classCDATuple[2]; // A var eleFromCDA2 = classCDATuple[5]; // C | D | A ~ -!!! error TS2339: Property '5' does not exist on type '[C, D, A]'. +!!! error TS2493: Tuple type '[C, D, A]' of length '3' has no element at index '5'. var t10: [E1, E2] = [E1.one, E2.one]; var t11 = <[number, number]>t10; var array1 = <{}[]>emptyObjTuple; diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt b/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt index 8fba60b9cd0..5b8f2346ee9 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring1.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2339: Property '1' does not exist on type '[any]'. -tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2339: Property '2' does not exist on type '[any]'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2493: Tuple type '[any]' of length '1' has no element at index '1'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2493: Tuple type '[any]' of length '1' has no element at index '2'. ==== tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts (2 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS23 wrapper((array: [any]) => { [this.test, this.test1, this.test2] = array; // even though there is a compiler error, we should still emit lexical capture for "this" ~~~~~~~~~~ -!!! error TS2339: Property '1' does not exist on type '[any]'. +!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '1'. ~~~~~~~~~~ -!!! error TS2339: Property '2' does not exist on type '[any]'. +!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '2'. }); \ No newline at end of file diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt index 22a8e1ca63e..5d14e2401c4 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2339: Property '2' does not exist on type '[number, number]'. +tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2493: Tuple type '[number, number]' of length '2' has no element at index '2'. ==== tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts (1 errors) ==== @@ -11,6 +11,6 @@ tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS23 method() { () => [this.test, this.test1, this.test2] = array1; // even though there is a compiler error, we should still emit lexical capture for "this" ~~~~~~~~~~ -!!! error TS2339: Property '2' does not exist on type '[number, number]'. +!!! error TS2493: Tuple type '[number, number]' of length '2' has no element at index '2'. } } \ No newline at end of file diff --git a/tests/baselines/reference/emptyTuplesTypeAssertion01.errors.txt b/tests/baselines/reference/emptyTuplesTypeAssertion01.errors.txt index e3b857412cc..f1c4d76fe2b 100644 --- a/tests/baselines/reference/emptyTuplesTypeAssertion01.errors.txt +++ b/tests/baselines/reference/emptyTuplesTypeAssertion01.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion01.ts(2,11): error TS2339: Property '0' does not exist on type '[]'. +tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion01.ts(2,11): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion01.ts (1 errors) ==== let x = <[]>[]; let y = x[0]; ~ -!!! error TS2339: Property '0' does not exist on type '[]'. \ No newline at end of file +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTuplesTypeAssertion02.errors.txt b/tests/baselines/reference/emptyTuplesTypeAssertion02.errors.txt index 34d22dc673a..64663106a1e 100644 --- a/tests/baselines/reference/emptyTuplesTypeAssertion02.errors.txt +++ b/tests/baselines/reference/emptyTuplesTypeAssertion02.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion02.ts(2,11): error TS2339: Property '0' does not exist on type '[]'. +tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion02.ts(2,11): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion02.ts (1 errors) ==== let x = [] as []; let y = x[0]; ~ -!!! error TS2339: Property '0' does not exist on type '[]'. \ No newline at end of file +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index ec3c40ccad9..0cc4a4986db 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,10 +1,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '2'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(13,20): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(13,20): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'undefined'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,11): error TS2339: Property '3' does not exist on type '[string, number]'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(15,20): error TS2339: Property '3' does not exist on type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,11): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '3'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(15,20): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '3'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,14): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,17): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,14): error TS2322: Type '{}' is not assignable to type 'string'. @@ -31,15 +31,15 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup !!! error TS2322: Type '4' is not assignable to type '2'. var e3 = i1.tuple1[2]; // {} ~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. i1.tuple1[3] = { a: "string" }; ~~~~~~~~~~~~ !!! error TS2322: Type '{ a: string; }' is not assignable to type 'undefined'. ~ -!!! error TS2339: Property '3' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '3'. var e4 = i1.tuple1[3]; // {} ~ -!!! error TS2339: Property '3' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '3'. i2.tuple1 = ["foo", 5]; i2.tuple1 = ["foo", "bar"]; i2.tuple1 = [5, "bar"]; diff --git a/tests/baselines/reference/indexerWithTuple.errors.txt b/tests/baselines/reference/indexerWithTuple.errors.txt index 45cddd9313f..b5b09be4c49 100644 --- a/tests/baselines/reference/indexerWithTuple.errors.txt +++ b/tests/baselines/reference/indexerWithTuple.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/tuple/indexerWithTuple.ts(11,25): error TS2339: Property '2' does not exist on type '[string, number]'. -tests/cases/conformance/types/tuple/indexerWithTuple.ts(17,27): error TS2339: Property '2' does not exist on type '[number, [string, number]]'. -tests/cases/conformance/types/tuple/indexerWithTuple.ts(20,30): error TS2339: Property '2' does not exist on type '[number, string | number]'. -tests/cases/conformance/types/tuple/indexerWithTuple.ts(28,30): error TS2339: Property '2' does not exist on type '[boolean, string | number]'. +tests/cases/conformance/types/tuple/indexerWithTuple.ts(11,25): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. +tests/cases/conformance/types/tuple/indexerWithTuple.ts(17,27): error TS2493: Tuple type '[number, [string, number]]' of length '2' has no element at index '2'. +tests/cases/conformance/types/tuple/indexerWithTuple.ts(20,30): error TS2493: Tuple type '[number, string | number]' of length '2' has no element at index '2'. +tests/cases/conformance/types/tuple/indexerWithTuple.ts(28,30): error TS2493: Tuple type '[boolean, string | number]' of length '2' has no element at index '2'. ==== tests/cases/conformance/types/tuple/indexerWithTuple.ts (4 errors) ==== @@ -17,7 +17,7 @@ tests/cases/conformance/types/tuple/indexerWithTuple.ts(28,30): error TS2339: Pr var ele11 = strNumTuple[1]; // number var ele12 = strNumTuple[2]; // string | number ~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. var ele13 = strNumTuple[idx0]; // string | number var ele14 = strNumTuple[idx1]; // string | number var ele15 = strNumTuple["0"]; // string @@ -25,12 +25,12 @@ tests/cases/conformance/types/tuple/indexerWithTuple.ts(28,30): error TS2339: Pr var strNumTuple1 = numTupleTuple[1]; //[string, number]; var ele17 = numTupleTuple[2]; // number | [string, number] ~ -!!! error TS2339: Property '2' does not exist on type '[number, [string, number]]'. +!!! error TS2493: Tuple type '[number, [string, number]]' of length '2' has no element at index '2'. var eleUnion10 = unionTuple1[0]; // number var eleUnion11 = unionTuple1[1]; // string | number var eleUnion12 = unionTuple1[2]; // string | number ~ -!!! error TS2339: Property '2' does not exist on type '[number, string | number]'. +!!! error TS2493: Tuple type '[number, string | number]' of length '2' has no element at index '2'. var eleUnion13 = unionTuple1[idx0]; // string | number var eleUnion14 = unionTuple1[idx1]; // string | number var eleUnion15 = unionTuple1["0"]; // number @@ -40,7 +40,7 @@ tests/cases/conformance/types/tuple/indexerWithTuple.ts(28,30): error TS2339: Pr var eleUnion21 = unionTuple2[1]; // string | number var eleUnion22 = unionTuple2[2]; // string | number | boolean ~ -!!! error TS2339: Property '2' does not exist on type '[boolean, string | number]'. +!!! error TS2493: Tuple type '[boolean, string | number]' of length '2' has no element at index '2'. var eleUnion23 = unionTuple2[idx0]; // string | number | boolean var eleUnion24 = unionTuple2[idx1]; // string | number | boolean var eleUnion25 = unionTuple2["0"]; // boolean diff --git a/tests/baselines/reference/tupleLengthCheck.errors.txt b/tests/baselines/reference/tupleLengthCheck.errors.txt index 1c6fe909135..06127460394 100644 --- a/tests/baselines/reference/tupleLengthCheck.errors.txt +++ b/tests/baselines/reference/tupleLengthCheck.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/tuple/tupleLengthCheck.ts(5,14): error TS2339: Property '2' does not exist on type '[number, string]'. -tests/cases/conformance/types/tuple/tupleLengthCheck.ts(6,14): error TS2339: Property '1000' does not exist on type '[number, string]'. +tests/cases/conformance/types/tuple/tupleLengthCheck.ts(5,14): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. +tests/cases/conformance/types/tuple/tupleLengthCheck.ts(6,14): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '1000'. ==== tests/cases/conformance/types/tuple/tupleLengthCheck.ts (2 errors) ==== @@ -9,10 +9,10 @@ tests/cases/conformance/types/tuple/tupleLengthCheck.ts(6,14): error TS2339: Pro const a1 = a[1] const a2 = a[2] ~ -!!! error TS2339: Property '2' does not exist on type '[number, string]'. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. const a3 = a[1000] ~~~~ -!!! error TS2339: Property '1000' does not exist on type '[number, string]'. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '1000'. const a4 = rest[1] const a5 = rest[2] diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 3776a92d6a1..1cf2f113d14 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/tupleTypes.ts(11,12): error TS2339: Property '2' does not exist on type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(11,12): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. tests/cases/compiler/tupleTypes.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type 'undefined', but here has type 'string | number'. tests/cases/compiler/tupleTypes.ts(14,1): error TS2739: Type '[]' is missing the following properties from type '[number, string]': 0, 1 tests/cases/compiler/tupleTypes.ts(15,1): error TS2741: Property '1' is missing in type '[number]' but required in type '[number, string]'. @@ -7,7 +7,7 @@ tests/cases/compiler/tupleTypes.ts(17,15): error TS2322: Type 'number' is not as tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. -tests/cases/compiler/tupleTypes.ts(35,14): error TS2339: Property '2' does not exist on type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(35,14): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. tests/cases/compiler/tupleTypes.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'. tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type '[]' is not assignable to type '[number, string]'. tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. @@ -35,7 +35,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var t1: string; var t2 = t[2]; // number|string ~ -!!! error TS2339: Property '2' does not exist on type '[number, string]'. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. var t2: number|string; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type 'undefined', but here has type 'string | number'. @@ -75,7 +75,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var tt1: string; var tt2 = tt[2]; ~ -!!! error TS2339: Property '2' does not exist on type '[number, string]'. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. var tt2: number | string; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'. diff --git a/tests/baselines/reference/unionsOfTupleTypes1.errors.txt b/tests/baselines/reference/unionsOfTupleTypes1.errors.txt index 402dfcad340..da997e988ee 100644 --- a/tests/baselines/reference/unionsOfTupleTypes1.errors.txt +++ b/tests/baselines/reference/unionsOfTupleTypes1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(8,15): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(8,15): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(13,15): error TS2339: Property '2' does not exist on type 'T2'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(27,20): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(27,20): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(28,20): error TS2339: Property '2' does not exist on type 'T2'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(31,16): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(31,16): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(32,16): error TS2339: Property '2' does not exist on type 'T2'. -tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(37,18): error TS2339: Property '2' does not exist on type '[string, number]'. +tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(37,18): error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: Property '2' does not exist on type 'T2'. @@ -18,7 +18,7 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: type T11 = T1[1]; // number type T12 = T1[2]; // undefined ~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. type T1N = T1[number]; // string | number type T20 = T2[0]; // string | boolean @@ -41,7 +41,7 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: function f1(t1: T1, t2: T2, t3: T3, t4: T4, x: number) { let [d10, d11, d12] = t1; // string, number ~~~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. let [d20, d21, d22] = t2; // string | boolean, number | undefined ~~~ !!! error TS2339: Property '2' does not exist on type 'T2'. @@ -49,7 +49,7 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: let [d40, d41, d42] = t4; // string | boolean, number | undefined, number | undefined [d10, d11, d12] = t1; ~~~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. [d20, d21, d22] = t2; ~~~ !!! error TS2339: Property '2' does not exist on type 'T2'. @@ -59,7 +59,7 @@ tests/cases/conformance/types/tuple/unionsOfTupleTypes1.ts(41,18): error TS2339: let t11 = t1[1]; // number let t12 = t1[2]; // undefined ~ -!!! error TS2339: Property '2' does not exist on type '[string, number]'. +!!! error TS2493: Tuple type '[string, number]' of length '2' has no element at index '2'. let t1x = t1[x]; // string | number let t20 = t2[0]; // string | boolean let t21 = t2[1]; // number | undefined From 63273394e4b58a57fd4e604b6542d9dfab5ce299 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 19 Dec 2018 10:23:13 -0800 Subject: [PATCH 213/322] No public API changes --- src/compiler/types.ts | 1 + src/compiler/utilities.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8047c31930e..8110f8fd17a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1745,6 +1745,7 @@ namespace ts { export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; + /* @internal */ export type AccessExpression = PropertyAccessExpression | ElementAccessExpression; export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index fe0d8b84527..710ff6a6710 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4590,6 +4590,10 @@ namespace ts { || kind === SyntaxKind.JSDocFunctionType || kind === SyntaxKind.JSDocVariadicType; } + + export function isAccessExpression(node: Node): node is AccessExpression { + return node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.ElementAccessExpression; + } } namespace ts { @@ -5586,10 +5590,6 @@ namespace ts { return node.kind === SyntaxKind.ElementAccessExpression; } - export function isAccessExpression(node: Node): node is AccessExpression { - return node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.ElementAccessExpression; - } - export function isCallExpression(node: Node): node is CallExpression { return node.kind === SyntaxKind.CallExpression; } From 2e6366fd1cf3b42670481a590398ee306dbac542 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 19 Dec 2018 10:23:45 -0800 Subject: [PATCH 214/322] Accept new baselines --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 -- tests/baselines/reference/api/typescript.d.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index dfb7acf2aba..2b78178587e 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1054,7 +1054,6 @@ declare namespace ts { } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; - type AccessExpression = PropertyAccessExpression | ElementAccessExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; @@ -3351,7 +3350,6 @@ declare namespace ts { function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; function isElementAccessExpression(node: Node): node is ElementAccessExpression; - function isAccessExpression(node: Node): node is AccessExpression; function isCallExpression(node: Node): node is CallExpression; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 66d71f2080b..0e693f698f2 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1054,7 +1054,6 @@ declare namespace ts { } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; - type AccessExpression = PropertyAccessExpression | ElementAccessExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; expression: LeftHandSideExpression; @@ -3351,7 +3350,6 @@ declare namespace ts { function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression; function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression; function isElementAccessExpression(node: Node): node is ElementAccessExpression; - function isAccessExpression(node: Node): node is AccessExpression; function isCallExpression(node: Node): node is CallExpression; function isNewExpression(node: Node): node is NewExpression; function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression; From 54352dc1c9bbbe528dd6df8295ef2478bc696684 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 19 Dec 2018 15:28:21 -0800 Subject: [PATCH 215/322] Added test case. --- ...DefaultExportClassExtendingExpression01.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts diff --git a/tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts b/tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts new file mode 100644 index 00000000000..3c4abc37deb --- /dev/null +++ b/tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts @@ -0,0 +1,21 @@ +// @declaration: true + +interface Greeter { + getGreeting(): string; +} + +interface GreeterConstructor { + new (): Greeter; +} + +class A { + getGreeting() { + return 'hello'; + } +} + +const getGreeterBase = (): GreeterConstructor => A; + +export default class extends getGreeterBase() { +} + From 9277c03666d71f92a498c500cf108f2b62199468 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 19 Dec 2018 15:42:15 -0800 Subject: [PATCH 216/322] Check whether class declarations have a name, falling back to "default". --- src/compiler/transformers/declarations.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 973b9db618e..b54cf5bb858 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -1100,7 +1100,8 @@ namespace ts { if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== SyntaxKind.NullKeyword) { // We must add a temporary declaration for the extends clause expression - const newId = createOptimisticUniqueName(`${unescapeLeadingUnderscores(input.name!.escapedText)}_base`); // TODO: GH#18217 + const oldId = input.name ? unescapeLeadingUnderscores(input.name.escapedText) : "default"; + const newId = createOptimisticUniqueName(`${oldId}_base`); getSymbolAccessibilityDiagnostic = () => ({ diagnosticMessage: Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: extendsClause, From dec3fe619904e758bee152edf2086ec75fdac02d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 19 Dec 2018 15:50:33 -0800 Subject: [PATCH 217/322] Accepted baselines. --- ...DefaultExportClassExtendingExpression01.js | 68 +++++++++++++++++++ ...ltExportClassExtendingExpression01.symbols | 35 ++++++++++ ...aultExportClassExtendingExpression01.types | 32 +++++++++ 3 files changed, 135 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.js create mode 100644 tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.symbols create mode 100644 tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.types diff --git a/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.js b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.js new file mode 100644 index 00000000000..4d0006d52e6 --- /dev/null +++ b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.js @@ -0,0 +1,68 @@ +//// [declarationEmitForDefaultExportClassExtendingExpression01.ts] +interface Greeter { + getGreeting(): string; +} + +interface GreeterConstructor { + new (): Greeter; +} + +class A { + getGreeting() { + return 'hello'; + } +} + +const getGreeterBase = (): GreeterConstructor => A; + +export default class extends getGreeterBase() { +} + + + +//// [declarationEmitForDefaultExportClassExtendingExpression01.js] +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +exports.__esModule = true; +var A = /** @class */ (function () { + function A() { + } + A.prototype.getGreeting = function () { + return 'hello'; + }; + return A; +}()); +var getGreeterBase = function () { return A; }; +var default_1 = /** @class */ (function (_super) { + __extends(default_1, _super); + function default_1() { + return _super !== null && _super.apply(this, arguments) || this; + } + return default_1; +}(getGreeterBase())); +exports["default"] = default_1; + + +//// [declarationEmitForDefaultExportClassExtendingExpression01.d.ts] +interface Greeter { + getGreeting(): string; +} +interface GreeterConstructor { + new (): Greeter; +} +declare const default_base: GreeterConstructor; +export default class extends default_base { +} +export {}; diff --git a/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.symbols b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.symbols new file mode 100644 index 00000000000..8d298f58037 --- /dev/null +++ b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts === +interface Greeter { +>Greeter : Symbol(Greeter, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 0, 0)) + + getGreeting(): string; +>getGreeting : Symbol(Greeter.getGreeting, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 0, 19)) +} + +interface GreeterConstructor { +>GreeterConstructor : Symbol(GreeterConstructor, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 2, 1)) + + new (): Greeter; +>Greeter : Symbol(Greeter, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 0, 0)) +} + +class A { +>A : Symbol(A, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 6, 1)) + + getGreeting() { +>getGreeting : Symbol(A.getGreeting, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 8, 9)) + + return 'hello'; + } +} + +const getGreeterBase = (): GreeterConstructor => A; +>getGreeterBase : Symbol(getGreeterBase, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 14, 5)) +>GreeterConstructor : Symbol(GreeterConstructor, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 2, 1)) +>A : Symbol(A, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 6, 1)) + +export default class extends getGreeterBase() { +>getGreeterBase : Symbol(getGreeterBase, Decl(declarationEmitForDefaultExportClassExtendingExpression01.ts, 14, 5)) +} + + diff --git a/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.types b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.types new file mode 100644 index 00000000000..f1ec49f988e --- /dev/null +++ b/tests/baselines/reference/declarationEmitForDefaultExportClassExtendingExpression01.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/declarationEmitForDefaultExportClassExtendingExpression01.ts === +interface Greeter { + getGreeting(): string; +>getGreeting : () => string +} + +interface GreeterConstructor { + new (): Greeter; +} + +class A { +>A : A + + getGreeting() { +>getGreeting : () => string + + return 'hello'; +>'hello' : "hello" + } +} + +const getGreeterBase = (): GreeterConstructor => A; +>getGreeterBase : () => GreeterConstructor +>(): GreeterConstructor => A : () => GreeterConstructor +>A : typeof A + +export default class extends getGreeterBase() { +>getGreeterBase() : Greeter +>getGreeterBase : () => GreeterConstructor +} + + From 08022d57c8c068767c6594df83e0012a8e154e3c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 19 Dec 2018 16:35:01 -0800 Subject: [PATCH 218/322] Allow calls on unions of dissimilar signatures (#29011) * Add core of new union signature logic and test - needs intersection signature logic to fully work * Add inversion of variance for class props lookup from union sig returns * Fix lints * Combine parameter names for nicer quick info * PR feedback 1 * Fix miscopy * PR feedback round 2 * Remove argument name combining because loc :( * Nit cleanup round 3 * Reinline getTupleTypeForArgumentAtPos * Remove a tad more * No step on sneky off-by-one error --- src/compiler/checker.ts | 107 +++++ .../callsOnComplexSignatures.errors.txt | 110 +++++ .../reference/callsOnComplexSignatures.js | 169 +++++++ .../callsOnComplexSignatures.symbols | 334 ++++++++++++++ .../reference/callsOnComplexSignatures.types | 416 ++++++++++++++++++ .../controlFlowArrayErrors.errors.txt | 6 +- ...onCallOnConstrainedTypeVariable.errors.txt | 22 +- .../reference/tsxUnionElementType1.errors.txt | 7 +- .../reference/tsxUnionElementType2.errors.txt | 7 +- .../reference/tsxUnionElementType3.errors.txt | 9 +- .../reference/tsxUnionElementType4.errors.txt | 9 +- .../unionTypeCallSignatures.errors.txt | 21 +- .../unionTypeConstructSignatures.errors.txt | 21 +- .../reference/unionTypeMembers.errors.txt | 10 +- .../compiler/callsOnComplexSignatures.tsx | 106 +++++ ...edUnionsOfDissimilarTyeshaveGoodDisplay.ts | 53 +++ .../tsxCompletionUnionElementType.ts | 2 +- .../tsxGoToDefinitionUnionElementType1.ts | 2 +- 18 files changed, 1364 insertions(+), 47 deletions(-) create mode 100644 tests/baselines/reference/callsOnComplexSignatures.errors.txt create mode 100644 tests/baselines/reference/callsOnComplexSignatures.js create mode 100644 tests/baselines/reference/callsOnComplexSignatures.symbols create mode 100644 tests/baselines/reference/callsOnComplexSignatures.types create mode 100644 tests/cases/compiler/callsOnComplexSignatures.tsx create mode 100644 tests/cases/fourslash/calledUnionsOfDissimilarTyeshaveGoodDisplay.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3377ae96b0d..23c5568f2e5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6799,7 +6799,12 @@ namespace ts { // type is the union of the constituent return types. function getUnionSignatures(signatureLists: ReadonlyArray>): Signature[] { let result: Signature[] | undefined; + let indexWithLengthOverOne: number | undefined; for (let i = 0; i < signatureLists.length; i++) { + if (signatureLists[i].length === 0) return emptyArray; + if (signatureLists[i].length > 1) { + indexWithLengthOverOne = indexWithLengthOverOne === undefined ? i : -1; // -1 is a signal there are multiple overload sets + } for (const signature of signatureLists[i]) { // Only process signatures with parameter lists that aren't already in the result list if (!result || !findMatchingSignature(result, signature, /*partialMatch*/ false, /*ignoreThisTypes*/ true, /*ignoreReturnTypes*/ true)) { @@ -6823,9 +6828,91 @@ namespace ts { } } } + if (!length(result) && indexWithLengthOverOne !== -1) { + // No sufficiently similar signature existed to subsume all the other signatures in the union - time to see if we can make a single + // signature that handles all over them. We only do this when there are overloads in only one constituent. + // (Overloads are conditional in nature and having overloads in multiple constituents would necessitate making a power set of + // signatures from the type, whose ordering would be non-obvious) + const masterList = signatureLists[indexWithLengthOverOne !== undefined ? indexWithLengthOverOne : 0]; + let results: Signature[] | undefined = masterList.slice(); + for (const signatures of signatureLists) { + if (signatures !== masterList) { + const signature = signatures[0]; + Debug.assert(!!signature, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); + results = signature.typeParameters && some(results, s => !!s.typeParameters) ? undefined : map(results, sig => combineSignaturesOfUnionMembers(sig, signature)); + if (!results) { + break; + } + } + } + result = results; + } return result || emptyArray; } + function combineUnionThisParam(left: Symbol | undefined, right: Symbol | undefined): Symbol | undefined { + if (!left || !right) { + return left || right; + } + // A signature `this` type might be a read or a write position... It's very possible that it should be invariant + // and we should refuse to merge signatures if there are `this` types and they do not match. However, so as to be + // permissive when calling, for now, we'll union the `this` types just like the overlapping-union-signature check does + const thisType = getUnionType([getTypeOfSymbol(left), getTypeOfSymbol(right)], UnionReduction.Subtype); + return createSymbolWithType(left, thisType); + } + + function combineUnionParameters(left: Signature, right: Signature) { + const longest = getParameterCount(left) >= getParameterCount(right) ? left : right; + const shorter = longest === left ? right : left; + const longestCount = getParameterCount(longest); + const eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right)); + const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + const params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (let i = 0; i < longestCount; i++) { + const longestParamType = tryGetTypeAtPosition(longest, i)!; + const shorterParamType = tryGetTypeAtPosition(shorter, i) || unknownType; + const unionParamType = getIntersectionType([longestParamType, shorterParamType]); + const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1); + const isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter); + const leftName = getParameterNameAtPosition(left, i); + const rightName = getParameterNameAtPosition(right, i); + const paramSymbol = createSymbol( + SymbolFlags.FunctionScopedVariable | (isOptional && !isRestParam ? SymbolFlags.Optional : 0), + leftName === rightName ? leftName : `arg${i}` as __String + ); + paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i] = paramSymbol; + } + if (needsExtraRestElement) { + const restParamSymbol = createSymbol(SymbolFlags.FunctionScopedVariable, "args" as __String); + restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + params[longestCount] = restParamSymbol; + } + return params; + } + + function combineSignaturesOfUnionMembers(left: Signature, right: Signature): Signature { + const declaration = left.declaration; + const params = combineUnionParameters(left, right); + const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter); + const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + const hasRestParam = left.hasRestParameter || right.hasRestParameter; + const hasLiteralTypes = left.hasLiteralTypes || right.hasLiteralTypes; + const result = createSignature( + declaration, + left.typeParameters || right.typeParameters, + thisParam, + params, + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, + minArgCount, + hasRestParam, + hasLiteralTypes + ); + result.unionSignatures = concatenate(left.unionSignatures || [left], [right]); + return result; + } + function getUnionIndexInfo(types: ReadonlyArray, kind: IndexKind): IndexInfo | undefined { const indexTypes: Type[] = []; let isAnyReadonly = false; @@ -17566,6 +17653,26 @@ namespace ts { } function getJsxPropsTypeForSignatureFromMember(sig: Signature, forcedLookupLocation: __String) { + if (sig.unionSignatures) { + // JSX Elements using the legacy `props`-field based lookup (eg, react class components) need to treat the `props` member as an input + // instead of an output position when resolving the signature. We need to go back to the input signatures of the composite signature, + // get the type of `props` on each return type individually, and then _intersect them_, rather than union them (as would normally occur + // for a union signature). It's an unfortunate quirk of looking in the output of the signature for the type we want to use for the input. + // The default behavior of `getTypeOfFirstParameterOfSignatureWithFallback` when no `props` member name is defined is much more sane. + const results: Type[] = []; + for (const signature of sig.unionSignatures) { + const instance = getReturnTypeOfSignature(signature); + if (isTypeAny(instance)) { + return instance; + } + const propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); + if (!propType) { + return; + } + results.push(propType); + } + return getIntersectionType(results); + } const instanceType = getReturnTypeOfSignature(sig); return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); } diff --git a/tests/baselines/reference/callsOnComplexSignatures.errors.txt b/tests/baselines/reference/callsOnComplexSignatures.errors.txt new file mode 100644 index 00000000000..f85a23e4ae7 --- /dev/null +++ b/tests/baselines/reference/callsOnComplexSignatures.errors.txt @@ -0,0 +1,110 @@ +tests/cases/compiler/callsOnComplexSignatures.tsx(38,19): error TS7006: Parameter 'item' implicitly has an 'any' type. + + +==== tests/cases/compiler/callsOnComplexSignatures.tsx (1 errors) ==== + /// + import React from "react"; + + // Simple calls from real usecases + function test1() { + type stringType1 = "foo" | "bar"; + type stringType2 = "baz" | "bar"; + + interface Temp1 { + getValue(name: stringType1): number; + } + + interface Temp2 { + getValue(name: stringType2): string; + } + + function test(t: Temp1 | Temp2) { + const z = t.getValue("bar"); // Should be fine + } + } + + function test2() { + interface Messages { + readonly foo: (options: { [key: string]: any, b: number }) => string; + readonly bar: (options: { [key: string]: any, a: string }) => string; + } + + const messages: Messages = { + foo: (options) => "Foo", + bar: (options) => "Bar", + }; + + const test1 = (type: "foo" | "bar") => + messages[type]({ a: "A", b: 0 }); + } + + function test3(items: string[] | number[]) { + items.forEach(item => console.log(item)); + ~~~~ +!!! error TS7006: Parameter 'item' implicitly has an 'any' type. + } + + function test4( + arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number), + arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number), + arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number), + arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number), + arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number), + arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number), + ) { + arg1(); + arg1({x: 0, y: 0}); + arg1({x: 0, y: 0}, {x: 1, y: 1}); + + arg2({x: 0}, {x: 0}); + + arg3({x: 0}); + arg3({x: 0}, {x: 0, y: 0}); + arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}); + + arg4(); + arg4({x: 0, y: 0}); + arg4({x: 0, y: 0}, {x: 0}); + + arg5(); + arg5({x: 0, y: 0}); + arg5({x: 0, y: 0}, {x: 0}); + + arg6(); + arg6({x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}); + } + + // JSX Tag names + function test5() { + // Pair of non-like intrinsics + function render(url?: string): React.ReactNode { + const Tag = url ? 'a' : 'button'; + return test; + } + + // Union of all intrinsics and components of `any` + function App(props: { component:React.ReactType }) { + const Comp: React.ReactType = props.component; + return (); + } + + // custom components with non-subset props + function render2() { + interface P1 { + p?: boolean; + c?: string; + } + interface P2 { + p?: boolean; + c?: any; + d?: any; + } + + var C: React.ComponentType | React.ComponentType = null as any; + + const a = ; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/callsOnComplexSignatures.js b/tests/baselines/reference/callsOnComplexSignatures.js new file mode 100644 index 00000000000..f631f674269 --- /dev/null +++ b/tests/baselines/reference/callsOnComplexSignatures.js @@ -0,0 +1,169 @@ +//// [callsOnComplexSignatures.tsx] +/// +import React from "react"; + +// Simple calls from real usecases +function test1() { + type stringType1 = "foo" | "bar"; + type stringType2 = "baz" | "bar"; + + interface Temp1 { + getValue(name: stringType1): number; + } + + interface Temp2 { + getValue(name: stringType2): string; + } + + function test(t: Temp1 | Temp2) { + const z = t.getValue("bar"); // Should be fine + } +} + +function test2() { + interface Messages { + readonly foo: (options: { [key: string]: any, b: number }) => string; + readonly bar: (options: { [key: string]: any, a: string }) => string; + } + + const messages: Messages = { + foo: (options) => "Foo", + bar: (options) => "Bar", + }; + + const test1 = (type: "foo" | "bar") => + messages[type]({ a: "A", b: 0 }); +} + +function test3(items: string[] | number[]) { + items.forEach(item => console.log(item)); +} + +function test4( + arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number), + arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number), + arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number), + arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number), + arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number), + arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number), +) { + arg1(); + arg1({x: 0, y: 0}); + arg1({x: 0, y: 0}, {x: 1, y: 1}); + + arg2({x: 0}, {x: 0}); + + arg3({x: 0}); + arg3({x: 0}, {x: 0, y: 0}); + arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}); + + arg4(); + arg4({x: 0, y: 0}); + arg4({x: 0, y: 0}, {x: 0}); + + arg5(); + arg5({x: 0, y: 0}); + arg5({x: 0, y: 0}, {x: 0}); + + arg6(); + arg6({x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}); +} + +// JSX Tag names +function test5() { + // Pair of non-like intrinsics + function render(url?: string): React.ReactNode { + const Tag = url ? 'a' : 'button'; + return test; + } + + // Union of all intrinsics and components of `any` + function App(props: { component:React.ReactType }) { + const Comp: React.ReactType = props.component; + return (); + } + + // custom components with non-subset props + function render2() { + interface P1 { + p?: boolean; + c?: string; + } + interface P2 { + p?: boolean; + c?: any; + d?: any; + } + + var C: React.ComponentType | React.ComponentType = null as any; + + const a = ; + } +} + + +//// [callsOnComplexSignatures.js] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +exports.__esModule = true; +/// +var react_1 = __importDefault(require("react")); +// Simple calls from real usecases +function test1() { + function test(t) { + var z = t.getValue("bar"); // Should be fine + } +} +function test2() { + var messages = { + foo: function (options) { return "Foo"; }, + bar: function (options) { return "Bar"; } + }; + var test1 = function (type) { + return messages[type]({ a: "A", b: 0 }); + }; +} +function test3(items) { + items.forEach(function (item) { return console.log(item); }); +} +function test4(arg1, arg2, arg3, arg4, arg5, arg6) { + arg1(); + arg1({ x: 0, y: 0 }); + arg1({ x: 0, y: 0 }, { x: 1, y: 1 }); + arg2({ x: 0 }, { x: 0 }); + arg3({ x: 0 }); + arg3({ x: 0 }, { x: 0, y: 0 }); + arg3({ x: 0 }, { x: 0, y: 0 }, { x: 0, y: 0 }); + arg4(); + arg4({ x: 0, y: 0 }); + arg4({ x: 0, y: 0 }, { x: 0 }); + arg5(); + arg5({ x: 0, y: 0 }); + arg5({ x: 0, y: 0 }, { x: 0 }); + arg6(); + arg6({ x: 0, y: 0 }); + arg6({ x: 0, y: 0 }, { x: 0, y: 0 }); + arg6({ x: 0, y: 0 }, { x: 0, y: 0 }, { y: 0 }); +} +// JSX Tag names +function test5() { + // Pair of non-like intrinsics + function render(url) { + var Tag = url ? 'a' : 'button'; + return react_1["default"].createElement(Tag, null, "test"); + } + // Union of all intrinsics and components of `any` + function App(props) { + var Comp = props.component; + return (react_1["default"].createElement(Comp, null)); + } + // custom components with non-subset props + function render2() { + var C = null; + var a = react_1["default"].createElement(C, { p: true }); + } +} diff --git a/tests/baselines/reference/callsOnComplexSignatures.symbols b/tests/baselines/reference/callsOnComplexSignatures.symbols new file mode 100644 index 00000000000..dfbddce84ec --- /dev/null +++ b/tests/baselines/reference/callsOnComplexSignatures.symbols @@ -0,0 +1,334 @@ +=== tests/cases/compiler/callsOnComplexSignatures.tsx === +/// +import React from "react"; +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) + +// Simple calls from real usecases +function test1() { +>test1 : Symbol(test1, Decl(callsOnComplexSignatures.tsx, 1, 26)) + + type stringType1 = "foo" | "bar"; +>stringType1 : Symbol(stringType1, Decl(callsOnComplexSignatures.tsx, 4, 18)) + + type stringType2 = "baz" | "bar"; +>stringType2 : Symbol(stringType2, Decl(callsOnComplexSignatures.tsx, 5, 37)) + + interface Temp1 { +>Temp1 : Symbol(Temp1, Decl(callsOnComplexSignatures.tsx, 6, 37)) + + getValue(name: stringType1): number; +>getValue : Symbol(Temp1.getValue, Decl(callsOnComplexSignatures.tsx, 8, 21)) +>name : Symbol(name, Decl(callsOnComplexSignatures.tsx, 9, 17)) +>stringType1 : Symbol(stringType1, Decl(callsOnComplexSignatures.tsx, 4, 18)) + } + + interface Temp2 { +>Temp2 : Symbol(Temp2, Decl(callsOnComplexSignatures.tsx, 10, 5)) + + getValue(name: stringType2): string; +>getValue : Symbol(Temp2.getValue, Decl(callsOnComplexSignatures.tsx, 12, 21)) +>name : Symbol(name, Decl(callsOnComplexSignatures.tsx, 13, 17)) +>stringType2 : Symbol(stringType2, Decl(callsOnComplexSignatures.tsx, 5, 37)) + } + + function test(t: Temp1 | Temp2) { +>test : Symbol(test, Decl(callsOnComplexSignatures.tsx, 14, 5)) +>t : Symbol(t, Decl(callsOnComplexSignatures.tsx, 16, 18)) +>Temp1 : Symbol(Temp1, Decl(callsOnComplexSignatures.tsx, 6, 37)) +>Temp2 : Symbol(Temp2, Decl(callsOnComplexSignatures.tsx, 10, 5)) + + const z = t.getValue("bar"); // Should be fine +>z : Symbol(z, Decl(callsOnComplexSignatures.tsx, 17, 13)) +>t.getValue : Symbol(getValue, Decl(callsOnComplexSignatures.tsx, 8, 21), Decl(callsOnComplexSignatures.tsx, 12, 21)) +>t : Symbol(t, Decl(callsOnComplexSignatures.tsx, 16, 18)) +>getValue : Symbol(getValue, Decl(callsOnComplexSignatures.tsx, 8, 21), Decl(callsOnComplexSignatures.tsx, 12, 21)) + } +} + +function test2() { +>test2 : Symbol(test2, Decl(callsOnComplexSignatures.tsx, 19, 1)) + + interface Messages { +>Messages : Symbol(Messages, Decl(callsOnComplexSignatures.tsx, 21, 18)) + + readonly foo: (options: { [key: string]: any, b: number }) => string; +>foo : Symbol(Messages.foo, Decl(callsOnComplexSignatures.tsx, 22, 24)) +>options : Symbol(options, Decl(callsOnComplexSignatures.tsx, 23, 23)) +>key : Symbol(key, Decl(callsOnComplexSignatures.tsx, 23, 35)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 23, 53)) + + readonly bar: (options: { [key: string]: any, a: string }) => string; +>bar : Symbol(Messages.bar, Decl(callsOnComplexSignatures.tsx, 23, 77)) +>options : Symbol(options, Decl(callsOnComplexSignatures.tsx, 24, 23)) +>key : Symbol(key, Decl(callsOnComplexSignatures.tsx, 24, 35)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 24, 53)) + } + + const messages: Messages = { +>messages : Symbol(messages, Decl(callsOnComplexSignatures.tsx, 27, 9)) +>Messages : Symbol(Messages, Decl(callsOnComplexSignatures.tsx, 21, 18)) + + foo: (options) => "Foo", +>foo : Symbol(foo, Decl(callsOnComplexSignatures.tsx, 27, 32)) +>options : Symbol(options, Decl(callsOnComplexSignatures.tsx, 28, 14)) + + bar: (options) => "Bar", +>bar : Symbol(bar, Decl(callsOnComplexSignatures.tsx, 28, 32)) +>options : Symbol(options, Decl(callsOnComplexSignatures.tsx, 29, 14)) + + }; + + const test1 = (type: "foo" | "bar") => +>test1 : Symbol(test1, Decl(callsOnComplexSignatures.tsx, 32, 9)) +>type : Symbol(type, Decl(callsOnComplexSignatures.tsx, 32, 19)) + + messages[type]({ a: "A", b: 0 }); +>messages : Symbol(messages, Decl(callsOnComplexSignatures.tsx, 27, 9)) +>type : Symbol(type, Decl(callsOnComplexSignatures.tsx, 32, 19)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 33, 24)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 33, 32)) +} + +function test3(items: string[] | number[]) { +>test3 : Symbol(test3, Decl(callsOnComplexSignatures.tsx, 34, 1)) +>items : Symbol(items, Decl(callsOnComplexSignatures.tsx, 36, 15)) + + items.forEach(item => console.log(item)); +>items.forEach : Symbol(forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>items : Symbol(items, Decl(callsOnComplexSignatures.tsx, 36, 15)) +>forEach : Symbol(forEach, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>item : Symbol(item, Decl(callsOnComplexSignatures.tsx, 37, 18)) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>item : Symbol(item, Decl(callsOnComplexSignatures.tsx, 37, 18)) +} + +function test4( +>test4 : Symbol(test4, Decl(callsOnComplexSignatures.tsx, 38, 1)) + + arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number), +>arg1 : Symbol(arg1, Decl(callsOnComplexSignatures.tsx, 40, 15)) +>objs : Symbol(objs, Decl(callsOnComplexSignatures.tsx, 41, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 41, 22)) +>objs : Symbol(objs, Decl(callsOnComplexSignatures.tsx, 41, 51)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 41, 61)) + + arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number), +>arg2 : Symbol(arg2, Decl(callsOnComplexSignatures.tsx, 41, 86)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 42, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 42, 16)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 42, 27)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 42, 54)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 42, 64)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 42, 69)) + + arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number), +>arg3 : Symbol(arg3, Decl(callsOnComplexSignatures.tsx, 42, 92)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 43, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 43, 16)) +>objs : Symbol(objs, Decl(callsOnComplexSignatures.tsx, 43, 27)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 43, 38)) +>objs : Symbol(objs, Decl(callsOnComplexSignatures.tsx, 43, 67)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 43, 77)) + + arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number), +>arg4 : Symbol(arg4, Decl(callsOnComplexSignatures.tsx, 43, 102)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 44, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 44, 17)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 44, 28)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 44, 34)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 44, 61)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 44, 66)) + + arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number), +>arg5 : Symbol(arg5, Decl(callsOnComplexSignatures.tsx, 44, 89)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 45, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 45, 17)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 45, 28)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 45, 36)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 45, 65)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 45, 70)) + + arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number), +>arg6 : Symbol(arg6, Decl(callsOnComplexSignatures.tsx, 45, 93)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 46, 12)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 46, 17)) +>b : Symbol(b, Decl(callsOnComplexSignatures.tsx, 46, 28)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 46, 34)) +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 46, 61)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 46, 68)) + +) { + arg1(); +>arg1 : Symbol(arg1, Decl(callsOnComplexSignatures.tsx, 40, 15)) + + arg1({x: 0, y: 0}); +>arg1 : Symbol(arg1, Decl(callsOnComplexSignatures.tsx, 40, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 49, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 49, 15)) + + arg1({x: 0, y: 0}, {x: 1, y: 1}); +>arg1 : Symbol(arg1, Decl(callsOnComplexSignatures.tsx, 40, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 50, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 50, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 50, 24)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 50, 29)) + + arg2({x: 0}, {x: 0}); +>arg2 : Symbol(arg2, Decl(callsOnComplexSignatures.tsx, 41, 86)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 52, 10)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 52, 18)) + + arg3({x: 0}); +>arg3 : Symbol(arg3, Decl(callsOnComplexSignatures.tsx, 42, 92)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 54, 10)) + + arg3({x: 0}, {x: 0, y: 0}); +>arg3 : Symbol(arg3, Decl(callsOnComplexSignatures.tsx, 42, 92)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 55, 10)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 55, 18)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 55, 23)) + + arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}); +>arg3 : Symbol(arg3, Decl(callsOnComplexSignatures.tsx, 42, 92)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 56, 10)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 56, 18)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 56, 23)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 56, 32)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 56, 37)) + + arg4(); +>arg4 : Symbol(arg4, Decl(callsOnComplexSignatures.tsx, 43, 102)) + + arg4({x: 0, y: 0}); +>arg4 : Symbol(arg4, Decl(callsOnComplexSignatures.tsx, 43, 102)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 59, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 59, 15)) + + arg4({x: 0, y: 0}, {x: 0}); +>arg4 : Symbol(arg4, Decl(callsOnComplexSignatures.tsx, 43, 102)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 60, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 60, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 60, 24)) + + arg5(); +>arg5 : Symbol(arg5, Decl(callsOnComplexSignatures.tsx, 44, 89)) + + arg5({x: 0, y: 0}); +>arg5 : Symbol(arg5, Decl(callsOnComplexSignatures.tsx, 44, 89)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 63, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 63, 15)) + + arg5({x: 0, y: 0}, {x: 0}); +>arg5 : Symbol(arg5, Decl(callsOnComplexSignatures.tsx, 44, 89)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 64, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 64, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 64, 24)) + + arg6(); +>arg6 : Symbol(arg6, Decl(callsOnComplexSignatures.tsx, 45, 93)) + + arg6({x: 0, y: 0}); +>arg6 : Symbol(arg6, Decl(callsOnComplexSignatures.tsx, 45, 93)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 67, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 67, 15)) + + arg6({x: 0, y: 0}, {x: 0, y: 0}); +>arg6 : Symbol(arg6, Decl(callsOnComplexSignatures.tsx, 45, 93)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 68, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 68, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 68, 24)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 68, 29)) + + arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}); +>arg6 : Symbol(arg6, Decl(callsOnComplexSignatures.tsx, 45, 93)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 69, 10)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 69, 15)) +>x : Symbol(x, Decl(callsOnComplexSignatures.tsx, 69, 24)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 69, 29)) +>y : Symbol(y, Decl(callsOnComplexSignatures.tsx, 69, 38)) +} + +// JSX Tag names +function test5() { +>test5 : Symbol(test5, Decl(callsOnComplexSignatures.tsx, 70, 1)) + + // Pair of non-like intrinsics + function render(url?: string): React.ReactNode { +>render : Symbol(render, Decl(callsOnComplexSignatures.tsx, 73, 18)) +>url : Symbol(url, Decl(callsOnComplexSignatures.tsx, 75, 20)) +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) +>ReactNode : Symbol(React.ReactNode, Decl(react16.d.ts, 216, 49)) + + const Tag = url ? 'a' : 'button'; +>Tag : Symbol(Tag, Decl(callsOnComplexSignatures.tsx, 76, 13)) +>url : Symbol(url, Decl(callsOnComplexSignatures.tsx, 75, 20)) + + return test; +>Tag : Symbol(Tag, Decl(callsOnComplexSignatures.tsx, 76, 13)) +>Tag : Symbol(Tag, Decl(callsOnComplexSignatures.tsx, 76, 13)) + } + + // Union of all intrinsics and components of `any` + function App(props: { component:React.ReactType }) { +>App : Symbol(App, Decl(callsOnComplexSignatures.tsx, 78, 5)) +>props : Symbol(props, Decl(callsOnComplexSignatures.tsx, 81, 17)) +>component : Symbol(component, Decl(callsOnComplexSignatures.tsx, 81, 25)) +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) +>ReactType : Symbol(React.ReactType, Decl(react16.d.ts, 112, 21)) + + const Comp: React.ReactType = props.component; +>Comp : Symbol(Comp, Decl(callsOnComplexSignatures.tsx, 82, 13)) +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) +>ReactType : Symbol(React.ReactType, Decl(react16.d.ts, 112, 21)) +>props.component : Symbol(component, Decl(callsOnComplexSignatures.tsx, 81, 25)) +>props : Symbol(props, Decl(callsOnComplexSignatures.tsx, 81, 17)) +>component : Symbol(component, Decl(callsOnComplexSignatures.tsx, 81, 25)) + + return (); +>Comp : Symbol(Comp, Decl(callsOnComplexSignatures.tsx, 82, 13)) + } + + // custom components with non-subset props + function render2() { +>render2 : Symbol(render2, Decl(callsOnComplexSignatures.tsx, 84, 5)) + + interface P1 { +>P1 : Symbol(P1, Decl(callsOnComplexSignatures.tsx, 87, 24)) + + p?: boolean; +>p : Symbol(P1.p, Decl(callsOnComplexSignatures.tsx, 88, 22)) + + c?: string; +>c : Symbol(P1.c, Decl(callsOnComplexSignatures.tsx, 89, 24)) + } + interface P2 { +>P2 : Symbol(P2, Decl(callsOnComplexSignatures.tsx, 91, 9)) + + p?: boolean; +>p : Symbol(P2.p, Decl(callsOnComplexSignatures.tsx, 92, 22)) + + c?: any; +>c : Symbol(P2.c, Decl(callsOnComplexSignatures.tsx, 93, 24)) + + d?: any; +>d : Symbol(P2.d, Decl(callsOnComplexSignatures.tsx, 94, 20)) + } + + var C: React.ComponentType | React.ComponentType = null as any; +>C : Symbol(C, Decl(callsOnComplexSignatures.tsx, 98, 11)) +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) +>ComponentType : Symbol(React.ComponentType, Decl(react16.d.ts, 117, 60)) +>P1 : Symbol(P1, Decl(callsOnComplexSignatures.tsx, 87, 24)) +>React : Symbol(React, Decl(callsOnComplexSignatures.tsx, 1, 6)) +>ComponentType : Symbol(React.ComponentType, Decl(react16.d.ts, 117, 60)) +>P2 : Symbol(P2, Decl(callsOnComplexSignatures.tsx, 91, 9)) + + const a = ; +>a : Symbol(a, Decl(callsOnComplexSignatures.tsx, 100, 13)) +>C : Symbol(C, Decl(callsOnComplexSignatures.tsx, 98, 11)) +>p : Symbol(p, Decl(callsOnComplexSignatures.tsx, 100, 20)) + } +} + diff --git a/tests/baselines/reference/callsOnComplexSignatures.types b/tests/baselines/reference/callsOnComplexSignatures.types new file mode 100644 index 00000000000..4eb90ac43e3 --- /dev/null +++ b/tests/baselines/reference/callsOnComplexSignatures.types @@ -0,0 +1,416 @@ +=== tests/cases/compiler/callsOnComplexSignatures.tsx === +/// +import React from "react"; +>React : typeof React + +// Simple calls from real usecases +function test1() { +>test1 : () => void + + type stringType1 = "foo" | "bar"; +>stringType1 : "foo" | "bar" + + type stringType2 = "baz" | "bar"; +>stringType2 : "bar" | "baz" + + interface Temp1 { + getValue(name: stringType1): number; +>getValue : (name: "foo" | "bar") => number +>name : "foo" | "bar" + } + + interface Temp2 { + getValue(name: stringType2): string; +>getValue : (name: "bar" | "baz") => string +>name : "bar" | "baz" + } + + function test(t: Temp1 | Temp2) { +>test : (t: Temp1 | Temp2) => void +>t : Temp1 | Temp2 + + const z = t.getValue("bar"); // Should be fine +>z : React.ReactText +>t.getValue("bar") : React.ReactText +>t.getValue : ((name: "foo" | "bar") => number) | ((name: "bar" | "baz") => string) +>t : Temp1 | Temp2 +>getValue : ((name: "foo" | "bar") => number) | ((name: "bar" | "baz") => string) +>"bar" : "bar" + } +} + +function test2() { +>test2 : () => void + + interface Messages { + readonly foo: (options: { [key: string]: any, b: number }) => string; +>foo : (options: { [key: string]: any; b: number; }) => string +>options : { [key: string]: any; b: number; } +>key : string +>b : number + + readonly bar: (options: { [key: string]: any, a: string }) => string; +>bar : (options: { [key: string]: any; a: string; }) => string +>options : { [key: string]: any; a: string; } +>key : string +>a : string + } + + const messages: Messages = { +>messages : Messages +>{ foo: (options) => "Foo", bar: (options) => "Bar", } : { foo: (options: { [key: string]: any; b: number; }) => string; bar: (options: { [key: string]: any; a: string; }) => string; } + + foo: (options) => "Foo", +>foo : (options: { [key: string]: any; b: number; }) => string +>(options) => "Foo" : (options: { [key: string]: any; b: number; }) => string +>options : { [key: string]: any; b: number; } +>"Foo" : "Foo" + + bar: (options) => "Bar", +>bar : (options: { [key: string]: any; a: string; }) => string +>(options) => "Bar" : (options: { [key: string]: any; a: string; }) => string +>options : { [key: string]: any; a: string; } +>"Bar" : "Bar" + + }; + + const test1 = (type: "foo" | "bar") => +>test1 : (type: "foo" | "bar") => string +>(type: "foo" | "bar") => messages[type]({ a: "A", b: 0 }) : (type: "foo" | "bar") => string +>type : "foo" | "bar" + + messages[type]({ a: "A", b: 0 }); +>messages[type]({ a: "A", b: 0 }) : string +>messages[type] : ((options: { [key: string]: any; b: number; }) => string) | ((options: { [key: string]: any; a: string; }) => string) +>messages : Messages +>type : "foo" | "bar" +>{ a: "A", b: 0 } : { a: string; b: number; } +>a : string +>"A" : "A" +>b : number +>0 : 0 +} + +function test3(items: string[] | number[]) { +>test3 : (items: string[] | number[]) => void +>items : string[] | number[] + + items.forEach(item => console.log(item)); +>items.forEach(item => console.log(item)) : void +>items.forEach : ((callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void) | ((callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void) +>items : string[] | number[] +>forEach : ((callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void) | ((callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void) +>item => console.log(item) : (item: any) => void +>item : any +>console.log(item) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>item : any +} + +function test4( +>test4 : (arg1: ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number), arg2: ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number), arg3: ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number), arg4: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number), arg5: ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number), arg6: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number)) => void + + arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number), +>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number) +>objs : { x: number; }[] +>x : number +>objs : { y: number; }[] +>y : number + + arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number), +>arg2 : ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number) +>a : { x: number; } +>x : number +>b : object +>a : object +>b : { x: number; } +>x : number + + arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number), +>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number) +>a : { x: number; } +>x : number +>objs : { y: number; }[] +>y : number +>objs : { x: number; }[] +>x : number + + arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number), +>arg4 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number) +>a : { x: number; } | undefined +>x : number +>b : { x: number; } | undefined +>x : number +>a : { y: number; } | undefined +>y : number + + arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number), +>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number) +>a : { x: number; } | undefined +>x : number +>b : { x: number; }[] +>x : number +>a : { y: number; } | undefined +>y : number + + arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number), +>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number) +>a : { x: number; } | undefined +>x : number +>b : { x: number; } | undefined +>x : number +>a : { y: number; }[] +>y : number + +) { + arg1(); +>arg1() : number +>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number) + + arg1({x: 0, y: 0}); +>arg1({x: 0, y: 0}) : number +>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg1({x: 0, y: 0}, {x: 1, y: 1}); +>arg1({x: 0, y: 0}, {x: 1, y: 1}) : number +>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 1, y: 1} : { x: number; y: number; } +>x : number +>1 : 1 +>y : number +>1 : 1 + + arg2({x: 0}, {x: 0}); +>arg2({x: 0}, {x: 0}) : number +>arg2 : ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number) +>{x: 0} : { x: number; } +>x : number +>0 : 0 +>{x: 0} : { x: number; } +>x : number +>0 : 0 + + arg3({x: 0}); +>arg3({x: 0}) : number +>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number) +>{x: 0} : { x: number; } +>x : number +>0 : 0 + + arg3({x: 0}, {x: 0, y: 0}); +>arg3({x: 0}, {x: 0, y: 0}) : number +>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number) +>{x: 0} : { x: number; } +>x : number +>0 : 0 +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}); +>arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}) : number +>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number) +>{x: 0} : { x: number; } +>x : number +>0 : 0 +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg4(); +>arg4() : number +>arg4 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number) + + arg4({x: 0, y: 0}); +>arg4({x: 0, y: 0}) : number +>arg4 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg4({x: 0, y: 0}, {x: 0}); +>arg4({x: 0, y: 0}, {x: 0}) : number +>arg4 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 0} : { x: number; } +>x : number +>0 : 0 + + arg5(); +>arg5() : number +>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number) + + arg5({x: 0, y: 0}); +>arg5({x: 0, y: 0}) : number +>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg5({x: 0, y: 0}, {x: 0}); +>arg5({x: 0, y: 0}, {x: 0}) : number +>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 0} : { x: number; } +>x : number +>0 : 0 + + arg6(); +>arg6() : number +>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number) + + arg6({x: 0, y: 0}); +>arg6({x: 0, y: 0}) : number +>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg6({x: 0, y: 0}, {x: 0, y: 0}); +>arg6({x: 0, y: 0}, {x: 0, y: 0}) : number +>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 + + arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}); +>arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}) : number +>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number) +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{x: 0, y: 0} : { x: number; y: number; } +>x : number +>0 : 0 +>y : number +>0 : 0 +>{y: 0} : { y: number; } +>y : number +>0 : 0 +} + +// JSX Tag names +function test5() { +>test5 : () => void + + // Pair of non-like intrinsics + function render(url?: string): React.ReactNode { +>render : (url?: string | undefined) => React.ReactNode +>url : string | undefined +>React : any + + const Tag = url ? 'a' : 'button'; +>Tag : "a" | "button" +>url ? 'a' : 'button' : "a" | "button" +>url : string | undefined +>'a' : "a" +>'button' : "button" + + return test; +>test : JSX.Element +>Tag : "a" | "button" +>Tag : "a" | "button" + } + + // Union of all intrinsics and components of `any` + function App(props: { component:React.ReactType }) { +>App : (props: { component: React.ReactType; }) => JSX.Element +>props : { component: React.ReactType; } +>component : React.ReactType +>React : any + + const Comp: React.ReactType = props.component; +>Comp : React.ReactType +>React : any +>props.component : React.ReactType +>props : { component: React.ReactType; } +>component : React.ReactType + + return (); +>() : JSX.Element +> : JSX.Element +>Comp : React.ReactType + } + + // custom components with non-subset props + function render2() { +>render2 : () => void + + interface P1 { + p?: boolean; +>p : boolean | undefined + + c?: string; +>c : string | undefined + } + interface P2 { + p?: boolean; +>p : boolean | undefined + + c?: any; +>c : any + + d?: any; +>d : any + } + + var C: React.ComponentType | React.ComponentType = null as any; +>C : React.ComponentClass | React.StatelessComponent | React.ComponentClass | React.StatelessComponent +>React : any +>React : any +>null as any : any +>null : null + + const a = ; +>a : JSX.Element +> : JSX.Element +>C : React.ComponentClass | React.StatelessComponent | React.ComponentClass | React.StatelessComponent +>p : true +>true : true + } +} + diff --git a/tests/baselines/reference/controlFlowArrayErrors.errors.txt b/tests/baselines/reference/controlFlowArrayErrors.errors.txt index 403cafacf5d..59ec0b44f5c 100644 --- a/tests/baselines/reference/controlFlowArrayErrors.errors.txt +++ b/tests/baselines/reference/controlFlowArrayErrors.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/controlFlowArrayErrors.ts(19,9): error TS7034: Variable 'x' tests/cases/compiler/controlFlowArrayErrors.ts(22,9): error TS7005: Variable 'x' implicitly has an 'any[]' type. tests/cases/compiler/controlFlowArrayErrors.ts(29,12): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. tests/cases/compiler/controlFlowArrayErrors.ts(34,12): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string | number'. -tests/cases/compiler/controlFlowArrayErrors.ts(48,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((...items: (string | number)[]) => number) | ((...items: boolean[]) => number)' has no compatible call signatures. +tests/cases/compiler/controlFlowArrayErrors.ts(48,12): error TS2345: Argument of type '99' is not assignable to parameter of type 'never'. tests/cases/compiler/controlFlowArrayErrors.ts(56,12): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/compiler/controlFlowArrayErrors.ts(60,11): error TS7034: Variable 'x' implicitly has type 'any[]' in some locations where its type cannot be determined. tests/cases/compiler/controlFlowArrayErrors.ts(63,9): error TS7005: Variable 'x' implicitly has an 'any[]' type. @@ -77,8 +77,8 @@ tests/cases/compiler/controlFlowArrayErrors.ts(63,9): error TS7005: Variable 'x' } x; // boolean[] | (string | number)[] x.push(99); // Error - ~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((...items: (string | number)[]) => number) | ((...items: boolean[]) => number)' has no compatible call signatures. + ~~ +!!! error TS2345: Argument of type '99' is not assignable to parameter of type 'never'. } function f7() { diff --git a/tests/baselines/reference/functionCallOnConstrainedTypeVariable.errors.txt b/tests/baselines/reference/functionCallOnConstrainedTypeVariable.errors.txt index 1ff56c7612f..f7ea353e10f 100644 --- a/tests/baselines/reference/functionCallOnConstrainedTypeVariable.errors.txt +++ b/tests/baselines/reference/functionCallOnConstrainedTypeVariable.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(11,3): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. -tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(15,3): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. -tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(18,3): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. -tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,3): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. +tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(11,7): error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'. +tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(15,7): error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'. +tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(18,5): error TS2345: Argument of type '""' is not assignable to parameter of type 'never'. +tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,3): error TS2554: Expected 1 arguments, but got 4. ==== tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts (4 errors) ==== @@ -16,20 +16,20 @@ tests/cases/compiler/functionCallOnConstrainedTypeVariable.ts(19,3): error TS234 function call0(p: A | B) { p.a("s"); // Error - ~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. + ~~~ +!!! error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'. } function callN(p: T) { p.a("s"); // Error - ~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. + ~~~ +!!! error TS2345: Argument of type '"s"' is not assignable to parameter of type 'never'. var a: T["a"] = p.a; a(""); // Error - ~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. + ~~ +!!! error TS2345: Argument of type '""' is not assignable to parameter of type 'never'. a("", "", "", ""); // Error ~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((x: number) => string) | ((x: boolean) => string)' has no compatible call signatures. +!!! error TS2554: Expected 1 arguments, but got 4. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType1.errors.txt b/tests/baselines/reference/tsxUnionElementType1.errors.txt index 9290e734d83..e2f5bef6333 100644 --- a/tests/baselines/reference/tsxUnionElementType1.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(12,2): error TS2604: JSX element type 'SFCComp' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type 'true' is not assignable to type 'never'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -14,5 +14,6 @@ tests/cases/conformance/jsx/file.tsx(12,2): error TS2604: JSX element type 'SFCC var SFCComp = SFC1 || SFC2; - ~~~~~~~ -!!! error TS2604: JSX element type 'SFCComp' does not have any construct or call signatures. \ No newline at end of file + ~ +!!! error TS2322: Type 'true' is not assignable to type 'never'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:23: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & { x: number; } & { x: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType2.errors.txt b/tests/baselines/reference/tsxUnionElementType2.errors.txt index 091d828dfe3..87f1d7fc2dc 100644 --- a/tests/baselines/reference/tsxUnionElementType2.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/jsx/file.tsx(12,2): error TS2604: JSX element type 'SFCComp' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(12,10): error TS2322: Type 'string' is not assignable to type 'never'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -14,5 +14,6 @@ tests/cases/conformance/jsx/file.tsx(12,2): error TS2604: JSX element type 'SFCC var SFCComp = SFC1 || SFC2; - ~~~~~~~ -!!! error TS2604: JSX element type 'SFCComp' does not have any construct or call signatures. \ No newline at end of file + ~ +!!! error TS2322: Type 'string' is not assignable to type 'never'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:23: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & { x: number; } & { x: boolean; }' \ No newline at end of file diff --git a/tests/baselines/reference/tsxUnionElementType3.errors.txt b/tests/baselines/reference/tsxUnionElementType3.errors.txt index bfdb61f4061..8f8ce3c28bd 100644 --- a/tests/baselines/reference/tsxUnionElementType3.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType3.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(32,10): error TS2604: JSX element type 'RCComp' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(32,17): error TS2322: Type 'string' is not assignable to type 'number & string'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -34,8 +35,10 @@ tests/cases/conformance/jsx/file.tsx(32,10): error TS2604: JSX element type 'RCC var RCComp = RC1 || RC2; // OK let a = ; - ~~~~~~ -!!! error TS2604: JSX element type 'RCComp' does not have any construct or call signatures. + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number & string'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & { x: number; } & { children?: ReactNode; } & { x: string; } & { children?: ReactNode; }' let a1 = ; let a2 = ; let b = diff --git a/tests/baselines/reference/tsxUnionElementType4.errors.txt b/tests/baselines/reference/tsxUnionElementType4.errors.txt index 4ca07f26541..4b059d093f8 100644 --- a/tests/baselines/reference/tsxUnionElementType4.errors.txt +++ b/tests/baselines/reference/tsxUnionElementType4.errors.txt @@ -1,4 +1,5 @@ -tests/cases/conformance/jsx/file.tsx(32,10): error TS2604: JSX element type 'RCComp' does not have any construct or call signatures. +tests/cases/conformance/jsx/file.tsx(32,17): error TS2322: Type 'true' is not assignable to type 'number & string'. + Type 'true' is not assignable to type 'number'. tests/cases/conformance/jsx/file.tsx(33,10): error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. Property 'x' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ prop: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. @@ -38,8 +39,10 @@ tests/cases/conformance/jsx/file.tsx(34,10): error TS2322: Type '{ prop: true; } var PartRCComp = RC1 || RC4; // Error let a = ; - ~~~~~~ -!!! error TS2604: JSX element type 'RCComp' does not have any construct or call signatures. + ~ +!!! error TS2322: Type 'true' is not assignable to type 'number & string'. +!!! error TS2322: Type 'true' is not assignable to type 'number'. +!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:36: The expected type comes from property 'x' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes & { x: number; } & { children?: ReactNode; } & { x: string; } & { children?: ReactNode; }' let b = ~~~~~~~~~~ !!! error TS2322: Type '{ x: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { children?: ReactNode; }'. diff --git a/tests/baselines/reference/unionTypeCallSignatures.errors.txt b/tests/baselines/reference/unionTypeCallSignatures.errors.txt index 5a67bde722c..c260d7ce511 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeCallSignatures.errors.txt @@ -2,9 +2,11 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS23 tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. -tests/cases/conformance/types/union/unionTypeCallSignatures.ts(21,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'number & string'. + Type '10' is not assignable to type 'string'. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,32): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number & string'. + Type '"hello"' is not assignable to type 'number'. +tests/cases/conformance/types/union/unionTypeCallSignatures.ts(21,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(24,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(26,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeCallSignatures.ts(29,1): error TS2554: Expected 2 arguments, but got 0. @@ -56,14 +58,17 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2 var unionOfDifferentParameterTypes: { (a: number): number; } | { (a: string): Date; }; unionOfDifferentParameterTypes(10);// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. + ~~ +!!! error TS2345: Argument of type '10' is not assignable to parameter of type 'number & string'. +!!! error TS2345: Type '10' is not assignable to type 'string'. unionOfDifferentParameterTypes("hello");// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number & string'. +!!! error TS2345: Type '"hello"' is not assignable to type 'number'. unionOfDifferentParameterTypes();// error - no call signatures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures. +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeCallSignatures.ts:18:40: An argument for 'a' was not provided. var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number): Date; (a: string): boolean; }; unionOfDifferentNumberOfSignatures(); // error - no call signatures diff --git a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt index a5ad21ba580..92adc83a0d2 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.errors.txt +++ b/tests/baselines/reference/unionTypeConstructSignatures.errors.txt @@ -2,9 +2,11 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(9,47): error tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(10,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(15,33): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(21,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'number & string'. + Type '10' is not assignable to type 'string'. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(20,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number & string'. + Type '"hello"' is not assignable to type 'number'. +tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(21,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(24,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(26,40): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'. tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(29,1): error TS2554: Expected 2 arguments, but got 0. @@ -55,14 +57,17 @@ tests/cases/conformance/types/union/unionTypeConstructSignatures.ts(70,12): erro var unionOfDifferentParameterTypes: { new (a: number): number; } | { new (a: string): Date; }; new unionOfDifferentParameterTypes(10);// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + ~~ +!!! error TS2345: Argument of type '10' is not assignable to parameter of type 'number & string'. +!!! error TS2345: Type '10' is not assignable to type 'string'. new unionOfDifferentParameterTypes("hello");// error - no call signatures - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. + ~~~~~~~ +!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number & string'. +!!! error TS2345: Type '"hello"' is not assignable to type 'number'. new unionOfDifferentParameterTypes();// error - no call signatures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 tests/cases/conformance/types/union/unionTypeConstructSignatures.ts:18:44: An argument for 'a' was not provided. var unionOfDifferentNumberOfSignatures: { new (a: number): number; } | { new (a: number): Date; new (a: string): boolean; }; new unionOfDifferentNumberOfSignatures(); // error - no call signatures diff --git a/tests/baselines/reference/unionTypeMembers.errors.txt b/tests/baselines/reference/unionTypeMembers.errors.txt index 6d9f1321a74..2a2f93d1a07 100644 --- a/tests/baselines/reference/unionTypeMembers.errors.txt +++ b/tests/baselines/reference/unionTypeMembers.errors.txt @@ -1,4 +1,6 @@ -tests/cases/conformance/types/union/unionTypeMembers.ts(44,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: number) => number)' has no compatible call signatures. +tests/cases/conformance/types/union/unionTypeMembers.ts(44,38): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string & number'. + Type 'string' is not assignable to type 'string & number'. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/union/unionTypeMembers.ts(51,3): error TS2339: Property 'propertyOnlyInI1' does not exist on type 'I1 | I2'. Property 'propertyOnlyInI1' does not exist on type 'I2'. tests/cases/conformance/types/union/unionTypeMembers.ts(52,3): error TS2339: Property 'propertyOnlyInI2' does not exist on type 'I1 | I2'. @@ -54,8 +56,10 @@ tests/cases/conformance/types/union/unionTypeMembers.ts(54,3): error TS2339: Pro strOrNum = x.commonMethodDifferentReturnType(str); // string | union x.commonMethodDifferentParameterType; // No error - property exists x.commonMethodDifferentParameterType(strOrNum); // error - no call signatures because the type of this property is ((a: string) => string) | (a: number) => number - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: number) => number)' has no compatible call signatures. + ~~~~~~~~ +!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string & number'. +!!! error TS2345: Type 'string' is not assignable to type 'string & number'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. // and the call signatures arent identical num = x.commonMethodWithTypeParameter(num); num = x.commonMethodWithOwnTypeParameter(num); diff --git a/tests/cases/compiler/callsOnComplexSignatures.tsx b/tests/cases/compiler/callsOnComplexSignatures.tsx new file mode 100644 index 00000000000..eb1ff9e753a --- /dev/null +++ b/tests/cases/compiler/callsOnComplexSignatures.tsx @@ -0,0 +1,106 @@ +// @jsx: react +// @esModuleInterop: true +// @strict: true +/// +import React from "react"; + +// Simple calls from real usecases +function test1() { + type stringType1 = "foo" | "bar"; + type stringType2 = "baz" | "bar"; + + interface Temp1 { + getValue(name: stringType1): number; + } + + interface Temp2 { + getValue(name: stringType2): string; + } + + function test(t: Temp1 | Temp2) { + const z = t.getValue("bar"); // Should be fine + } +} + +function test2() { + interface Messages { + readonly foo: (options: { [key: string]: any, b: number }) => string; + readonly bar: (options: { [key: string]: any, a: string }) => string; + } + + const messages: Messages = { + foo: (options) => "Foo", + bar: (options) => "Bar", + }; + + const test1 = (type: "foo" | "bar") => + messages[type]({ a: "A", b: 0 }); +} + +function test3(items: string[] | number[]) { + items.forEach(item => console.log(item)); +} + +function test4( + arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number), + arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number), + arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number), + arg4: ((a?: {x: number}, b?: {x: number}) => number) | ((a?: {y: number}) => number), + arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number), + arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number), +) { + arg1(); + arg1({x: 0, y: 0}); + arg1({x: 0, y: 0}, {x: 1, y: 1}); + + arg2({x: 0}, {x: 0}); + + arg3({x: 0}); + arg3({x: 0}, {x: 0, y: 0}); + arg3({x: 0}, {x: 0, y: 0}, {x: 0, y: 0}); + + arg4(); + arg4({x: 0, y: 0}); + arg4({x: 0, y: 0}, {x: 0}); + + arg5(); + arg5({x: 0, y: 0}); + arg5({x: 0, y: 0}, {x: 0}); + + arg6(); + arg6({x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}); + arg6({x: 0, y: 0}, {x: 0, y: 0}, {y: 0}); +} + +// JSX Tag names +function test5() { + // Pair of non-like intrinsics + function render(url?: string): React.ReactNode { + const Tag = url ? 'a' : 'button'; + return test; + } + + // Union of all intrinsics and components of `any` + function App(props: { component:React.ReactType }) { + const Comp: React.ReactType = props.component; + return (); + } + + // custom components with non-subset props + function render2() { + interface P1 { + p?: boolean; + c?: string; + } + interface P2 { + p?: boolean; + c?: any; + d?: any; + } + + var C: React.ComponentType | React.ComponentType = null as any; + + const a = ; + } +} diff --git a/tests/cases/fourslash/calledUnionsOfDissimilarTyeshaveGoodDisplay.ts b/tests/cases/fourslash/calledUnionsOfDissimilarTyeshaveGoodDisplay.ts new file mode 100644 index 00000000000..e8c42871b67 --- /dev/null +++ b/tests/cases/fourslash/calledUnionsOfDissimilarTyeshaveGoodDisplay.ts @@ -0,0 +1,53 @@ +/// + +////declare const callableThing1: +//// | ((o1: {x: number}) => void) +//// | ((o1: {y: number}) => void) +//// ; +//// +////callableThing1(/*1*/); +//// +////declare const callableThing2: +//// | ((o1: {x: number}) => void) +//// | ((o2: {y: number}) => void) +//// ; +//// +////callableThing2(/*2*/); +//// +////declare const callableThing3: +//// | ((o1: {x: number}) => void) +//// | ((o2: {y: number}) => void) +//// | ((o3: {z: number}) => void) +//// | ((o4: {u: number}) => void) +//// | ((o5: {v: number}) => void) +//// ; +//// +////callableThing3(/*3*/); +//// +////declare const callableThing4: +//// | ((o1: {x: number}) => void) +//// | ((o2: {y: number}) => void) +//// | ((o3: {z: number}) => void) +//// | ((o4: {u: number}) => void) +//// | ((o5: {v: number}) => void) +//// | ((o6: {w: number}) => void) +//// ; +//// +////callableThing4(/*4*/); + +verify.signatureHelp({ + marker: "1", + text: "callableThing1(o1: { x: number; } & { y: number; }): void" +}, +{ + marker: "2", + text: "callableThing2(arg0: { x: number; } & { y: number; }): void" +}, +{ + marker: "3", + text: "callableThing3(arg0: { x: number; } & { y: number; } & { z: number; } & { u: number; } & { v: number; }): void" +}, +{ + marker: "4", + text: "callableThing4(arg0: { x: number; } & { y: number; } & { z: number; } & { u: number; } & { v: number; } & { w: number; }): void" +}); diff --git a/tests/cases/fourslash/tsxCompletionUnionElementType.ts b/tests/cases/fourslash/tsxCompletionUnionElementType.ts index 7d458f83493..b554d385179 100644 --- a/tests/cases/fourslash/tsxCompletionUnionElementType.ts +++ b/tests/cases/fourslash/tsxCompletionUnionElementType.ts @@ -19,4 +19,4 @@ //// var SFCComp = SFC1 || SFC2; //// -verify.completions({ marker: "", exact: undefined }); +verify.completions({ marker: "", exact: ["x"] }); diff --git a/tests/cases/fourslash/tsxGoToDefinitionUnionElementType1.ts b/tests/cases/fourslash/tsxGoToDefinitionUnionElementType1.ts index 9e4cb4e1b1b..957b6b811e0 100644 --- a/tests/cases/fourslash/tsxGoToDefinitionUnionElementType1.ts +++ b/tests/cases/fourslash/tsxGoToDefinitionUnionElementType1.ts @@ -22,5 +22,5 @@ //// <[|SFC/*one*/Comp|] x /> verify.goToDefinition({ - "one": ["def"], + "one": ["def", "pt1"], }); From 93acaac0875ca28bba5b1b3ab626ebf571c3d1e4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 20 Dec 2018 07:17:42 -0800 Subject: [PATCH 219/322] Fix discriminant property check --- src/compiler/checker.ts | 46 +++++++++++++++++------------------------ src/compiler/types.ts | 20 ++++++++++-------- 2 files changed, 30 insertions(+), 36 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 23c5568f2e5..cf630f5e6fd 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7669,38 +7669,37 @@ namespace ts { return props[0]; } let declarations: Declaration[] | undefined; - let commonType: Type | undefined; + let firstType: Type | undefined; let nameType: Type | undefined; const propTypes: Type[] = []; - let first = true; - let commonValueDeclaration: Declaration | undefined; + let firstValueDeclaration: Declaration | undefined; let hasNonUniformValueDeclaration = false; for (const prop of props) { - if (!commonValueDeclaration) { - commonValueDeclaration = prop.valueDeclaration; + if (!firstValueDeclaration) { + firstValueDeclaration = prop.valueDeclaration; } - else if (prop.valueDeclaration !== commonValueDeclaration) { + else if (prop.valueDeclaration !== firstValueDeclaration) { hasNonUniformValueDeclaration = true; } declarations = addRange(declarations, prop.declarations); const type = getTypeOfSymbol(prop); - if (first) { - commonType = type; + if (!firstType) { + firstType = type; nameType = prop.nameType; - first = false; } - else { - if (type !== commonType) { - checkFlags |= CheckFlags.HasNonUniformType; - } + else if (type !== firstType) { + checkFlags |= CheckFlags.HasNonUniformType; + } + if (isLiteralType(type)) { + checkFlags |= CheckFlags.HasLiteralType; } propTypes.push(type); } addRange(propTypes, indexTypes); const result = createSymbol(SymbolFlags.Property | commonFlags, name, syntheticFlag | checkFlags); result.containingType = containingType; - if (!hasNonUniformValueDeclaration && commonValueDeclaration) { - result.valueDeclaration = commonValueDeclaration; + if (!hasNonUniformValueDeclaration && firstValueDeclaration) { + result.valueDeclaration = firstValueDeclaration; } result.declarations = declarations!; result.nameType = nameType; @@ -14814,17 +14813,8 @@ namespace ts { } function isDiscriminantType(type: Type): boolean { - if (type.flags & TypeFlags.Union) { - if (type.flags & (TypeFlags.Boolean | TypeFlags.EnumLiteral)) { - return true; - } - let combined = 0; - for (const t of (type).types) combined |= t.flags; - if (combined & TypeFlags.Unit && !(combined & TypeFlags.Instantiable)) { - return true; - } - } - return false; + return !!(type.flags & TypeFlags.Union && + (type.flags & (TypeFlags.Boolean | TypeFlags.EnumLiteral) || !isGenericIndexType(type))); } function isDiscriminantProperty(type: Type | undefined, name: __String) { @@ -14832,7 +14822,9 @@ namespace ts { const prop = getUnionOrIntersectionProperty(type, name); if (prop && getCheckFlags(prop) & CheckFlags.SyntheticProperty) { if ((prop).isDiscriminantProperty === undefined) { - (prop).isDiscriminantProperty = !!((prop).checkFlags & CheckFlags.HasNonUniformType) && isDiscriminantType(getTypeOfSymbol(prop)); + (prop).isDiscriminantProperty = + ((prop).checkFlags & CheckFlags.Discriminant) === CheckFlags.Discriminant && + isDiscriminantType(getTypeOfSymbol(prop)); } return !!(prop).isDiscriminantProperty; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b70b4e4d3d0..6e2e480503a 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3677,15 +3677,17 @@ namespace ts { Readonly = 1 << 3, // Readonly transient symbol Partial = 1 << 4, // Synthetic property present in some but not all constituents HasNonUniformType = 1 << 5, // Synthetic property with non-uniform type in constituents - ContainsPublic = 1 << 6, // Synthetic property with public constituent(s) - ContainsProtected = 1 << 7, // Synthetic property with protected constituent(s) - ContainsPrivate = 1 << 8, // Synthetic property with private constituent(s) - ContainsStatic = 1 << 9, // Synthetic property with static constituent(s) - Late = 1 << 10, // Late-bound symbol for a computed property with a dynamic name - ReverseMapped = 1 << 11, // Property of reverse-inferred homomorphic mapped type - OptionalParameter = 1 << 12, // Optional parameter - RestParameter = 1 << 13, // Rest parameter - Synthetic = SyntheticProperty | SyntheticMethod + HasLiteralType = 1 << 6, // Synthetic property with at least one literal type in constituents + ContainsPublic = 1 << 7, // Synthetic property with public constituent(s) + ContainsProtected = 1 << 8, // Synthetic property with protected constituent(s) + ContainsPrivate = 1 << 9, // Synthetic property with private constituent(s) + ContainsStatic = 1 << 10, // Synthetic property with static constituent(s) + Late = 1 << 11, // Late-bound symbol for a computed property with a dynamic name + ReverseMapped = 1 << 12, // Property of reverse-inferred homomorphic mapped type + OptionalParameter = 1 << 13, // Optional parameter + RestParameter = 1 << 14, // Rest parameter + Synthetic = SyntheticProperty | SyntheticMethod, + Discriminant = HasNonUniformType | HasLiteralType } /* @internal */ From 3e93461fc84108bdcd8abafbcbf96b5c8bbcc284 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 20 Dec 2018 07:21:49 -0800 Subject: [PATCH 220/322] Add regression test --- .../compiler/discriminantPropertyCheck.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/cases/compiler/discriminantPropertyCheck.ts b/tests/cases/compiler/discriminantPropertyCheck.ts index 16fb847bdf0..a24fe07973b 100644 --- a/tests/cases/compiler/discriminantPropertyCheck.ts +++ b/tests/cases/compiler/discriminantPropertyCheck.ts @@ -99,3 +99,25 @@ function func2(inst: Instance) { } } } + +// Repro from #29106 + +const f = (_a: string, _b: string): void => {}; + +interface A { + a?: string; + b?: string; +} + +interface B { + a: string; + b: string; +} + +type U = A | B; + +const u: U = {} as any; + +u.a && u.b && f(u.a, u.b); + +u.b && u.a && f(u.a, u.b); From 017c11acaa0747481f978bb76a25c32315f3f5a7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 20 Dec 2018 07:21:56 -0800 Subject: [PATCH 221/322] Accept new baselines --- .../discriminantPropertyCheck.errors.txt | 22 ++++++ .../reference/discriminantPropertyCheck.js | 27 ++++++++ .../discriminantPropertyCheck.symbols | 66 ++++++++++++++++++ .../reference/discriminantPropertyCheck.types | 68 +++++++++++++++++++ 4 files changed, 183 insertions(+) diff --git a/tests/baselines/reference/discriminantPropertyCheck.errors.txt b/tests/baselines/reference/discriminantPropertyCheck.errors.txt index a57e17ed81e..313116edde5 100644 --- a/tests/baselines/reference/discriminantPropertyCheck.errors.txt +++ b/tests/baselines/reference/discriminantPropertyCheck.errors.txt @@ -106,4 +106,26 @@ tests/cases/compiler/discriminantPropertyCheck.ts(65,9): error TS2532: Object is } } } + + // Repro from #29106 + + const f = (_a: string, _b: string): void => {}; + + interface A { + a?: string; + b?: string; + } + + interface B { + a: string; + b: string; + } + + type U = A | B; + + const u: U = {} as any; + + u.a && u.b && f(u.a, u.b); + + u.b && u.a && f(u.a, u.b); \ No newline at end of file diff --git a/tests/baselines/reference/discriminantPropertyCheck.js b/tests/baselines/reference/discriminantPropertyCheck.js index e58f28dc5a1..8b2c6f122bc 100644 --- a/tests/baselines/reference/discriminantPropertyCheck.js +++ b/tests/baselines/reference/discriminantPropertyCheck.js @@ -98,6 +98,28 @@ function func2(inst: Instance) { } } } + +// Repro from #29106 + +const f = (_a: string, _b: string): void => {}; + +interface A { + a?: string; + b?: string; +} + +interface B { + a: string; + b: string; +} + +type U = A | B; + +const u: U = {} as any; + +u.a && u.b && f(u.a, u.b); + +u.b && u.a && f(u.a, u.b); //// [discriminantPropertyCheck.js] @@ -161,3 +183,8 @@ function func2(inst) { } } } +// Repro from #29106 +var f = function (_a, _b) { }; +var u = {}; +u.a && u.b && f(u.a, u.b); +u.b && u.a && f(u.a, u.b); diff --git a/tests/baselines/reference/discriminantPropertyCheck.symbols b/tests/baselines/reference/discriminantPropertyCheck.symbols index 564cc55e3d3..78884eaf69f 100644 --- a/tests/baselines/reference/discriminantPropertyCheck.symbols +++ b/tests/baselines/reference/discriminantPropertyCheck.symbols @@ -311,3 +311,69 @@ function func2(inst: Instance) { } } +// Repro from #29106 + +const f = (_a: string, _b: string): void => {}; +>f : Symbol(f, Decl(discriminantPropertyCheck.ts, 102, 5)) +>_a : Symbol(_a, Decl(discriminantPropertyCheck.ts, 102, 11)) +>_b : Symbol(_b, Decl(discriminantPropertyCheck.ts, 102, 22)) + +interface A { +>A : Symbol(A, Decl(discriminantPropertyCheck.ts, 102, 47)) + + a?: string; +>a : Symbol(A.a, Decl(discriminantPropertyCheck.ts, 104, 13)) + + b?: string; +>b : Symbol(A.b, Decl(discriminantPropertyCheck.ts, 105, 13)) +} + +interface B { +>B : Symbol(B, Decl(discriminantPropertyCheck.ts, 107, 1)) + + a: string; +>a : Symbol(B.a, Decl(discriminantPropertyCheck.ts, 109, 13)) + + b: string; +>b : Symbol(B.b, Decl(discriminantPropertyCheck.ts, 110, 12)) +} + +type U = A | B; +>U : Symbol(U, Decl(discriminantPropertyCheck.ts, 112, 1)) +>A : Symbol(A, Decl(discriminantPropertyCheck.ts, 102, 47)) +>B : Symbol(B, Decl(discriminantPropertyCheck.ts, 107, 1)) + +const u: U = {} as any; +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>U : Symbol(U, Decl(discriminantPropertyCheck.ts, 112, 1)) + +u.a && u.b && f(u.a, u.b); +>u.a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u.b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>f : Symbol(f, Decl(discriminantPropertyCheck.ts, 102, 5)) +>u.a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u.b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) + +u.b && u.a && f(u.a, u.b); +>u.b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>u.a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>f : Symbol(f, Decl(discriminantPropertyCheck.ts, 102, 5)) +>u.a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>a : Symbol(a, Decl(discriminantPropertyCheck.ts, 104, 13), Decl(discriminantPropertyCheck.ts, 109, 13)) +>u.b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) +>u : Symbol(u, Decl(discriminantPropertyCheck.ts, 116, 5)) +>b : Symbol(b, Decl(discriminantPropertyCheck.ts, 105, 13), Decl(discriminantPropertyCheck.ts, 110, 12)) + diff --git a/tests/baselines/reference/discriminantPropertyCheck.types b/tests/baselines/reference/discriminantPropertyCheck.types index 4f34ceafc43..c243ef5e798 100644 --- a/tests/baselines/reference/discriminantPropertyCheck.types +++ b/tests/baselines/reference/discriminantPropertyCheck.types @@ -310,3 +310,71 @@ function func2(inst: Instance) { } } +// Repro from #29106 + +const f = (_a: string, _b: string): void => {}; +>f : (_a: string, _b: string) => void +>(_a: string, _b: string): void => {} : (_a: string, _b: string) => void +>_a : string +>_b : string + +interface A { + a?: string; +>a : string | undefined + + b?: string; +>b : string | undefined +} + +interface B { + a: string; +>a : string + + b: string; +>b : string +} + +type U = A | B; +>U : U + +const u: U = {} as any; +>u : U +>{} as any : any +>{} : {} + +u.a && u.b && f(u.a, u.b); +>u.a && u.b && f(u.a, u.b) : void | "" | undefined +>u.a && u.b : string | undefined +>u.a : string | undefined +>u : U +>a : string | undefined +>u.b : string | undefined +>u : U +>b : string | undefined +>f(u.a, u.b) : void +>f : (_a: string, _b: string) => void +>u.a : string +>u : U +>a : string +>u.b : string +>u : U +>b : string + +u.b && u.a && f(u.a, u.b); +>u.b && u.a && f(u.a, u.b) : void | "" | undefined +>u.b && u.a : string | undefined +>u.b : string | undefined +>u : U +>b : string | undefined +>u.a : string | undefined +>u : U +>a : string | undefined +>f(u.a, u.b) : void +>f : (_a: string, _b: string) => void +>u.a : string +>u : U +>a : string +>u.b : string +>u : U +>b : string + From 2a02077e3797ce12f8edb478d4335ed4b87c9d92 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 09:32:38 -0800 Subject: [PATCH 222/322] Add name of test in all describe blocks in it --- src/testRunner/tsconfig.json | 3 +- .../unittests/commandLineParsing.ts | 4 +-- src/testRunner/unittests/compileOnSave.ts | 4 +-- src/testRunner/unittests/moduleResolution.ts | 14 ++++---- .../{programMissingFiles.ts => programApi.ts} | 28 +++++++++++++++ .../unittests/programNoParseFalsyFileNames.ts | 36 ------------------- src/testRunner/unittests/projectErrors.ts | 2 +- src/testRunner/unittests/projectReferences.ts | 2 +- .../unittests/reuseProgramStructure.ts | 6 ++-- src/testRunner/unittests/session.ts | 10 +++--- src/testRunner/unittests/tsconfigParsing.ts | 2 +- src/testRunner/unittests/typingsInstaller.ts | 18 +++++----- 12 files changed, 60 insertions(+), 69 deletions(-) rename src/testRunner/unittests/{programMissingFiles.ts => programApi.ts} (79%) delete mode 100644 src/testRunner/unittests/programNoParseFalsyFileNames.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 32772ed311b..10b8637aede 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -68,8 +68,7 @@ "unittests/parsePseudoBigInt.ts", "unittests/paths.ts", "unittests/printer.ts", - "unittests/programMissingFiles.ts", - "unittests/programNoParseFalsyFileNames.ts", + "unittests/programApi.ts", "unittests/projectErrors.ts", "unittests/projectReferences.ts", "unittests/publicApi.ts", diff --git a/src/testRunner/unittests/commandLineParsing.ts b/src/testRunner/unittests/commandLineParsing.ts index 7e2090eb3bd..7e8ba8f84bb 100644 --- a/src/testRunner/unittests/commandLineParsing.ts +++ b/src/testRunner/unittests/commandLineParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("parseCommandLine", () => { + describe("commandLineParsing:: parseCommandLine", () => { function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine) { const parsed = parseCommandLine(commandLine); @@ -367,7 +367,7 @@ namespace ts { }); }); - describe("parseBuildOptions", () => { + describe("commandLineParsing:: parseBuildOptions", () => { function assertParseResult(commandLine: string[], expectedParsedBuildCommand: ParsedBuildCommand) { const parsed = parseBuildCommand(commandLine); const parsedBuildOptions = JSON.stringify(parsed.buildOptions); diff --git a/src/testRunner/unittests/compileOnSave.ts b/src/testRunner/unittests/compileOnSave.ts index 4b98d71ef0a..07a0aa5d3ae 100644 --- a/src/testRunner/unittests/compileOnSave.ts +++ b/src/testRunner/unittests/compileOnSave.ts @@ -6,7 +6,7 @@ namespace ts.projectSystem { return new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); } - describe("CompileOnSave affected list", () => { + describe("compileOnSave:: affected list", () => { function sendAffectedFileRequestAndCheckResult(session: server.Session, request: server.protocol.Request, expectedFileList: { projectFileName: string, files: File[] }[]) { const response = session.executeCommand(request).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[]; const actualResult = response.sort((list1, list2) => compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); @@ -504,7 +504,7 @@ namespace ts.projectSystem { }); }); - describe("EmitFile test", () => { + describe("compileOnSave:: EmitFile test", () => { it("should respect line endings", () => { test("\n"); test("\r\n"); diff --git a/src/testRunner/unittests/moduleResolution.ts b/src/testRunner/unittests/moduleResolution.ts index 05e17384978..28f25437149 100644 --- a/src/testRunner/unittests/moduleResolution.ts +++ b/src/testRunner/unittests/moduleResolution.ts @@ -80,7 +80,7 @@ namespace ts { } } - describe("Node module resolution - relative paths", () => { + describe("moduleResolution:: Node module resolution - relative paths", () => { function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void { for (const ext of supportedTSExtensions) { @@ -200,7 +200,7 @@ namespace ts { }); }); - describe("Node module resolution - non-relative paths", () => { + describe("moduleResolution:: Node module resolution - non-relative paths", () => { it("computes correct commonPrefix for moduleName cache", () => { const resolutionCache = createModuleResolutionCache("/", (f) => f); let cache = resolutionCache.getOrCreateCacheForModuleName("a"); @@ -457,7 +457,7 @@ namespace ts { }); }); - describe("Module resolution - relative imports", () => { + describe("moduleResolution:: Relative imports", () => { function test(files: Map, currentDirectory: string, rootFiles: string[], expectedFilesCount: number, relativeNamesToCheck: string[]) { const options: CompilerOptions = { module: ModuleKind.CommonJS }; const host: CompilerHost = { @@ -530,7 +530,7 @@ export = C; }); }); - describe("Files with different casing", () => { + describe("moduleResolution:: Files with different casing", () => { let library: SourceFile; function test(files: Map, options: CompilerOptions, currentDirectory: string, useCaseSensitiveFileNames: boolean, rootFiles: string[], diagnosticCodes: number[]): void { const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); @@ -651,7 +651,7 @@ import b = require("./moduleB"); }); }); - describe("baseUrl augmented module resolution", () => { + describe("moduleResolution:: baseUrl augmented module resolution", () => { it("module resolution without path mappings/rootDirs", () => { test(/*hasDirectoryExists*/ false); @@ -1098,7 +1098,7 @@ import b = require("./moduleB"); }); }); - describe("ModuleResolutionHost.directoryExists", () => { + describe("moduleResolution:: ModuleResolutionHost.directoryExists", () => { it("No 'fileExists' calls if containing directory is missing", () => { const host: ModuleResolutionHost = { readFile: notImplemented, @@ -1111,7 +1111,7 @@ import b = require("./moduleB"); }); }); - describe("Type reference directive resolution: ", () => { + describe("moduleResolution:: Type reference directive resolution: ", () => { function testWorker(hasDirectoryExists: boolean, typesRoot: string | undefined, typeDirective: string, primary: boolean, initialFile: File, targetFile: File, ...otherFiles: File[]) { const host = createModuleResolutionHost(hasDirectoryExists, ...[initialFile, targetFile].concat(...otherFiles)); const result = resolveTypeReferenceDirective(typeDirective, initialFile.name, typesRoot ? { typeRoots: [typesRoot] } : {}, host); diff --git a/src/testRunner/unittests/programMissingFiles.ts b/src/testRunner/unittests/programApi.ts similarity index 79% rename from src/testRunner/unittests/programMissingFiles.ts rename to src/testRunner/unittests/programApi.ts index 55dfa7f5cc2..8fa107513fe 100644 --- a/src/testRunner/unittests/programMissingFiles.ts +++ b/src/testRunner/unittests/programApi.ts @@ -97,6 +97,34 @@ namespace ts { "d:/pretend/nonexistent4.tsx" ]); }); + + it("should not have missing file paths", () => { + const testSource = ` + class Foo extends HTMLElement { + bar: string = 'baz'; + }`; + + const host: CompilerHost = { + getSourceFile: (fileName: string, languageVersion: ScriptTarget, _onError?: (message: string) => void) => { + return fileName === "test.ts" ? createSourceFile(fileName, testSource, languageVersion) : undefined; + }, + getDefaultLibFileName: () => "", + writeFile: (_fileName, _content) => { throw new Error("unsupported"); }, + getCurrentDirectory: () => sys.getCurrentDirectory(), + getCanonicalFileName: fileName => sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(), + getNewLine: () => sys.newLine, + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, + fileExists: fileName => fileName === "test.ts", + readFile: fileName => fileName === "test.ts" ? testSource : undefined, + resolveModuleNames: (_moduleNames: string[], _containingFile: string) => { throw new Error("unsupported"); }, + getDirectories: _path => { throw new Error("unsupported"); }, + }; + + const program = createProgram(["test.ts"], { module: ModuleKind.ES2015 }, host); + assert(program.getSourceFiles().length === 1, "expected 'getSourceFiles' length to be 1"); + assert(program.getMissingFilePaths().length === 0, "expected 'getMissingFilePaths' length to be 0"); + assert(program.getFileProcessingDiagnostics().getDiagnostics().length === 0, "expected 'getFileProcessingDiagnostics' length to be 0"); + }); }); describe("Program.isSourceFileFromExternalLibrary", () => { diff --git a/src/testRunner/unittests/programNoParseFalsyFileNames.ts b/src/testRunner/unittests/programNoParseFalsyFileNames.ts deleted file mode 100644 index 8040e7c7f43..00000000000 --- a/src/testRunner/unittests/programNoParseFalsyFileNames.ts +++ /dev/null @@ -1,36 +0,0 @@ -namespace ts { - describe("programNoParseFalsyFileNames", () => { - let program: Program; - - beforeEach(() => { - const testSource = ` - class Foo extends HTMLElement { - bar: string = 'baz'; - }`; - - const host: CompilerHost = { - getSourceFile: (fileName: string, languageVersion: ScriptTarget, _onError?: (message: string) => void) => { - return fileName === "test.ts" ? createSourceFile(fileName, testSource, languageVersion) : undefined; - }, - getDefaultLibFileName: () => "", - writeFile: (_fileName, _content) => { throw new Error("unsupported"); }, - getCurrentDirectory: () => sys.getCurrentDirectory(), - getCanonicalFileName: fileName => sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(), - getNewLine: () => sys.newLine, - useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - fileExists: fileName => fileName === "test.ts", - readFile: fileName => fileName === "test.ts" ? testSource : undefined, - resolveModuleNames: (_moduleNames: string[], _containingFile: string) => { throw new Error("unsupported"); }, - getDirectories: _path => { throw new Error("unsupported"); }, - }; - - program = createProgram(["test.ts"], { module: ModuleKind.ES2015 }, host); - }); - - it("should not have missing file paths", () => { - assert(program.getSourceFiles().length === 1, "expected 'getSourceFiles' length to be 1"); - assert(program.getMissingFilePaths().length === 0, "expected 'getMissingFilePaths' length to be 0"); - assert(program.getFileProcessingDiagnostics().getDiagnostics().length === 0, "expected 'getFileProcessingDiagnostics' length to be 0"); - }); - }); -} \ No newline at end of file diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/projectErrors.ts index b17494b59fb..d243e9d5ea4 100644 --- a/src/testRunner/unittests/projectErrors.ts +++ b/src/testRunner/unittests/projectErrors.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("Project errors", () => { + describe("tsserver:: Project Errors", () => { function checkProjectErrors(projectFiles: server.ProjectFilesWithTSDiagnostics, expectedErrors: ReadonlyArray): void { assert.isTrue(projectFiles !== undefined, "missing project files"); checkProjectErrorsWorker(projectFiles.projectErrors, expectedErrors); diff --git a/src/testRunner/unittests/projectReferences.ts b/src/testRunner/unittests/projectReferences.ts index 5b99e01585d..f67faa4609b 100644 --- a/src/testRunner/unittests/projectReferences.ts +++ b/src/testRunner/unittests/projectReferences.ts @@ -308,7 +308,7 @@ namespace ts { }); }); - describe("errors when a file in a composite project occurs outside the root", () => { + describe("project-references errors when a file in a composite project occurs outside the root", () => { it("Errors when a file is outside the rootdir", () => { const spec: TestSpecification = { "/alpha": { diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index 9e56b48a911..63b670912d8 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -210,7 +210,7 @@ namespace ts { checkCache("resolved type directives", program, fileName, expectedContent, f => f.resolvedTypeReferenceDirectiveNames, checkResolvedTypeDirective); } - describe("Reuse program structure", () => { + describe("Reuse program structure:: General", () => { const target = ScriptTarget.Latest; const files: NamedSourceText[] = [ { @@ -895,7 +895,7 @@ namespace ts { }); }); - describe("host is optional", () => { + describe("Reuse program structure:: host is optional", () => { it("should work if host is not provided", () => { createProgram([], {}); }); @@ -905,7 +905,7 @@ namespace ts { import createTestSystem = TestFSWithWatch.createWatchedSystem; import libFile = TestFSWithWatch.libFile; - describe("isProgramUptoDate should return true when there is no change in compiler options and", () => { + describe("Reuse program structure:: isProgramUptoDate should return true when there is no change in compiler options and", () => { function verifyProgramIsUptoDate( program: Program, newRootFileNames: string[], diff --git a/src/testRunner/unittests/session.ts b/src/testRunner/unittests/session.ts index bcbadac1d52..927b22fb475 100644 --- a/src/testRunner/unittests/session.ts +++ b/src/testRunner/unittests/session.ts @@ -35,7 +35,7 @@ namespace ts.server { } } - describe("the Session class", () => { + describe("tsserver:: Session:: General functionality", () => { let session: TestSession; let lastSent: protocol.Message; @@ -418,7 +418,7 @@ namespace ts.server { }); }); - describe("exceptions", () => { + describe("tsserver:: Session:: exceptions", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test let oldPrepare: AnyFunction; @@ -489,7 +489,7 @@ namespace ts.server { }); }); - describe("how Session is extendable via subclassing", () => { + describe("tsserver:: Session:: how Session is extendable via subclassing", () => { class TestSession extends Session { lastSent: protocol.Message | undefined; customHandler = "testhandler"; @@ -558,7 +558,7 @@ namespace ts.server { }); }); - describe("an example of using the Session API to create an in-process server", () => { + describe("tsserver:: Session:: an example of using the Session API to create an in-process server", () => { class InProcSession extends Session { private queue: protocol.Request[] = []; constructor(private client: InProcClient) { @@ -710,7 +710,7 @@ namespace ts.server { }); }); - describe("helpers", () => { + describe("tsserver:: Session:: helpers", () => { it(getLocationInNewDocument.name, () => { const text = `// blank line\nconst x = 0;`; const renameLocationInOldText = text.indexOf("0"); diff --git a/src/testRunner/unittests/tsconfigParsing.ts b/src/testRunner/unittests/tsconfigParsing.ts index 255129d9fb6..909af429d6e 100644 --- a/src/testRunner/unittests/tsconfigParsing.ts +++ b/src/testRunner/unittests/tsconfigParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("parseConfigFileTextToJson", () => { + describe("tsconfigParsing:: parseConfigFileTextToJson", () => { function assertParseResult(jsonText: string, expectedConfigObject: { config?: any; error?: Diagnostic[] }) { const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); assert.equal(JSON.stringify(parsed), JSON.stringify(expectedConfigObject)); diff --git a/src/testRunner/unittests/typingsInstaller.ts b/src/testRunner/unittests/typingsInstaller.ts index 7e0790b7dbb..34c5fa2a413 100644 --- a/src/testRunner/unittests/typingsInstaller.ts +++ b/src/testRunner/unittests/typingsInstaller.ts @@ -48,7 +48,7 @@ namespace ts.projectSystem { import typingsName = TI.typingsName; - describe("local module", () => { + describe("typingsInstaller:: local module", () => { it("should not be picked up", () => { const f1 = { path: "/a/app.js", @@ -87,7 +87,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller", () => { + describe("typingsInstaller:: General functionality", () => { it("configured projects (typings installed) 1", () => { const file1 = { path: "/a/b/app.js", @@ -1250,7 +1250,7 @@ namespace ts.projectSystem { }); }); - describe("Validate package name:", () => { + describe("typingsInstaller:: Validate package name:", () => { it("name cannot be too long", () => { let packageName = "a"; for (let i = 0; i < 8; i++) { @@ -1274,7 +1274,7 @@ namespace ts.projectSystem { }); }); - describe("Invalid package names", () => { + describe("typingsInstaller:: Invalid package names", () => { it("should not be installed", () => { const f1 = { path: "/a/b/app.js", @@ -1306,7 +1306,7 @@ namespace ts.projectSystem { }); }); - describe("discover typings", () => { + describe("typingsInstaller:: discover typings", () => { const emptySafeList = emptyMap; it("should use mappings from safe list", () => { @@ -1518,7 +1518,7 @@ namespace ts.projectSystem { }); }); - describe("telemetry events", () => { + describe("typingsInstaller:: telemetry events", () => { it("should be received", () => { const f1 = { path: "/a/app.js", @@ -1568,7 +1568,7 @@ namespace ts.projectSystem { }); }); - describe("progress notifications", () => { + describe("typingsInstaller:: progress notifications", () => { it("should be sent for success", () => { const f1 = { path: "/a/app.js", @@ -1677,7 +1677,7 @@ namespace ts.projectSystem { }); }); - describe("typing installer's npm installation command", () => { + describe("typingsInstaller:: npm installation command", () => { const npmPath = "npm", tsVersion = "2.9.0-dev.20180410"; const packageNames = ["@types/graphql@ts2.8", "@types/highlight.js@ts2.8", "@types/jest@ts2.8", "@types/mini-css-extract-plugin@ts2.8", "@types/mongoose@ts2.8", "@types/pg@ts2.8", "@types/webpack-bundle-analyzer@ts2.8", "@types/enhanced-resolve@ts2.8", "@types/eslint-plugin-prettier@ts2.8", "@types/friendly-errors-webpack-plugin@ts2.8", "@types/hammerjs@ts2.8", "@types/history@ts2.8", "@types/image-size@ts2.8", "@types/js-cookie@ts2.8", "@types/koa-compress@ts2.8", "@types/less@ts2.8", "@types/material-ui@ts2.8", "@types/mysql@ts2.8", "@types/nodemailer@ts2.8", "@types/prettier@ts2.8", "@types/query-string@ts2.8", "@types/react-places-autocomplete@ts2.8", "@types/react-router@ts2.8", "@types/react-router-config@ts2.8", "@types/react-select@ts2.8", "@types/react-transition-group@ts2.8", "@types/redux-form@ts2.8", "@types/abbrev@ts2.8", "@types/accepts@ts2.8", "@types/acorn@ts2.8", "@types/ansi-regex@ts2.8", "@types/ansi-styles@ts2.8", "@types/anymatch@ts2.8", "@types/apollo-codegen@ts2.8", "@types/are-we-there-yet@ts2.8", "@types/argparse@ts2.8", "@types/arr-union@ts2.8", "@types/array-find-index@ts2.8", "@types/array-uniq@ts2.8", "@types/array-unique@ts2.8", "@types/arrify@ts2.8", "@types/assert-plus@ts2.8", "@types/async@ts2.8", "@types/autoprefixer@ts2.8", "@types/aws4@ts2.8", "@types/babel-code-frame@ts2.8", "@types/babel-generator@ts2.8", "@types/babel-plugin-syntax-jsx@ts2.8", "@types/babel-template@ts2.8", "@types/babel-traverse@ts2.8", "@types/babel-types@ts2.8", "@types/babylon@ts2.8", "@types/base64-js@ts2.8", "@types/basic-auth@ts2.8", "@types/big.js@ts2.8", "@types/bl@ts2.8", "@types/bluebird@ts2.8", "@types/body-parser@ts2.8", "@types/bonjour@ts2.8", "@types/boom@ts2.8", "@types/brace-expansion@ts2.8", "@types/braces@ts2.8", "@types/brorand@ts2.8", "@types/browser-resolve@ts2.8", "@types/bson@ts2.8", "@types/buffer-equal@ts2.8", "@types/builtin-modules@ts2.8", "@types/bytes@ts2.8", "@types/callsites@ts2.8", "@types/camelcase@ts2.8", "@types/camelcase-keys@ts2.8", "@types/caseless@ts2.8", "@types/change-emitter@ts2.8", "@types/check-types@ts2.8", "@types/cheerio@ts2.8", "@types/chokidar@ts2.8", "@types/chownr@ts2.8", "@types/circular-json@ts2.8", "@types/classnames@ts2.8", "@types/clean-css@ts2.8", "@types/clone@ts2.8", "@types/co-body@ts2.8", "@types/color@ts2.8", "@types/color-convert@ts2.8", "@types/color-name@ts2.8", "@types/color-string@ts2.8", "@types/colors@ts2.8", "@types/combined-stream@ts2.8", "@types/common-tags@ts2.8", "@types/component-emitter@ts2.8", "@types/compressible@ts2.8", "@types/compression@ts2.8", "@types/concat-stream@ts2.8", "@types/connect-history-api-fallback@ts2.8", "@types/content-disposition@ts2.8", "@types/content-type@ts2.8", "@types/convert-source-map@ts2.8", "@types/cookie@ts2.8", "@types/cookie-signature@ts2.8", "@types/cookies@ts2.8", "@types/core-js@ts2.8", "@types/cosmiconfig@ts2.8", "@types/create-react-class@ts2.8", "@types/cross-spawn@ts2.8", "@types/cryptiles@ts2.8", "@types/css-modules-require-hook@ts2.8", "@types/dargs@ts2.8", "@types/dateformat@ts2.8", "@types/debug@ts2.8", "@types/decamelize@ts2.8", "@types/decompress@ts2.8", "@types/decompress-response@ts2.8", "@types/deep-equal@ts2.8", "@types/deep-extend@ts2.8", "@types/deepmerge@ts2.8", "@types/defined@ts2.8", "@types/del@ts2.8", "@types/depd@ts2.8", "@types/destroy@ts2.8", "@types/detect-indent@ts2.8", "@types/detect-newline@ts2.8", "@types/diff@ts2.8", "@types/doctrine@ts2.8", "@types/download@ts2.8", "@types/draft-js@ts2.8", "@types/duplexer2@ts2.8", "@types/duplexer3@ts2.8", "@types/duplexify@ts2.8", "@types/ejs@ts2.8", "@types/end-of-stream@ts2.8", "@types/entities@ts2.8", "@types/escape-html@ts2.8", "@types/escape-string-regexp@ts2.8", "@types/escodegen@ts2.8", "@types/eslint-scope@ts2.8", "@types/eslint-visitor-keys@ts2.8", "@types/esprima@ts2.8", "@types/estraverse@ts2.8", "@types/etag@ts2.8", "@types/events@ts2.8", "@types/execa@ts2.8", "@types/exenv@ts2.8", "@types/exit@ts2.8", "@types/exit-hook@ts2.8", "@types/expect@ts2.8", "@types/express@ts2.8", "@types/express-graphql@ts2.8", "@types/extend@ts2.8", "@types/extract-zip@ts2.8", "@types/fancy-log@ts2.8", "@types/fast-diff@ts2.8", "@types/fast-levenshtein@ts2.8", "@types/figures@ts2.8", "@types/file-type@ts2.8", "@types/filenamify@ts2.8", "@types/filesize@ts2.8", "@types/finalhandler@ts2.8", "@types/find-root@ts2.8", "@types/find-up@ts2.8", "@types/findup-sync@ts2.8", "@types/forever-agent@ts2.8", "@types/form-data@ts2.8", "@types/forwarded@ts2.8", "@types/fresh@ts2.8", "@types/from2@ts2.8", "@types/fs-extra@ts2.8", "@types/get-caller-file@ts2.8", "@types/get-stdin@ts2.8", "@types/get-stream@ts2.8", "@types/get-value@ts2.8", "@types/glob-base@ts2.8", "@types/glob-parent@ts2.8", "@types/glob-stream@ts2.8", "@types/globby@ts2.8", "@types/globule@ts2.8", "@types/got@ts2.8", "@types/graceful-fs@ts2.8", "@types/gulp-rename@ts2.8", "@types/gulp-sourcemaps@ts2.8", "@types/gulp-util@ts2.8", "@types/gzip-size@ts2.8", "@types/handlebars@ts2.8", "@types/has-ansi@ts2.8", "@types/hasha@ts2.8", "@types/he@ts2.8", "@types/hoek@ts2.8", "@types/html-entities@ts2.8", "@types/html-minifier@ts2.8", "@types/htmlparser2@ts2.8", "@types/http-assert@ts2.8", "@types/http-errors@ts2.8", "@types/http-proxy@ts2.8", "@types/http-proxy-middleware@ts2.8", "@types/indent-string@ts2.8", "@types/inflected@ts2.8", "@types/inherits@ts2.8", "@types/ini@ts2.8", "@types/inline-style-prefixer@ts2.8", "@types/inquirer@ts2.8", "@types/internal-ip@ts2.8", "@types/into-stream@ts2.8", "@types/invariant@ts2.8", "@types/ip@ts2.8", "@types/ip-regex@ts2.8", "@types/is-absolute-url@ts2.8", "@types/is-binary-path@ts2.8", "@types/is-finite@ts2.8", "@types/is-glob@ts2.8", "@types/is-my-json-valid@ts2.8", "@types/is-number@ts2.8", "@types/is-object@ts2.8", "@types/is-path-cwd@ts2.8", "@types/is-path-in-cwd@ts2.8", "@types/is-promise@ts2.8", "@types/is-scoped@ts2.8", "@types/is-stream@ts2.8", "@types/is-svg@ts2.8", "@types/is-url@ts2.8", "@types/is-windows@ts2.8", "@types/istanbul-lib-coverage@ts2.8", "@types/istanbul-lib-hook@ts2.8", "@types/istanbul-lib-instrument@ts2.8", "@types/istanbul-lib-report@ts2.8", "@types/istanbul-lib-source-maps@ts2.8", "@types/istanbul-reports@ts2.8", "@types/jest-diff@ts2.8", "@types/jest-docblock@ts2.8", "@types/jest-get-type@ts2.8", "@types/jest-matcher-utils@ts2.8", "@types/jest-validate@ts2.8", "@types/jpeg-js@ts2.8", "@types/js-base64@ts2.8", "@types/js-string-escape@ts2.8", "@types/js-yaml@ts2.8", "@types/jsbn@ts2.8", "@types/jsdom@ts2.8", "@types/jsesc@ts2.8", "@types/json-parse-better-errors@ts2.8", "@types/json-schema@ts2.8", "@types/json-stable-stringify@ts2.8", "@types/json-stringify-safe@ts2.8", "@types/json5@ts2.8", "@types/jsonfile@ts2.8", "@types/jsontoxml@ts2.8", "@types/jss@ts2.8", "@types/keygrip@ts2.8", "@types/keymirror@ts2.8", "@types/keyv@ts2.8", "@types/klaw@ts2.8", "@types/koa-send@ts2.8", "@types/leven@ts2.8", "@types/listr@ts2.8", "@types/load-json-file@ts2.8", "@types/loader-runner@ts2.8", "@types/loader-utils@ts2.8", "@types/locate-path@ts2.8", "@types/lodash-es@ts2.8", "@types/lodash.assign@ts2.8", "@types/lodash.camelcase@ts2.8", "@types/lodash.clonedeep@ts2.8", "@types/lodash.debounce@ts2.8", "@types/lodash.escape@ts2.8", "@types/lodash.flowright@ts2.8", "@types/lodash.get@ts2.8", "@types/lodash.isarguments@ts2.8", "@types/lodash.isarray@ts2.8", "@types/lodash.isequal@ts2.8", "@types/lodash.isobject@ts2.8", "@types/lodash.isstring@ts2.8", "@types/lodash.keys@ts2.8", "@types/lodash.memoize@ts2.8", "@types/lodash.merge@ts2.8", "@types/lodash.mergewith@ts2.8", "@types/lodash.pick@ts2.8", "@types/lodash.sortby@ts2.8", "@types/lodash.tail@ts2.8", "@types/lodash.template@ts2.8", "@types/lodash.throttle@ts2.8", "@types/lodash.unescape@ts2.8", "@types/lodash.uniq@ts2.8", "@types/log-symbols@ts2.8", "@types/log-update@ts2.8", "@types/loglevel@ts2.8", "@types/loud-rejection@ts2.8", "@types/lru-cache@ts2.8", "@types/make-dir@ts2.8", "@types/map-obj@ts2.8", "@types/media-typer@ts2.8", "@types/mem@ts2.8", "@types/mem-fs@ts2.8", "@types/memory-fs@ts2.8", "@types/meow@ts2.8", "@types/merge-descriptors@ts2.8", "@types/merge-stream@ts2.8", "@types/methods@ts2.8", "@types/micromatch@ts2.8", "@types/mime@ts2.8", "@types/mime-db@ts2.8", "@types/mime-types@ts2.8", "@types/minimatch@ts2.8", "@types/minimist@ts2.8", "@types/minipass@ts2.8", "@types/mkdirp@ts2.8", "@types/mongodb@ts2.8", "@types/morgan@ts2.8", "@types/move-concurrently@ts2.8", "@types/ms@ts2.8", "@types/msgpack-lite@ts2.8", "@types/multimatch@ts2.8", "@types/mz@ts2.8", "@types/negotiator@ts2.8", "@types/node-dir@ts2.8", "@types/node-fetch@ts2.8", "@types/node-forge@ts2.8", "@types/node-int64@ts2.8", "@types/node-ipc@ts2.8", "@types/node-notifier@ts2.8", "@types/nomnom@ts2.8", "@types/nopt@ts2.8", "@types/normalize-package-data@ts2.8", "@types/normalize-url@ts2.8", "@types/number-is-nan@ts2.8", "@types/object-assign@ts2.8", "@types/on-finished@ts2.8", "@types/on-headers@ts2.8", "@types/once@ts2.8", "@types/onetime@ts2.8", "@types/opener@ts2.8", "@types/opn@ts2.8", "@types/optimist@ts2.8", "@types/ora@ts2.8", "@types/os-homedir@ts2.8", "@types/os-locale@ts2.8", "@types/os-tmpdir@ts2.8", "@types/p-cancelable@ts2.8", "@types/p-each-series@ts2.8", "@types/p-event@ts2.8", "@types/p-lazy@ts2.8", "@types/p-limit@ts2.8", "@types/p-locate@ts2.8", "@types/p-map@ts2.8", "@types/p-map-series@ts2.8", "@types/p-reduce@ts2.8", "@types/p-timeout@ts2.8", "@types/p-try@ts2.8", "@types/pako@ts2.8", "@types/parse-glob@ts2.8", "@types/parse-json@ts2.8", "@types/parseurl@ts2.8", "@types/path-exists@ts2.8", "@types/path-is-absolute@ts2.8", "@types/path-parse@ts2.8", "@types/pg-pool@ts2.8", "@types/pg-types@ts2.8", "@types/pify@ts2.8", "@types/pixelmatch@ts2.8", "@types/pkg-dir@ts2.8", "@types/pluralize@ts2.8", "@types/pngjs@ts2.8", "@types/prelude-ls@ts2.8", "@types/pretty-bytes@ts2.8", "@types/pretty-format@ts2.8", "@types/progress@ts2.8", "@types/promise-retry@ts2.8", "@types/proxy-addr@ts2.8", "@types/pump@ts2.8", "@types/q@ts2.8", "@types/qs@ts2.8", "@types/range-parser@ts2.8", "@types/rc@ts2.8", "@types/rc-select@ts2.8", "@types/rc-slider@ts2.8", "@types/rc-tooltip@ts2.8", "@types/rc-tree@ts2.8", "@types/react-event-listener@ts2.8", "@types/react-side-effect@ts2.8", "@types/react-slick@ts2.8", "@types/read-chunk@ts2.8", "@types/read-pkg@ts2.8", "@types/read-pkg-up@ts2.8", "@types/recompose@ts2.8", "@types/recursive-readdir@ts2.8", "@types/relateurl@ts2.8", "@types/replace-ext@ts2.8", "@types/request@ts2.8", "@types/request-promise-native@ts2.8", "@types/require-directory@ts2.8", "@types/require-from-string@ts2.8", "@types/require-relative@ts2.8", "@types/resolve@ts2.8", "@types/resolve-from@ts2.8", "@types/retry@ts2.8", "@types/rx@ts2.8", "@types/rx-lite@ts2.8", "@types/rx-lite-aggregates@ts2.8", "@types/safe-regex@ts2.8", "@types/sane@ts2.8", "@types/sass-graph@ts2.8", "@types/sax@ts2.8", "@types/scriptjs@ts2.8", "@types/semver@ts2.8", "@types/send@ts2.8", "@types/serialize-javascript@ts2.8", "@types/serve-index@ts2.8", "@types/serve-static@ts2.8", "@types/set-value@ts2.8", "@types/shallowequal@ts2.8", "@types/shelljs@ts2.8", "@types/sockjs@ts2.8", "@types/sockjs-client@ts2.8", "@types/source-list-map@ts2.8", "@types/source-map-support@ts2.8", "@types/spdx-correct@ts2.8", "@types/spdy@ts2.8", "@types/split@ts2.8", "@types/sprintf@ts2.8", "@types/sprintf-js@ts2.8", "@types/sqlstring@ts2.8", "@types/sshpk@ts2.8", "@types/stack-utils@ts2.8", "@types/stat-mode@ts2.8", "@types/statuses@ts2.8", "@types/strict-uri-encode@ts2.8", "@types/string-template@ts2.8", "@types/strip-ansi@ts2.8", "@types/strip-bom@ts2.8", "@types/strip-json-comments@ts2.8", "@types/supports-color@ts2.8", "@types/svg2png@ts2.8", "@types/svgo@ts2.8", "@types/table@ts2.8", "@types/tapable@ts2.8", "@types/tar@ts2.8", "@types/temp@ts2.8", "@types/tempfile@ts2.8", "@types/through@ts2.8", "@types/through2@ts2.8", "@types/tinycolor2@ts2.8", "@types/tmp@ts2.8", "@types/to-absolute-glob@ts2.8", "@types/tough-cookie@ts2.8", "@types/trim@ts2.8", "@types/tryer@ts2.8", "@types/type-check@ts2.8", "@types/type-is@ts2.8", "@types/ua-parser-js@ts2.8", "@types/uglify-js@ts2.8", "@types/uglifyjs-webpack-plugin@ts2.8", "@types/underscore@ts2.8", "@types/uniq@ts2.8", "@types/uniqid@ts2.8", "@types/untildify@ts2.8", "@types/urijs@ts2.8", "@types/url-join@ts2.8", "@types/url-parse@ts2.8", "@types/url-regex@ts2.8", "@types/user-home@ts2.8", "@types/util-deprecate@ts2.8", "@types/util.promisify@ts2.8", "@types/utils-merge@ts2.8", "@types/uuid@ts2.8", "@types/vali-date@ts2.8", "@types/vary@ts2.8", "@types/verror@ts2.8", "@types/vinyl@ts2.8", "@types/vinyl-fs@ts2.8", "@types/warning@ts2.8", "@types/watch@ts2.8", "@types/watchpack@ts2.8", "@types/webpack-dev-middleware@ts2.8", "@types/webpack-sources@ts2.8", "@types/which@ts2.8", "@types/window-size@ts2.8", "@types/wrap-ansi@ts2.8", "@types/write-file-atomic@ts2.8", "@types/ws@ts2.8", "@types/xml2js@ts2.8", "@types/xmlbuilder@ts2.8", "@types/xtend@ts2.8", "@types/yallist@ts2.8", "@types/yargs@ts2.8", "@types/yauzl@ts2.8", "@types/yeoman-generator@ts2.8", "@types/zen-observable@ts2.8", "@types/react-content-loader@ts2.8"]; const expectedCommands = [ @@ -1705,7 +1705,7 @@ namespace ts.projectSystem { }); }); - describe("recomputing resolutions of unresolved imports", () => { + describe("typingsInstaller:: recomputing resolutions of unresolved imports", () => { const globalTypingsCacheLocation = "/tmp"; const appPath = "/a/b/app.js" as Path; const foooPath = "/a/b/node_modules/fooo/index.d.ts"; From 47200acfcd38d4febefb16b3e982dee77f6a1b2d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 09:49:57 -0800 Subject: [PATCH 223/322] Split watch environment into its own unittest --- src/testRunner/tsconfig.json | 1 + src/testRunner/unittests/tscWatchMode.ts | 179 +----------- .../unittests/tsserverProjectSystem.ts | 84 ------ src/testRunner/unittests/watchEnvironment.ts | 266 ++++++++++++++++++ 4 files changed, 268 insertions(+), 262 deletions(-) create mode 100644 src/testRunner/unittests/watchEnvironment.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 10b8637aede..bd3eded500d 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -87,6 +87,7 @@ "unittests/tsconfigParsing.ts", "unittests/tscWatchMode.ts", "unittests/versionCache.ts", + "unittests/watchEnvironment.ts", "unittests/evaluation/asyncArrow.ts", "unittests/evaluation/asyncGenerator.ts", "unittests/evaluation/forAwaitOf.ts", diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 65f64b9da78..03bead8178b 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -10,7 +10,6 @@ namespace ts.tscWatch { export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; export import checkOutputContains = TestFSWithWatch.checkOutputContains; export import checkOutputDoesNotContain = TestFSWithWatch.checkOutputDoesNotContain; - export import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; export function checkProgramActualFiles(program: Program, expectedFiles: ReadonlyArray) { checkArray(`Program actual files`, program.getSourceFiles().map(file => file.fileName), expectedFiles); @@ -34,7 +33,7 @@ namespace ts.tscWatch { return () => watch.getCurrentProgram().getProgram(); } - function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, maxNumberOfFilesToIterateForInvalidation?: number) { + export function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, maxNumberOfFilesToIterateForInvalidation?: number) { const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, host); compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; const watch = createWatchProgram(compilerHost); @@ -2885,182 +2884,6 @@ declare module "fs" { }); }); - describe("tsc-watch with different polling/non polling options", () => { - it("watchFile using dynamic priority polling", () => { - const projectFolder = "/a/username/project"; - const file1: File = { - path: `${projectFolder}/typescript.ts`, - content: "var z = 10;" - }; - const files = [file1, libFile]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHFILE", "DynamicPriorityPolling"); - const host = createWatchedSystem(files, { environmentVariables }); - const watch = createWatchOfFilesAndCompilerOptions([file1.path], host); - - const initialProgram = watch(); - verifyProgram(); - - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - for (let index = 0; index < mediumPollingIntervalThreshold; index++) { - // Transition libFile and file1 to low priority queue - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), initialProgram); - } - - // Make a change to file - file1.content = "var zz30 = 100;"; - host.reloadFS(files); - - // This should detect change in the file - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), initialProgram); - - // Callbacks: medium priority + high priority queue and scheduled program update - host.checkTimeoutQueueLengthAndRun(3); - // During this timeout the file would be detected as unchanged - let fileUnchangeDetected = 1; - const newProgram = watch(); - assert.notStrictEqual(newProgram, initialProgram); - - verifyProgram(); - const outputFile1 = changeExtension(file1.path, ".js"); - assert.isTrue(host.fileExists(outputFile1)); - assert.equal(host.readFile(outputFile1), file1.content + host.newLine); - - const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; - for (; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { - // For high + Medium/low polling interval - host.checkTimeoutQueueLengthAndRun(2); - assert.deepEqual(watch(), newProgram); - } - - // Everything goes in high polling interval queue - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), newProgram); - - function verifyProgram() { - checkProgramActualFiles(watch(), files.map(f => f.path)); - checkWatchedFiles(host, []); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, [], /*recursive*/ true); - } - }); - - describe("tsc-watch when watchDirectories implementation", () => { - function verifyRenamingFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { - const projectFolder = "/a/username/project"; - const projectSrcFolder = `${projectFolder}/src`; - const configFile: File = { - path: `${projectFolder}/tsconfig.json`, - content: "{}" - }; - const file: File = { - path: `${projectSrcFolder}/file1.ts`, - content: "" - }; - const programFiles = [file, libFile]; - const files = [file, configFile, libFile]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); - const host = createWatchedSystem(files, { environmentVariables }); - const watch = createWatchOfConfigFile(configFile.path, host); - const projectFolders = [projectFolder, projectSrcFolder, `${projectFolder}/node_modules/@types`]; - // Watching files config file, file, lib file - const expectedWatchedFiles = files.map(f => f.path); - const expectedWatchedDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? projectFolders : emptyArray; - if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) { - expectedWatchedFiles.push(...projectFolders); - } - - verifyProgram(checkOutputErrorsInitial); - - // Rename the file: - file.path = file.path.replace("file1.ts", "file2.ts"); - expectedWatchedFiles[0] = file.path; - host.reloadFS(files); - if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { - // With dynamic polling the fs change would be detected only by running timeouts - host.runQueuedTimeoutCallbacks(); - } - // Delayed update program - host.runQueuedTimeoutCallbacks(); - verifyProgram(checkOutputErrorsIncremental); - - function verifyProgram(checkOutputErrors: (host: WatchedSystem, errors: ReadonlyArray) => void) { - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrors(host, emptyArray); - - const outputFile = changeExtension(file.path, ".js"); - assert(host.fileExists(outputFile)); - assert.equal(host.readFile(outputFile), file.content); - - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - - // Watching config file, file, lib file and directories - checkWatchedFilesDetailed(host, expectedWatchedFiles, 1); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, 1, /*recursive*/ false); - } - } - - it("uses watchFile when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.WatchFile); - }); - - it("uses non recursive watchDirectory when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); - }); - - it("uses non recursive dynamic polling when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); - }); - - it("when there are symlinks to folders in recursive folders", () => { - const cwd = "/home/user/projects/myproject"; - const file1: File = { - path: `${cwd}/src/file.ts`, - content: `import * as a from "a"` - }; - const tsconfig: File = { - path: `${cwd}/tsconfig.json`, - content: `{ "compilerOptions": { "extendedDiagnostics": true, "traceResolution": true }}` - }; - const realA: File = { - path: `${cwd}/node_modules/reala/index.d.ts`, - content: `export {}` - }; - const realB: File = { - path: `${cwd}/node_modules/realb/index.d.ts`, - content: `export {}` - }; - const symLinkA: SymLink = { - path: `${cwd}/node_modules/a`, - symLink: `${cwd}/node_modules/reala` - }; - const symLinkB: SymLink = { - path: `${cwd}/node_modules/b`, - symLink: `${cwd}/node_modules/realb` - }; - const symLinkBInA: SymLink = { - path: `${cwd}/node_modules/reala/node_modules/b`, - symLink: `${cwd}/node_modules/b` - }; - const symLinkAInB: SymLink = { - path: `${cwd}/node_modules/realb/node_modules/a`, - symLink: `${cwd}/node_modules/a` - }; - const files = [file1, tsconfig, realA, realB, symLinkA, symLinkB, symLinkBInA, symLinkAInB]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", Tsc_WatchDirectory.NonRecursiveWatchDirectory); - const host = createWatchedSystem(files, { environmentVariables, currentDirectory: cwd }); - createWatchOfConfigFile("tsconfig.json", host); - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - checkWatchedDirectories(host, [cwd, `${cwd}/node_modules`, `${cwd}/node_modules/@types`, `${cwd}/node_modules/reala`, `${cwd}/node_modules/realb`, - `${cwd}/node_modules/reala/node_modules`, `${cwd}/node_modules/realb/node_modules`, `${cwd}/src`], /*recursive*/ false); - }); - }); - }); - describe("tsc-watch with modules linked to sibling folder", () => { const projectRoot = "/user/username/projects/project"; const mainPackageRoot = `${projectRoot}/main`; diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index e6fc1fa3726..cefa8a5e34c 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -15,7 +15,6 @@ namespace ts.projectSystem { export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; import safeList = TestFSWithWatch.safeList; - import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; function mapOutputToJson(s: string) { @@ -9156,89 +9155,6 @@ export const x = 10;` }); }); - describe("tsserverProjectSystem watchDirectories implementation", () => { - function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { - const projectFolder = "/a/username/project"; - const projectSrcFolder = `${projectFolder}/src`; - const configFile: File = { - path: `${projectFolder}/tsconfig.json`, - content: "{}" - }; - const index: File = { - path: `${projectSrcFolder}/index.ts`, - content: `import {} from "./"` - }; - const file1: File = { - path: `${projectSrcFolder}/file1.ts`, - content: "" - }; - - const files = [index, file1, configFile, libFile]; - const fileNames = files.map(file => file.path); - // All closed files(files other than index), project folder, project/src folder and project/node_modules/@types folder - const expectedWatchedFiles = arrayToMap(fileNames.slice(1), s => s, () => 1); - const expectedWatchedDirectories = createMap(); - const mapOfDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? - expectedWatchedDirectories : - tscWatchDirectory === Tsc_WatchDirectory.WatchFile ? - expectedWatchedFiles : - createMap(); - // For failed resolution lookup and tsconfig files => cached so only watched only once - mapOfDirectories.set(projectFolder, 1); - // Through above recursive watches - mapOfDirectories.set(projectSrcFolder, 1); - // node_modules/@types folder - mapOfDirectories.set(`${projectFolder}/${nodeModulesAtTypes}`, 1); - const expectedCompletions = ["file1"]; - const completionPosition = index.content.lastIndexOf('"'); - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); - const host = createServerHost(files, { environmentVariables }); - const projectService = createProjectService(host); - projectService.openClientFile(index.path); - - const project = Debug.assertDefined(projectService.configuredProjects.get(configFile.path)); - verifyProjectAndCompletions(); - - // Add file2 - const file2: File = { - path: `${projectSrcFolder}/file2.ts`, - content: "" - }; - files.push(file2); - fileNames.push(file2.path); - expectedWatchedFiles.set(file2.path, 1); - expectedCompletions.push("file2"); - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - assert.equal(projectService.configuredProjects.get(configFile.path), project); - verifyProjectAndCompletions(); - - function verifyProjectAndCompletions() { - const completions = project.getLanguageService().getCompletionsAtPosition(index.path, completionPosition, { includeExternalModuleExports: false, includeInsertTextCompletions: false })!; - checkArray("Completion Entries", completions.entries.map(e => e.name), expectedCompletions); - - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - - checkWatchedFilesDetailed(host, expectedWatchedFiles); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ false); - checkProjectActualFiles(project, fileNames); - } - } - - it("uses watchFile when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.WatchFile); - }); - - it("uses non recursive watchDirectory when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); - }); - - it("uses dynamic polling when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); - }); - }); - describe("tsserverProjectSystem getEditsForFileRename", () => { it("works for host implementing 'resolveModuleNames' and 'getResolvedModuleWithFailedLookupLocationsFromCache'", () => { const userTs: File = { diff --git a/src/testRunner/unittests/watchEnvironment.ts b/src/testRunner/unittests/watchEnvironment.ts new file mode 100644 index 00000000000..5b620b54e85 --- /dev/null +++ b/src/testRunner/unittests/watchEnvironment.ts @@ -0,0 +1,266 @@ +namespace ts { + import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; + + export namespace tscWatch { + describe("watchEnvironment:: tsc-watch with different polling/non polling options", () => { + it("watchFile using dynamic priority polling", () => { + const projectFolder = "/a/username/project"; + const file1: File = { + path: `${projectFolder}/typescript.ts`, + content: "var z = 10;" + }; + const files = [file1, libFile]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHFILE", "DynamicPriorityPolling"); + const host = createWatchedSystem(files, { environmentVariables }); + const watch = createWatchOfFilesAndCompilerOptions([file1.path], host); + + const initialProgram = watch(); + verifyProgram(); + + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + for (let index = 0; index < mediumPollingIntervalThreshold; index++) { + // Transition libFile and file1 to low priority queue + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), initialProgram); + } + + // Make a change to file + file1.content = "var zz30 = 100;"; + host.reloadFS(files); + + // This should detect change in the file + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), initialProgram); + + // Callbacks: medium priority + high priority queue and scheduled program update + host.checkTimeoutQueueLengthAndRun(3); + // During this timeout the file would be detected as unchanged + let fileUnchangeDetected = 1; + const newProgram = watch(); + assert.notStrictEqual(newProgram, initialProgram); + + verifyProgram(); + const outputFile1 = changeExtension(file1.path, ".js"); + assert.isTrue(host.fileExists(outputFile1)); + assert.equal(host.readFile(outputFile1), file1.content + host.newLine); + + const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; + for (; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { + // For high + Medium/low polling interval + host.checkTimeoutQueueLengthAndRun(2); + assert.deepEqual(watch(), newProgram); + } + + // Everything goes in high polling interval queue + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), newProgram); + + function verifyProgram() { + checkProgramActualFiles(watch(), files.map(f => f.path)); + checkWatchedFiles(host, []); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, [], /*recursive*/ true); + } + }); + + describe("tsc-watch when watchDirectories implementation", () => { + function verifyRenamingFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { + const projectFolder = "/a/username/project"; + const projectSrcFolder = `${projectFolder}/src`; + const configFile: File = { + path: `${projectFolder}/tsconfig.json`, + content: "{}" + }; + const file: File = { + path: `${projectSrcFolder}/file1.ts`, + content: "" + }; + const programFiles = [file, libFile]; + const files = [file, configFile, libFile]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); + const host = createWatchedSystem(files, { environmentVariables }); + const watch = createWatchOfConfigFile(configFile.path, host); + const projectFolders = [projectFolder, projectSrcFolder, `${projectFolder}/node_modules/@types`]; + // Watching files config file, file, lib file + const expectedWatchedFiles = files.map(f => f.path); + const expectedWatchedDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? projectFolders : emptyArray; + if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) { + expectedWatchedFiles.push(...projectFolders); + } + + verifyProgram(checkOutputErrorsInitial); + + // Rename the file: + file.path = file.path.replace("file1.ts", "file2.ts"); + expectedWatchedFiles[0] = file.path; + host.reloadFS(files); + if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { + // With dynamic polling the fs change would be detected only by running timeouts + host.runQueuedTimeoutCallbacks(); + } + // Delayed update program + host.runQueuedTimeoutCallbacks(); + verifyProgram(checkOutputErrorsIncremental); + + function verifyProgram(checkOutputErrors: (host: WatchedSystem, errors: ReadonlyArray) => void) { + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrors(host, emptyArray); + + const outputFile = changeExtension(file.path, ".js"); + assert(host.fileExists(outputFile)); + assert.equal(host.readFile(outputFile), file.content); + + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + + // Watching config file, file, lib file and directories + checkWatchedFilesDetailed(host, expectedWatchedFiles, 1); + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, 1, /*recursive*/ false); + } + } + + it("uses watchFile when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.WatchFile); + }); + + it("uses non recursive watchDirectory when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); + }); + + it("uses non recursive dynamic polling when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); + }); + + it("when there are symlinks to folders in recursive folders", () => { + const cwd = "/home/user/projects/myproject"; + const file1: File = { + path: `${cwd}/src/file.ts`, + content: `import * as a from "a"` + }; + const tsconfig: File = { + path: `${cwd}/tsconfig.json`, + content: `{ "compilerOptions": { "extendedDiagnostics": true, "traceResolution": true }}` + }; + const realA: File = { + path: `${cwd}/node_modules/reala/index.d.ts`, + content: `export {}` + }; + const realB: File = { + path: `${cwd}/node_modules/realb/index.d.ts`, + content: `export {}` + }; + const symLinkA: SymLink = { + path: `${cwd}/node_modules/a`, + symLink: `${cwd}/node_modules/reala` + }; + const symLinkB: SymLink = { + path: `${cwd}/node_modules/b`, + symLink: `${cwd}/node_modules/realb` + }; + const symLinkBInA: SymLink = { + path: `${cwd}/node_modules/reala/node_modules/b`, + symLink: `${cwd}/node_modules/b` + }; + const symLinkAInB: SymLink = { + path: `${cwd}/node_modules/realb/node_modules/a`, + symLink: `${cwd}/node_modules/a` + }; + const files = [file1, tsconfig, realA, realB, symLinkA, symLinkB, symLinkBInA, symLinkAInB]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", Tsc_WatchDirectory.NonRecursiveWatchDirectory); + const host = createWatchedSystem(files, { environmentVariables, currentDirectory: cwd }); + createWatchOfConfigFile("tsconfig.json", host); + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + checkWatchedDirectories(host, [cwd, `${cwd}/node_modules`, `${cwd}/node_modules/@types`, `${cwd}/node_modules/reala`, `${cwd}/node_modules/realb`, + `${cwd}/node_modules/reala/node_modules`, `${cwd}/node_modules/realb/node_modules`, `${cwd}/src`], /*recursive*/ false); + }); + }); + }); + } + + export namespace projectSystem { + describe("watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { + function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { + const projectFolder = "/a/username/project"; + const projectSrcFolder = `${projectFolder}/src`; + const configFile: File = { + path: `${projectFolder}/tsconfig.json`, + content: "{}" + }; + const index: File = { + path: `${projectSrcFolder}/index.ts`, + content: `import {} from "./"` + }; + const file1: File = { + path: `${projectSrcFolder}/file1.ts`, + content: "" + }; + + const files = [index, file1, configFile, libFile]; + const fileNames = files.map(file => file.path); + // All closed files(files other than index), project folder, project/src folder and project/node_modules/@types folder + const expectedWatchedFiles = arrayToMap(fileNames.slice(1), s => s, () => 1); + const expectedWatchedDirectories = createMap(); + const mapOfDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? + expectedWatchedDirectories : + tscWatchDirectory === Tsc_WatchDirectory.WatchFile ? + expectedWatchedFiles : + createMap(); + // For failed resolution lookup and tsconfig files => cached so only watched only once + mapOfDirectories.set(projectFolder, 1); + // Through above recursive watches + mapOfDirectories.set(projectSrcFolder, 1); + // node_modules/@types folder + mapOfDirectories.set(`${projectFolder}/${nodeModulesAtTypes}`, 1); + const expectedCompletions = ["file1"]; + const completionPosition = index.content.lastIndexOf('"'); + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); + const host = createServerHost(files, { environmentVariables }); + const projectService = createProjectService(host); + projectService.openClientFile(index.path); + + const project = Debug.assertDefined(projectService.configuredProjects.get(configFile.path)); + verifyProjectAndCompletions(); + + // Add file2 + const file2: File = { + path: `${projectSrcFolder}/file2.ts`, + content: "" + }; + files.push(file2); + fileNames.push(file2.path); + expectedWatchedFiles.set(file2.path, 1); + expectedCompletions.push("file2"); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + assert.equal(projectService.configuredProjects.get(configFile.path), project); + verifyProjectAndCompletions(); + + function verifyProjectAndCompletions() { + const completions = project.getLanguageService().getCompletionsAtPosition(index.path, completionPosition, { includeExternalModuleExports: false, includeInsertTextCompletions: false })!; + checkArray("Completion Entries", completions.entries.map(e => e.name), expectedCompletions); + + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + + checkWatchedFilesDetailed(host, expectedWatchedFiles); + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ false); + checkProjectActualFiles(project, fileNames); + } + } + + it("uses watchFile when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.WatchFile); + }); + + it("uses non recursive watchDirectory when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); + }); + + it("uses dynamic polling when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); + }); + }); + } +} From 7b9b0f8da71ded5a005f581f16b2d768c49ddd4b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 10:30:10 -0800 Subject: [PATCH 224/322] Split resolutionCache and watchApi tests into its own unittest --- src/testRunner/tsconfig.json | 8 +- src/testRunner/unittests/resolutionCache.ts | 981 +++++++++++++++ src/testRunner/unittests/tsbuildWatchMode.ts | 1 - src/testRunner/unittests/tscWatchHelpers.ts | 237 ++++ src/testRunner/unittests/tscWatchMode.ts | 645 ---------- src/testRunner/unittests/tsserverHelpers.ts | 679 +++++++++++ .../unittests/tsserverProjectSystem.ts | 1065 ----------------- src/testRunner/unittests/typingsInstaller.ts | 1 - src/testRunner/unittests/watchApi.ts | 40 + src/testRunner/unittests/watchEnvironment.ts | 50 + 10 files changed, 1993 insertions(+), 1714 deletions(-) create mode 100644 src/testRunner/unittests/resolutionCache.ts create mode 100644 src/testRunner/unittests/tscWatchHelpers.ts create mode 100644 src/testRunner/unittests/tsserverHelpers.ts create mode 100644 src/testRunner/unittests/watchApi.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index bd3eded500d..674188eee63 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -37,8 +37,8 @@ "runner.ts", "unittests/extractTestHelpers.ts", - "unittests/tsserverProjectSystem.ts", - "unittests/typingsInstaller.ts", + "unittests/tscWatchHelpers.ts", + "unittests/tsserverHelpers.ts", "unittests/asserts.ts", "unittests/base64.ts", @@ -72,6 +72,7 @@ "unittests/projectErrors.ts", "unittests/projectReferences.ts", "unittests/publicApi.ts", + "unittests/resolutionCache.ts", "unittests/reuseProgramStructure.ts", "unittests/session.ts", "unittests/semver.ts", @@ -86,8 +87,11 @@ "unittests/tsbuildWatchMode.ts", "unittests/tsconfigParsing.ts", "unittests/tscWatchMode.ts", + "unittests/tsserverProjectSystem.ts", + "unittests/typingsInstaller.ts", "unittests/versionCache.ts", "unittests/watchEnvironment.ts", + "unittests/watchApi.ts", "unittests/evaluation/asyncArrow.ts", "unittests/evaluation/asyncGenerator.ts", "unittests/evaluation/forAwaitOf.ts", diff --git a/src/testRunner/unittests/resolutionCache.ts b/src/testRunner/unittests/resolutionCache.ts new file mode 100644 index 00000000000..fbc792481fc --- /dev/null +++ b/src/testRunner/unittests/resolutionCache.ts @@ -0,0 +1,981 @@ +namespace ts.tscWatch { + describe("resolutionCache:: tsc-watch module resolution caching", () => { + it("works", () => { + const root = { + path: "/a/d/f0.ts", + content: `import {x} from "f1"` + }; + const imported = { + path: "/a/f1.ts", + content: `foo()` + }; + + const files = [root, imported, libFile]; + const host = createWatchedSystem(files); + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); + const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); + + // ensure that imported file was found + checkOutputErrorsInitial(host, [f1IsNotModule, cannotFindFoo]); + + const originalFileExists = host.fileExists; + { + const newContent = `import {x} from "f1" + var x: string = 1;`; + root.content = newContent; + host.reloadFS(files); + + // patch fileExists to make sure that disk is not touched + host.fileExists = notImplemented; + + // trigger synchronization to make sure that import will be fetched from the cache + host.runQueuedTimeoutCallbacks(); + + // ensure file has correct number of errors after edit + checkOutputErrorsIncremental(host, [ + f1IsNotModule, + getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), + cannotFindFoo + ]); + } + { + let fileExistsIsCalled = false; + host.fileExists = (fileName): boolean => { + if (fileName === "lib.d.ts") { + return false; + } + fileExistsIsCalled = true; + assert.isTrue(fileName.indexOf("/f2.") !== -1); + return originalFileExists.call(host, fileName); + }; + + root.content = `import {x} from "f2"`; + host.reloadFS(files); + + // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + host.runQueuedTimeoutCallbacks(); + + // ensure file has correct number of errors after edit + checkOutputErrorsIncremental(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") + ]); + + assert.isTrue(fileExistsIsCalled); + } + { + let fileExistsCalled = false; + host.fileExists = (fileName): boolean => { + if (fileName === "lib.d.ts") { + return false; + } + fileExistsCalled = true; + assert.isTrue(fileName.indexOf("/f1.") !== -1); + return originalFileExists.call(host, fileName); + }; + + const newContent = `import {x} from "f1"`; + root.content = newContent; + + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + checkOutputErrorsIncremental(host, [f1IsNotModule, cannotFindFoo]); + assert.isTrue(fileExistsCalled); + } + }); + + it("loads missing files from disk", () => { + const root = { + path: `/a/foo.ts`, + content: `import {x} from "bar"` + }; + + const imported = { + path: `/a/bar.d.ts`, + content: `export const y = 1;` + }; + + const files = [root, libFile]; + const host = createWatchedSystem(files); + const originalFileExists = host.fileExists; + + let fileExistsCalledForBar = false; + host.fileExists = fileName => { + if (fileName === "lib.d.ts") { + return false; + } + if (!fileExistsCalledForBar) { + fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; + } + + return originalFileExists.call(host, fileName); + }; + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ]); + + fileExistsCalledForBar = false; + root.content = `import {y} from "bar"`; + host.reloadFS(files.concat(imported)); + + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + }); + + it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { + const root = { + path: `/a/foo.ts`, + content: `import {x} from "bar"` + }; + + const imported = { + path: `/a/bar.d.ts`, + content: `export const y = 1;export const x = 10;` + }; + + const files = [root, libFile]; + const filesWithImported = files.concat(imported); + const host = createWatchedSystem(filesWithImported); + const originalFileExists = host.fileExists; + let fileExistsCalledForBar = false; + host.fileExists = fileName => { + if (fileName === "lib.d.ts") { + return false; + } + if (!fileExistsCalledForBar) { + fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; + } + return originalFileExists.call(host, fileName); + }; + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); + checkOutputErrorsInitial(host, emptyArray); + + fileExistsCalledForBar = false; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + checkOutputErrorsIncremental(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ]); + + fileExistsCalledForBar = false; + host.reloadFS(filesWithImported); + host.checkTimeoutQueueLengthAndRun(1); + checkOutputErrorsIncremental(host, emptyArray); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + }); + + it("works when module resolution changes to ambient module", () => { + const root = { + path: "/a/b/foo.ts", + content: `import * as fs from "fs";` + }; + + const packageJson = { + path: "/a/b/node_modules/@types/node/package.json", + content: ` +{ + "main": "" +} +` + }; + + const nodeType = { + path: "/a/b/node_modules/@types/node/index.d.ts", + content: ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + } +}` + }; + + const files = [root, libFile]; + const filesWithNodeType = files.concat(packageJson, nodeType); + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { }); + + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ]); + + host.reloadFS(filesWithNodeType); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + }); + + it("works when included file with ambient module changes", () => { + const root = { + path: "/a/b/foo.ts", + content: ` +import * as fs from "fs"; +import * as u from "url"; +` + }; + + const file = { + path: "/a/b/bar.d.ts", + content: ` +declare module "url" { + export interface Url { + href?: string; + } +} +` + }; + + const fileContentWithFS = ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + } +} +`; + + const files = [root, file, libFile]; + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + const watch = createWatchOfFilesAndCompilerOptions([root.path, file.path], host, {}); + + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ]); + + file.content += fileContentWithFS; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + }); + + it("works when reusing program with files from external library", () => { + interface ExpectedFile { path: string; isExpectedToEmit?: boolean; content?: string; } + const configDir = "/a/b/projects/myProject/src/"; + const file1: File = { + path: configDir + "file1.ts", + content: 'import module1 = require("module1");\nmodule1("hello");' + }; + const file2: File = { + path: configDir + "file2.ts", + content: 'import module11 = require("module1");\nmodule11("hello");' + }; + const module1: File = { + path: "/a/b/projects/myProject/node_modules/module1/index.js", + content: "module.exports = options => { return options.toString(); }" + }; + const configFile: File = { + path: configDir + "tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + allowJs: true, + rootDir: ".", + outDir: "../dist", + moduleResolution: "node", + maxNodeModuleJsDepth: 1 + } + }) + }; + const outDirFolder = "/a/b/projects/myProject/dist/"; + const programFiles = [file1, file2, module1, libFile]; + const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" }); + const watch = createWatchOfConfigFile(configFile.path, host); + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrorsInitial(host, emptyArray); + const expectedFiles: ExpectedFile[] = [ + createExpectedEmittedFile(file1), + createExpectedEmittedFile(file2), + createExpectedToNotEmitFile("index.js"), + createExpectedToNotEmitFile("src/index.js"), + createExpectedToNotEmitFile("src/file1.js"), + createExpectedToNotEmitFile("src/file2.js"), + createExpectedToNotEmitFile("lib.js"), + createExpectedToNotEmitFile("lib.d.ts") + ]; + verifyExpectedFiles(expectedFiles); + + file1.content += "\n;"; + expectedFiles[0].content += ";\n"; // Only emit file1 with this change + expectedFiles[1].isExpectedToEmit = false; + host.reloadFS(programFiles.concat(configFile)); + host.runQueuedTimeoutCallbacks(); + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrorsIncremental(host, emptyArray); + verifyExpectedFiles(expectedFiles); + + + function verifyExpectedFiles(expectedFiles: ExpectedFile[]) { + forEach(expectedFiles, f => { + assert.equal(!!host.fileExists(f.path), f.isExpectedToEmit, "File " + f.path + " is expected to " + (f.isExpectedToEmit ? "emit" : "not emit")); + if (f.isExpectedToEmit) { + assert.equal(host.readFile(f.path), f.content, "Expected contents of " + f.path); + } + }); + } + + function createExpectedToNotEmitFile(fileName: string): ExpectedFile { + return { + path: outDirFolder + fileName, + isExpectedToEmit: false + }; + } + + function createExpectedEmittedFile(file: File): ExpectedFile { + return { + path: removeFileExtension(file.path.replace(configDir, outDirFolder)) + Extension.Js, + isExpectedToEmit: true, + content: '"use strict";\nexports.__esModule = true;\n' + file.content.replace("import", "var") + "\n" + }; + } + }); + + it("works when renaming node_modules folder that already contains @types folder", () => { + const currentDirectory = "/user/username/projects/myproject"; + const file: File = { + path: `${currentDirectory}/a.ts`, + content: `import * as q from "qqq";` + }; + const module: File = { + path: `${currentDirectory}/node_modules2/@types/qqq/index.d.ts`, + content: "export {}" + }; + const files = [file, module, libFile]; + const host = createWatchedSystem(files, { currentDirectory }); + const watch = createWatchOfFilesAndCompilerOptions([file.path], host); + + checkProgramActualFiles(watch(), [file.path, libFile.path]); + checkOutputErrorsInitial(host, [getDiagnosticModuleNotFoundOfFile(watch(), file, "qqq")]); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectories(host, [`${currentDirectory}/node_modules`, `${currentDirectory}/node_modules/@types`], /*recursive*/ true); + + host.renameFolder(`${currentDirectory}/node_modules2`, `${currentDirectory}/node_modules`); + host.runQueuedTimeoutCallbacks(); + checkProgramActualFiles(watch(), [file.path, libFile.path, `${currentDirectory}/node_modules/@types/qqq/index.d.ts`]); + checkOutputErrorsIncremental(host, emptyArray); + }); + + describe("ignores files/folder changes in node_modules that start with '.'", () => { + const projectPath = "/user/username/projects/project"; + const npmCacheFile: File = { + path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, + content: JSON.stringify({ something: 10 }) + }; + const file1: File = { + path: `${projectPath}/test.ts`, + content: `import { x } from "somemodule";` + }; + const file2: File = { + path: `${projectPath}/node_modules/somemodule/index.d.ts`, + content: `export const x = 10;` + }; + const files = [libFile, file1, file2]; + const expectedFiles = files.map(f => f.path); + it("when watching node_modules in inferred project for failed lookup", () => { + const host = createWatchedSystem(files); + const watch = createWatchOfFilesAndCompilerOptions([file1.path], host, {}, /*maxNumberOfFilesToIterateForInvalidation*/ 1); + checkProgramActualFiles(watch(), expectedFiles); + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + it("when watching node_modules as part of wild card directories in config project", () => { + const config: File = { + path: `${projectPath}/tsconfig.json`, + content: "{}" + }; + const host = createWatchedSystem(files.concat(config)); + const watch = createWatchOfConfigFile(config.path, host); + checkProgramActualFiles(watch(), expectedFiles); + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + }); + }); + + describe("resolutionCache:: tsc-watch with modules linked to sibling folder", () => { + const projectRoot = "/user/username/projects/project"; + const mainPackageRoot = `${projectRoot}/main`; + const linkedPackageRoot = `${projectRoot}/linked-package`; + const mainFile: File = { + path: `${mainPackageRoot}/index.ts`, + content: "import { Foo } from '@scoped/linked-package'" + }; + const config: File = { + path: `${mainPackageRoot}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { module: "commonjs", moduleResolution: "node", baseUrl: ".", rootDir: "." }, + files: ["index.ts"] + }) + }; + const linkedPackageInMain: SymLink = { + path: `${mainPackageRoot}/node_modules/@scoped/linked-package`, + symLink: `${linkedPackageRoot}` + }; + const linkedPackageJson: File = { + path: `${linkedPackageRoot}/package.json`, + content: JSON.stringify({ name: "@scoped/linked-package", version: "0.0.1", types: "dist/index.d.ts", main: "dist/index.js" }) + }; + const linkedPackageIndex: File = { + path: `${linkedPackageRoot}/dist/index.d.ts`, + content: "export * from './other';" + }; + const linkedPackageOther: File = { + path: `${linkedPackageRoot}/dist/other.d.ts`, + content: 'export declare const Foo = "BAR";' + }; + + it("verify watched directories", () => { + const files = [libFile, mainFile, config, linkedPackageInMain, linkedPackageJson, linkedPackageIndex, linkedPackageOther]; + const host = createWatchedSystem(files, { currentDirectory: mainPackageRoot }); + createWatchOfConfigFile("tsconfig.json", host); + checkWatchedFilesDetailed(host, [libFile.path, mainFile.path, config.path, linkedPackageIndex.path, linkedPackageOther.path], 1); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [`${mainPackageRoot}/@scoped`, `${mainPackageRoot}/node_modules`, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); + }); + }); +} + +namespace ts.projectSystem { + function createHostModuleResolutionTrace(host: TestServerHost & ModuleResolutionHost) { + const resolutionTrace: string[] = []; + host.trace = resolutionTrace.push.bind(resolutionTrace); + return resolutionTrace; + } + + describe("resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { + it("can load typings that are proper modules", () => { + const file1 = { + path: "/a/b/app.js", + content: `var x = require("lib")` + }; + const lib = { + path: "/a/cache/node_modules/@types/lib/index.d.ts", + content: "export let x = 1" + }; + const host: TestServerHost & ModuleResolutionHost = createServerHost([file1, lib]); + const resolutionTrace = createHostModuleResolutionTrace(host); + const projectService = createProjectService(host, { typingsInstaller: new TestTypingsInstaller("/a/cache", /*throttleLimit*/5, host) }); + + projectService.setCompilerOptionsForInferredProjects({ traceResolution: true, allowJs: true }); + projectService.openClientFile(file1.path); + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + const proj = projectService.inferredProjects[0]; + + assert.deepEqual(resolutionTrace, [ + "======== Resolving module 'lib' from '/a/b/app.js'. ========", + "Module resolution kind is not specified, using 'NodeJs'.", + "Loading module 'lib' from 'node_modules' folder, target file type 'TypeScript'.", + "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", + "Directory '/a/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "Loading module 'lib' from 'node_modules' folder, target file type 'JavaScript'.", + "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", + "Directory '/a/node_modules' does not exist, skipping all lookups in it.", + "Directory '/node_modules' does not exist, skipping all lookups in it.", + "======== Module name 'lib' was not resolved. ========", + `Auto discovery for typings is enabled in project '${proj.getProjectName()}'. Running extra resolution pass for module 'lib' using cache location '/a/cache'.`, + "File '/a/cache/node_modules/lib.d.ts' does not exist.", + "File '/a/cache/node_modules/@types/lib/package.json' does not exist.", + "File '/a/cache/node_modules/@types/lib.d.ts' does not exist.", + "File '/a/cache/node_modules/@types/lib/index.d.ts' exist - use it as a name resolution result.", + ]); + checkProjectActualFiles(proj, [file1.path, lib.path]); + }); + }); + + describe("resolutionCache:: tsserverProjectSystem module resolution caching", () => { + const projectLocation = "/user/username/projects/myproject"; + const configFile: File = { + path: `${projectLocation}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { traceResolution: true } }) + }; + + function getModules(module1Path: string, module2Path: string) { + const module1: File = { + path: module1Path, + content: `export function module1() {}` + }; + const module2: File = { + path: module2Path, + content: `export function module2() {}` + }; + return { module1, module2 }; + } + + function verifyTrace(resolutionTrace: string[], expected: string[]) { + assert.deepEqual(resolutionTrace, expected); + resolutionTrace.length = 0; + } + + function getExpectedFileDoesNotExistResolutionTrace(host: TestServerHost, expectedTrace: string[], foundModule: boolean, module: File, directory: string, file: string, ignoreIfParentMissing?: boolean) { + if (!foundModule) { + const path = combinePaths(directory, file); + if (!ignoreIfParentMissing || host.directoryExists(getDirectoryPath(path))) { + if (module.path === path) { + foundModule = true; + } + else { + expectedTrace.push(`File '${path}' does not exist.`); + } + } + } + return foundModule; + } + + function getExpectedMissedLocationResolutionTrace(host: TestServerHost, expectedTrace: string[], dirPath: string, module: File, moduleName: string, useNodeModules: boolean, cacheLocation?: string) { + let foundModule = false; + forEachAncestorDirectory(dirPath, dirPath => { + if (dirPath === cacheLocation) { + return foundModule; + } + + const directory = useNodeModules ? combinePaths(dirPath, nodeModules) : dirPath; + if (useNodeModules && !foundModule && !host.directoryExists(directory)) { + expectedTrace.push(`Directory '${directory}' does not exist, skipping all lookups in it.`); + return undefined; + } + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/package.json`, /*ignoreIfParentMissing*/ true); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.ts`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.tsx`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.d.ts`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/index.ts`, /*ignoreIfParentMissing*/ true); + if (useNodeModules && !foundModule) { + expectedTrace.push(`Directory '${directory}/@types' does not exist, skipping all lookups in it.`); + } + return foundModule ? true : undefined; + }); + } + + function getExpectedResolutionTraceHeader(expectedTrace: string[], file: File, moduleName: string) { + expectedTrace.push( + `======== Resolving module '${moduleName}' from '${file.path}'. ========`, + `Module resolution kind is not specified, using 'NodeJs'.` + ); + } + + function getExpectedResolutionTraceFooter(expectedTrace: string[], module: File, moduleName: string, addRealPathTrace: boolean, ignoreModuleFileFound?: boolean) { + if (!ignoreModuleFileFound) { + expectedTrace.push(`File '${module.path}' exist - use it as a name resolution result.`); + } + if (addRealPathTrace) { + expectedTrace.push(`Resolving real path for '${module.path}', result '${module.path}'.`); + } + expectedTrace.push(`======== Module name '${moduleName}' was successfully resolved to '${module.path}'. ========`); + } + + function getExpectedRelativeModuleResolutionTrace(host: TestServerHost, file: File, module: File, moduleName: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module as file / folder, candidate module location '${removeFileExtension(module.path)}', target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(normalizePath(combinePaths(getDirectoryPath(file.path), moduleName))), module, moduleName.substring(moduleName.lastIndexOf("/") + 1), /*useNodeModules*/ false); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ false); + return expectedTrace; + } + + function getExpectedNonRelativeModuleResolutionTrace(host: TestServerHost, file: File, module: File, moduleName: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ true); + return expectedTrace; + } + + function getExpectedNonRelativeModuleResolutionFromCacheTrace(host: TestServerHost, file: File, module: File, moduleName: string, cacheLocation: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true, cacheLocation); + expectedTrace.push(`Resolution for module '${moduleName}' was found in cache from location '${cacheLocation}'.`); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ false, /*ignoreModuleFileFound*/ true); + return expectedTrace; + } + + function getExpectedReusingResolutionFromOldProgram(file: File, moduleName: string) { + return `Reusing resolution of module '${moduleName}' to file '${file.path}' from old program.`; + } + + function verifyWatchesWithConfigFile(host: TestServerHost, files: File[], openFile: File, extraExpectedDirectories?: ReadonlyArray) { + const expectedRecursiveDirectories = arrayToSet([projectLocation, `${projectLocation}/${nodeModulesAtTypes}`, ...(extraExpectedDirectories || emptyArray)]); + checkWatchedFiles(host, mapDefined(files, f => { + if (f === openFile) { + return undefined; + } + const indexOfNodeModules = f.path.indexOf("/node_modules/"); + if (indexOfNodeModules === -1) { + return f.path; + } + expectedRecursiveDirectories.set(f.path.substr(0, indexOfNodeModules + "/node_modules".length), true); + return undefined; + })); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, arrayFrom(expectedRecursiveDirectories.keys()), /*recursive*/ true); + } + + describe("from files in same folder", () => { + function getFiles(fileContent: string) { + const file1: File = { + path: `${projectLocation}/src/file1.ts`, + content: fileContent + }; + const file2: File = { + path: `${projectLocation}/src/file2.ts`, + content: fileContent + }; + return { file1, file2 }; + } + + it("relative module name", () => { + const module1Name = "./module1"; + const module2Name = "../module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/src/module1.ts`, `${projectLocation}/module2.ts`); + const files = [module1, module2, file1, file2, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent; + file2.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + + it("non relative module name", () => { + const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/src`]; + const module1Name = "module1"; + const module2Name = "module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/src/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); + + file1.content += fileContent; + file2.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); + }); + }); + + describe("from files in different folders", () => { + function getFiles(fileContent1: string, fileContent2 = fileContent1, fileContent3 = fileContent1, fileContent4 = fileContent1) { + const file1: File = { + path: `${projectLocation}/product/src/file1.ts`, + content: fileContent1 + }; + const file2: File = { + path: `${projectLocation}/product/src/feature/file2.ts`, + content: fileContent2 + }; + const file3: File = { + path: `${projectLocation}/product/test/src/file3.ts`, + content: fileContent3 + }; + const file4: File = { + path: `${projectLocation}/product/test/file4.ts`, + content: fileContent4 + }; + return { file1, file2, file3, file4 }; + } + + it("relative module name", () => { + const module1Name = "./module1"; + const module2Name = "../module2"; + const module3Name = "../module1"; + const module4Name = "../../module2"; + const module5Name = "../../src/module1"; + const module6Name = "../src/module1"; + const fileContent1 = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const fileContent2 = `import { module1 } from "${module3Name}";import { module2 } from "${module4Name}";`; + const fileContent3 = `import { module1 } from "${module5Name}";import { module2 } from "${module4Name}";`; + const fileContent4 = `import { module1 } from "${module6Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(fileContent1, fileContent2, fileContent3, fileContent4); + const { module1, module2 } = getModules(`${projectLocation}/product/src/module1.ts`, `${projectLocation}/product/module2.ts`); + const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file2, module1, module3Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file2, module2, module4Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file4, module1, module6Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file3, module1, module5Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file3, module2, module4Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent1; + file2.content += fileContent2; + file3.content += fileContent3; + file4.content += fileContent4; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + + it("non relative module name", () => { + const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/product`]; + const module1Name = "module1"; + const module2Name = "module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); + + file1.content += fileContent; + file2.content += fileContent; + file3.content += fileContent; + file4.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); + }); + + it("non relative module name from inferred project", () => { + const module1Name = "module1"; + const module2Name = "module2"; + const file2Name = "./feature/file2"; + const file3Name = "../test/src/file3"; + const file4Name = "../test/file4"; + const importModuleContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(`import "${file2Name}"; import "${file4Name}"; import "${file3Name}"; ${importModuleContent}`, importModuleContent, importModuleContent, importModuleContent); + const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, file3, file4, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.setCompilerOptionsForInferredProjects({ traceResolution: true }); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, file2, file2Name); + getExpectedRelativeModuleResolutionTrace(host, file1, file4, file4Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file1, file3, file3Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + + const currentDirectory = getDirectoryPath(file1.path); + const watchedFiles = mapDefined(files, f => f === file1 || f.path.indexOf("/node_modules/") !== -1 ? undefined : f.path); + forEachAncestorDirectory(currentDirectory, d => { + watchedFiles.push(combinePaths(d, "tsconfig.json"), combinePaths(d, "jsconfig.json")); + }); + const watchedRecursiveDirectories = getTypeRootsFromLocation(currentDirectory).concat([ + `${currentDirectory}/node_modules`, `${currentDirectory}/feature`, `${projectLocation}/product/${nodeModules}`, + `${projectLocation}/${nodeModules}`, `${projectLocation}/product/test/${nodeModules}`, + `${projectLocation}/product/test/src/${nodeModules}` + ]); + checkWatches(); + + file1.content += importModuleContent; + file2.content += importModuleContent; + file3.content += importModuleContent; + file4.content += importModuleContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, file2Name), + getExpectedReusingResolutionFromOldProgram(file1, file4Name), + getExpectedReusingResolutionFromOldProgram(file1, file3Name), + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + checkWatches(); + + function checkWatches() { + checkWatchedFiles(host, watchedFiles); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + } + }); + }); + + describe("when watching directories for failed lookup locations in amd resolution", () => { + const projectRoot = "/user/username/projects/project"; + const nodeFile: File = { + path: `${projectRoot}/src/typings/node.d.ts`, + content: ` +declare module "fs" { + export interface something { + } +}` + }; + const electronFile: File = { + path: `${projectRoot}/src/typings/electron.d.ts`, + content: ` +declare module 'original-fs' { + import * as fs from 'fs'; + export = fs; +}` + }; + const srcFile: File = { + path: `${projectRoot}/src/somefolder/srcfile.ts`, + content: ` +import { x } from "somefolder/module1"; +import { x } from "somefolder/module2"; +const y = x;` + }; + const moduleFile: File = { + path: `${projectRoot}/src/somefolder/module1.ts`, + content: ` +export const x = 10;` + }; + const configFile: File = { + path: `${projectRoot}/src/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { + module: "amd", + moduleResolution: "classic", + target: "es5", + outDir: "../out", + baseUrl: "./", + typeRoots: ["typings"] + } + }) + }; + + function verifyModuleResolution(useNodeFile: boolean) { + const files = [...(useNodeFile ? [nodeFile] : []), electronFile, srcFile, moduleFile, configFile, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(srcFile.path, srcFile.content, ScriptKind.TS, projectRoot); + checkProjectActualFiles(service.configuredProjects.get(configFile.path)!, files.map(f => f.path)); + checkWatchedFilesDetailed(host, mapDefined(files, f => f === srcFile ? undefined : f.path), 1); + if (useNodeFile) { + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); // since fs resolves to ambient module, shouldnt watch failed lookup + } + else { + checkWatchedDirectoriesDetailed(host, [`${projectRoot}`, `${projectRoot}/src`], 1, /*recursive*/ false); // failed lookup for fs + } + const expectedWatchedDirectories = createMap(); + expectedWatchedDirectories.set(`${projectRoot}/src`, 1); // Wild card + expectedWatchedDirectories.set(`${projectRoot}/src/somefolder`, 1); // failedLookup for somefolder/module2 + expectedWatchedDirectories.set(`${projectRoot}/src/node_modules`, 1); // failed lookup for somefolder/module2 + expectedWatchedDirectories.set(`${projectRoot}/somefolder`, 1); // failed lookup for somefolder/module2 + expectedWatchedDirectories.set(`${projectRoot}/node_modules`, 1); // failed lookup for with node_modules/@types/fs + expectedWatchedDirectories.set(`${projectRoot}/src/typings`, useNodeFile ? 1 : 2); // typeroot directory + failed lookup if not using node file + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ true); + } + + it("when resolves to ambient module", () => { + verifyModuleResolution(/*useNodeFile*/ true); + }); + + it("when resolution fails", () => { + verifyModuleResolution(/*useNodeFile*/ false); + }); + }); + + describe("ignores files/folder changes in node_modules that start with '.'", () => { + const projectPath = "/user/username/projects/project"; + const npmCacheFile: File = { + path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, + content: JSON.stringify({ something: 10 }) + }; + const file1: File = { + path: `${projectPath}/test.ts`, + content: `import { x } from "somemodule";` + }; + const file2: File = { + path: `${projectPath}/node_modules/somemodule/index.d.ts`, + content: `export const x = 10;` + }; + it("when watching node_modules in inferred project for failed lookup/closed script infos", () => { + const files = [libFile, file1, file2]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(file1.path); + checkNumberOfProjects(service, { inferredProjects: 1 }); + const project = service.inferredProjects[0]; + checkProjectActualFiles(project, files.map(f => f.path)); + (project as ResolutionCacheHost).maxNumberOfFilesToIterateForInvalidation = 1; + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + it("when watching node_modules as part of wild card directories in config project", () => { + const config: File = { + path: `${projectPath}/tsconfig.json`, + content: "{}" + }; + const files = [libFile, file1, file2, config]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(file1.path); + checkNumberOfProjects(service, { configuredProjects: 1 }); + const project = Debug.assertDefined(service.configuredProjects.get(config.path)); + checkProjectActualFiles(project, files.map(f => f.path)); + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsbuildWatchMode.ts b/src/testRunner/unittests/tsbuildWatchMode.ts index 9178416373c..9f45da51656 100644 --- a/src/testRunner/unittests/tsbuildWatchMode.ts +++ b/src/testRunner/unittests/tsbuildWatchMode.ts @@ -1,5 +1,4 @@ namespace ts.tscWatch { - export import libFile = TestFSWithWatch.libFile; import projectsLocation = TestFSWithWatch.tsbuildProjectsLocation; import getFilePathInProject = TestFSWithWatch.getTsBuildProjectFilePath; import getFileFromProject = TestFSWithWatch.getTsBuildProjectFile; diff --git a/src/testRunner/unittests/tscWatchHelpers.ts b/src/testRunner/unittests/tscWatchHelpers.ts new file mode 100644 index 00000000000..6e3fd40c495 --- /dev/null +++ b/src/testRunner/unittests/tscWatchHelpers.ts @@ -0,0 +1,237 @@ +namespace ts.tscWatch { + export import WatchedSystem = TestFSWithWatch.TestServerHost; + export type File = TestFSWithWatch.File; + export type SymLink = TestFSWithWatch.SymLink; + export import libFile = TestFSWithWatch.libFile; + export import createWatchedSystem = TestFSWithWatch.createWatchedSystem; + export import checkArray = TestFSWithWatch.checkArray; + export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; + export import checkWatchedFilesDetailed = TestFSWithWatch.checkWatchedFilesDetailed; + export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; + export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; + export import checkOutputContains = TestFSWithWatch.checkOutputContains; + export import checkOutputDoesNotContain = TestFSWithWatch.checkOutputDoesNotContain; + + export function checkProgramActualFiles(program: Program, expectedFiles: ReadonlyArray) { + checkArray(`Program actual files`, program.getSourceFiles().map(file => file.fileName), expectedFiles); + } + + export function checkProgramRootFiles(program: Program, expectedFiles: ReadonlyArray) { + checkArray(`Program rootFileNames`, program.getRootFileNames(), expectedFiles); + } + + export function createWatchOfConfigFileReturningBuilder(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { + const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); + compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; + const watch = createWatchProgram(compilerHost); + return () => watch.getCurrentProgram(); + } + + export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { + const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); + compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; + const watch = createWatchProgram(compilerHost); + return () => watch.getCurrentProgram().getProgram(); + } + + export function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, maxNumberOfFilesToIterateForInvalidation?: number) { + const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, host); + compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; + const watch = createWatchProgram(compilerHost); + return () => watch.getCurrentProgram().getProgram(); + } + + //function getEmittedLineForMultiFileOutput(file: File, host: WatchedSystem) { + // return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; + //} + + //function getEmittedLineForSingleFileOutput(filename: string, host: WatchedSystem) { + // return `TSFILE: ${filename}${host.newLine}`; + //} + + //interface FileOrFolderEmit extends File { + // output?: string; + //} + + //function getFileOrFolderEmit(file: File, getOutput?: (file: File) => string): FileOrFolderEmit { + // const result = file as FileOrFolderEmit; + // if (getOutput) { + // result.output = getOutput(file); + // } + // return result; + //} + + //function getEmittedLines(files: FileOrFolderEmit[]) { + // const seen = createMap(); + // const result: string[] = []; + // for (const { output } of files) { + // if (output && !seen.has(output)) { + // seen.set(output, true); + // result.push(output); + // } + // } + // return result; + //} + + //function checkAffectedLines(host: WatchedSystem, affectedFiles: FileOrFolderEmit[], allEmittedFiles: string[]) { + // const expectedAffectedFiles = getEmittedLines(affectedFiles); + // const expectedNonAffectedFiles = mapDefined(allEmittedFiles, line => contains(expectedAffectedFiles, line) ? undefined : line); + // checkOutputContains(host, expectedAffectedFiles); + // checkOutputDoesNotContain(host, expectedNonAffectedFiles); + //} + + const elapsedRegex = /^Elapsed:: [0-9]+ms/; + function checkOutputErrors( + host: WatchedSystem, + logsBeforeWatchDiagnostic: string[] | undefined, + preErrorsWatchDiagnostic: Diagnostic, + logsBeforeErrors: string[] | undefined, + errors: ReadonlyArray | ReadonlyArray, + disableConsoleClears?: boolean | undefined, + ...postErrorsWatchDiagnostics: Diagnostic[] + ) { + let screenClears = 0; + const outputs = host.getOutput(); + const expectedOutputCount = 1 + errors.length + postErrorsWatchDiagnostics.length + + (logsBeforeWatchDiagnostic ? logsBeforeWatchDiagnostic.length : 0) + (logsBeforeErrors ? logsBeforeErrors.length : 0); + assert.equal(outputs.length, expectedOutputCount, JSON.stringify(outputs)); + let index = 0; + forEach(logsBeforeWatchDiagnostic, log => assertLog("logsBeforeWatchDiagnostic", log)); + assertWatchDiagnostic(preErrorsWatchDiagnostic); + forEach(logsBeforeErrors, log => assertLog("logBeforeError", log)); + // Verify errors + forEach(errors, assertDiagnostic); + forEach(postErrorsWatchDiagnostics, assertWatchDiagnostic); + assert.equal(host.screenClears.length, screenClears, "Expected number of screen clears"); + host.clearOutput(); + + function isDiagnostic(diagnostic: Diagnostic | string): diagnostic is Diagnostic { + return !!(diagnostic as Diagnostic).messageText; + } + + function assertDiagnostic(diagnostic: Diagnostic | string) { + const expected = isDiagnostic(diagnostic) ? formatDiagnostic(diagnostic, host) : diagnostic; + assert.equal(outputs[index], expected, getOutputAtFailedMessage("Diagnostic", expected)); + index++; + } + + function assertLog(caption: string, expected: string) { + const actual = outputs[index]; + assert.equal(actual.replace(elapsedRegex, ""), expected.replace(elapsedRegex, ""), getOutputAtFailedMessage(caption, expected)); + index++; + } + + function assertWatchDiagnostic(diagnostic: Diagnostic) { + const expected = getWatchDiagnosticWithoutDate(diagnostic); + if (!disableConsoleClears && contains(screenStartingMessageCodes, diagnostic.code)) { + assert.equal(host.screenClears[screenClears], index, `Expected screen clear at this diagnostic: ${expected}`); + screenClears++; + } + assert.isTrue(endsWith(outputs[index], expected), getOutputAtFailedMessage("Watch diagnostic", expected)); + index++; + } + + function getOutputAtFailedMessage(caption: string, expectedOutput: string) { + return `Expected ${caption}: ${JSON.stringify(expectedOutput)} at ${index} in ${JSON.stringify(outputs)}`; + } + + function getWatchDiagnosticWithoutDate(diagnostic: Diagnostic) { + const newLines = contains(screenStartingMessageCodes, diagnostic.code) + ? `${host.newLine}${host.newLine}` + : host.newLine; + return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${newLines}`; + } + } + + function createErrorsFoundCompilerDiagnostic(errors: ReadonlyArray | ReadonlyArray) { + return errors.length === 1 + ? createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes) + : createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errors.length); + } + + export function checkOutputErrorsInitial(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, disableConsoleClears?: boolean, logsBeforeErrors?: string[]) { + checkOutputErrors( + host, + /*logsBeforeWatchDiagnostic*/ undefined, + createCompilerDiagnostic(Diagnostics.Starting_compilation_in_watch_mode), + logsBeforeErrors, + errors, + disableConsoleClears, + createErrorsFoundCompilerDiagnostic(errors)); + } + + export function checkOutputErrorsIncremental(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) { + checkOutputErrors( + host, + logsBeforeWatchDiagnostic, + createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation), + logsBeforeErrors, + errors, + disableConsoleClears, + createErrorsFoundCompilerDiagnostic(errors)); + } + + export function checkOutputErrorsIncrementalWithExit(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, expectedExitCode: ExitStatus, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) { + checkOutputErrors( + host, + logsBeforeWatchDiagnostic, + createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation), + logsBeforeErrors, + errors, + disableConsoleClears); + assert.equal(host.exitCode, expectedExitCode); + } + + function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { + return { + file, + start, + length, + + messageText: text, + category: message.category, + code: message.code, + }; + } + + //function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + // let text = getLocaleSpecificMessage(message); + + // if (arguments.length > 1) { + // text = formatStringFromArgs(text, arguments, 1); + // } + + // return getDiagnosticOfFileFrom(/*file*/ undefined, text, /*start*/ undefined, /*length*/ undefined, message); + //} + + //function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + // let text = getLocaleSpecificMessage(message); + + // if (arguments.length > 4) { + // text = formatStringFromArgs(text, arguments, 4); + // } + + // return getDiagnosticOfFileFrom(file, text, start, length, message); + //} + + //function getUnknownCompilerOption(program: Program, configFile: File, option: string) { + // const quotedOption = `"${option}"`; + // return getDiagnosticOfFile(program.getCompilerOptions().configFile!, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); + //} + + export function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + let text = getLocaleSpecificMessage(message); + + if (arguments.length > 5) { + text = formatStringFromArgs(text, arguments, 5); + } + + return getDiagnosticOfFileFrom(program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase()))!, + text, start, length, message); + } + + export function getDiagnosticModuleNotFoundOfFile(program: Program, file: File, moduleName: string) { + const quotedModuleName = `"${moduleName}"`; + return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0, moduleName); + } +} diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 03bead8178b..662f26e8b13 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -1,45 +1,4 @@ namespace ts.tscWatch { - export import WatchedSystem = TestFSWithWatch.TestServerHost; - export type File = TestFSWithWatch.File; - export type SymLink = TestFSWithWatch.SymLink; - export import createWatchedSystem = TestFSWithWatch.createWatchedSystem; - export import checkArray = TestFSWithWatch.checkArray; - export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; - export import checkWatchedFilesDetailed = TestFSWithWatch.checkWatchedFilesDetailed; - export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; - export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; - export import checkOutputContains = TestFSWithWatch.checkOutputContains; - export import checkOutputDoesNotContain = TestFSWithWatch.checkOutputDoesNotContain; - - export function checkProgramActualFiles(program: Program, expectedFiles: ReadonlyArray) { - checkArray(`Program actual files`, program.getSourceFiles().map(file => file.fileName), expectedFiles); - } - - export function checkProgramRootFiles(program: Program, expectedFiles: ReadonlyArray) { - checkArray(`Program rootFileNames`, program.getRootFileNames(), expectedFiles); - } - - export function createWatchOfConfigFileReturningBuilder(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { - const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); - compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; - const watch = createWatchProgram(compilerHost); - return () => watch.getCurrentProgram(); - } - - export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { - const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); - compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; - const watch = createWatchProgram(compilerHost); - return () => watch.getCurrentProgram().getProgram(); - } - - export function createWatchOfFilesAndCompilerOptions(rootFiles: string[], host: WatchedSystem, options: CompilerOptions = {}, maxNumberOfFilesToIterateForInvalidation?: number) { - const compilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, host); - compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; - const watch = createWatchProgram(compilerHost); - return () => watch.getCurrentProgram().getProgram(); - } - function getEmittedLineForMultiFileOutput(file: File, host: WatchedSystem) { return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; } @@ -79,108 +38,6 @@ namespace ts.tscWatch { checkOutputDoesNotContain(host, expectedNonAffectedFiles); } - const elapsedRegex = /^Elapsed:: [0-9]+ms/; - function checkOutputErrors( - host: WatchedSystem, - logsBeforeWatchDiagnostic: string[] | undefined, - preErrorsWatchDiagnostic: Diagnostic, - logsBeforeErrors: string[] | undefined, - errors: ReadonlyArray | ReadonlyArray, - disableConsoleClears?: boolean | undefined, - ...postErrorsWatchDiagnostics: Diagnostic[] - ) { - let screenClears = 0; - const outputs = host.getOutput(); - const expectedOutputCount = 1 + errors.length + postErrorsWatchDiagnostics.length + - (logsBeforeWatchDiagnostic ? logsBeforeWatchDiagnostic.length : 0) + (logsBeforeErrors ? logsBeforeErrors.length : 0); - assert.equal(outputs.length, expectedOutputCount, JSON.stringify(outputs)); - let index = 0; - forEach(logsBeforeWatchDiagnostic, log => assertLog("logsBeforeWatchDiagnostic", log)); - assertWatchDiagnostic(preErrorsWatchDiagnostic); - forEach(logsBeforeErrors, log => assertLog("logBeforeError", log)); - // Verify errors - forEach(errors, assertDiagnostic); - forEach(postErrorsWatchDiagnostics, assertWatchDiagnostic); - assert.equal(host.screenClears.length, screenClears, "Expected number of screen clears"); - host.clearOutput(); - - function isDiagnostic(diagnostic: Diagnostic | string): diagnostic is Diagnostic { - return !!(diagnostic as Diagnostic).messageText; - } - - function assertDiagnostic(diagnostic: Diagnostic | string) { - const expected = isDiagnostic(diagnostic) ? formatDiagnostic(diagnostic, host) : diagnostic; - assert.equal(outputs[index], expected, getOutputAtFailedMessage("Diagnostic", expected)); - index++; - } - - function assertLog(caption: string, expected: string) { - const actual = outputs[index]; - assert.equal(actual.replace(elapsedRegex, ""), expected.replace(elapsedRegex, ""), getOutputAtFailedMessage(caption, expected)); - index++; - } - - function assertWatchDiagnostic(diagnostic: Diagnostic) { - const expected = getWatchDiagnosticWithoutDate(diagnostic); - if (!disableConsoleClears && contains(screenStartingMessageCodes, diagnostic.code)) { - assert.equal(host.screenClears[screenClears], index, `Expected screen clear at this diagnostic: ${expected}`); - screenClears++; - } - assert.isTrue(endsWith(outputs[index], expected), getOutputAtFailedMessage("Watch diagnostic", expected)); - index++; - } - - function getOutputAtFailedMessage(caption: string, expectedOutput: string) { - return `Expected ${caption}: ${JSON.stringify(expectedOutput)} at ${index} in ${JSON.stringify(outputs)}`; - } - - function getWatchDiagnosticWithoutDate(diagnostic: Diagnostic) { - const newLines = contains(screenStartingMessageCodes, diagnostic.code) - ? `${host.newLine}${host.newLine}` - : host.newLine; - return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${newLines}`; - } - } - - function createErrorsFoundCompilerDiagnostic(errors: ReadonlyArray | ReadonlyArray) { - return errors.length === 1 - ? createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes) - : createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errors.length); - } - - export function checkOutputErrorsInitial(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, disableConsoleClears?: boolean, logsBeforeErrors?: string[]) { - checkOutputErrors( - host, - /*logsBeforeWatchDiagnostic*/ undefined, - createCompilerDiagnostic(Diagnostics.Starting_compilation_in_watch_mode), - logsBeforeErrors, - errors, - disableConsoleClears, - createErrorsFoundCompilerDiagnostic(errors)); - } - - export function checkOutputErrorsIncremental(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) { - checkOutputErrors( - host, - logsBeforeWatchDiagnostic, - createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation), - logsBeforeErrors, - errors, - disableConsoleClears, - createErrorsFoundCompilerDiagnostic(errors)); - } - - function checkOutputErrorsIncrementalWithExit(host: WatchedSystem, errors: ReadonlyArray | ReadonlyArray, expectedExitCode: ExitStatus, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) { - checkOutputErrors( - host, - logsBeforeWatchDiagnostic, - createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation), - logsBeforeErrors, - errors, - disableConsoleClears); - assert.equal(host.exitCode, expectedExitCode); - } - function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { return { file, @@ -218,22 +75,6 @@ namespace ts.tscWatch { return getDiagnosticOfFile(program.getCompilerOptions().configFile!, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); } - function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); - - if (arguments.length > 5) { - text = formatStringFromArgs(text, arguments, 5); - } - - return getDiagnosticOfFileFrom(program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase()))!, - text, start, length, message); - } - - function getDiagnosticModuleNotFoundOfFile(program: Program, file: File, moduleName: string) { - const quotedModuleName = `"${moduleName}"`; - return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0, moduleName); - } - describe("tsc-watch program updates", () => { const commonFile1: File = { path: "/a/b/commonFile1.ts", @@ -2343,411 +2184,6 @@ interface Document { }); }); - describe("tsc-watch module resolution caching", () => { - it("works", () => { - const root = { - path: "/a/d/f0.ts", - content: `import {x} from "f1"` - }; - const imported = { - path: "/a/f1.ts", - content: `foo()` - }; - - const files = [root, imported, libFile]; - const host = createWatchedSystem(files); - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); - const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); - - // ensure that imported file was found - checkOutputErrorsInitial(host, [f1IsNotModule, cannotFindFoo]); - - const originalFileExists = host.fileExists; - { - const newContent = `import {x} from "f1" - var x: string = 1;`; - root.content = newContent; - host.reloadFS(files); - - // patch fileExists to make sure that disk is not touched - host.fileExists = notImplemented; - - // trigger synchronization to make sure that import will be fetched from the cache - host.runQueuedTimeoutCallbacks(); - - // ensure file has correct number of errors after edit - checkOutputErrorsIncremental(host, [ - f1IsNotModule, - getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), - cannotFindFoo - ]); - } - { - let fileExistsIsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsIsCalled = true; - assert.isTrue(fileName.indexOf("/f2.") !== -1); - return originalFileExists.call(host, fileName); - }; - - root.content = `import {x} from "f2"`; - host.reloadFS(files); - - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk - host.runQueuedTimeoutCallbacks(); - - // ensure file has correct number of errors after edit - checkOutputErrorsIncremental(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") - ]); - - assert.isTrue(fileExistsIsCalled); - } - { - let fileExistsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsCalled = true; - assert.isTrue(fileName.indexOf("/f1.") !== -1); - return originalFileExists.call(host, fileName); - }; - - const newContent = `import {x} from "f1"`; - root.content = newContent; - - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - checkOutputErrorsIncremental(host, [f1IsNotModule, cannotFindFoo]); - assert.isTrue(fileExistsCalled); - } - }); - - it("loads missing files from disk", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;` - }; - - const files = [root, libFile]; - const host = createWatchedSystem(files); - const originalFileExists = host.fileExists; - - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } - - return originalFileExists.call(host, fileName); - }; - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ]); - - fileExistsCalledForBar = false; - root.content = `import {y} from "bar"`; - host.reloadFS(files.concat(imported)); - - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - }); - - it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;export const x = 10;` - }; - - const files = [root, libFile]; - const filesWithImported = files.concat(imported); - const host = createWatchedSystem(filesWithImported); - const originalFileExists = host.fileExists; - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } - return originalFileExists.call(host, fileName); - }; - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrorsInitial(host, emptyArray); - - fileExistsCalledForBar = false; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputErrorsIncremental(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ]); - - fileExistsCalledForBar = false; - host.reloadFS(filesWithImported); - host.checkTimeoutQueueLengthAndRun(1); - checkOutputErrorsIncremental(host, emptyArray); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - }); - - it("works when module resolution changes to ambient module", () => { - const root = { - path: "/a/b/foo.ts", - content: `import * as fs from "fs";` - }; - - const packageJson = { - path: "/a/b/node_modules/@types/node/package.json", - content: ` -{ - "main": "" -} -` - }; - - const nodeType = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -}` - }; - - const files = [root, libFile]; - const filesWithNodeType = files.concat(packageJson, nodeType); - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { }); - - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ]); - - host.reloadFS(filesWithNodeType); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - }); - - it("works when included file with ambient module changes", () => { - const root = { - path: "/a/b/foo.ts", - content: ` -import * as fs from "fs"; -import * as u from "url"; -` - }; - - const file = { - path: "/a/b/bar.d.ts", - content: ` -declare module "url" { - export interface Url { - href?: string; - } -} -` - }; - - const fileContentWithFS = ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -} -`; - - const files = [root, file, libFile]; - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - - const watch = createWatchOfFilesAndCompilerOptions([root.path, file.path], host, {}); - - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ]); - - file.content += fileContentWithFS; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - }); - - it("works when reusing program with files from external library", () => { - interface ExpectedFile { path: string; isExpectedToEmit?: boolean; content?: string; } - const configDir = "/a/b/projects/myProject/src/"; - const file1: File = { - path: configDir + "file1.ts", - content: 'import module1 = require("module1");\nmodule1("hello");' - }; - const file2: File = { - path: configDir + "file2.ts", - content: 'import module11 = require("module1");\nmodule11("hello");' - }; - const module1: File = { - path: "/a/b/projects/myProject/node_modules/module1/index.js", - content: "module.exports = options => { return options.toString(); }" - }; - const configFile: File = { - path: configDir + "tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - allowJs: true, - rootDir: ".", - outDir: "../dist", - moduleResolution: "node", - maxNodeModuleJsDepth: 1 - } - }) - }; - const outDirFolder = "/a/b/projects/myProject/dist/"; - const programFiles = [file1, file2, module1, libFile]; - const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" }); - const watch = createWatchOfConfigFile(configFile.path, host); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrorsInitial(host, emptyArray); - const expectedFiles: ExpectedFile[] = [ - createExpectedEmittedFile(file1), - createExpectedEmittedFile(file2), - createExpectedToNotEmitFile("index.js"), - createExpectedToNotEmitFile("src/index.js"), - createExpectedToNotEmitFile("src/file1.js"), - createExpectedToNotEmitFile("src/file2.js"), - createExpectedToNotEmitFile("lib.js"), - createExpectedToNotEmitFile("lib.d.ts") - ]; - verifyExpectedFiles(expectedFiles); - - file1.content += "\n;"; - expectedFiles[0].content += ";\n"; // Only emit file1 with this change - expectedFiles[1].isExpectedToEmit = false; - host.reloadFS(programFiles.concat(configFile)); - host.runQueuedTimeoutCallbacks(); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrorsIncremental(host, emptyArray); - verifyExpectedFiles(expectedFiles); - - - function verifyExpectedFiles(expectedFiles: ExpectedFile[]) { - forEach(expectedFiles, f => { - assert.equal(!!host.fileExists(f.path), f.isExpectedToEmit, "File " + f.path + " is expected to " + (f.isExpectedToEmit ? "emit" : "not emit")); - if (f.isExpectedToEmit) { - assert.equal(host.readFile(f.path), f.content, "Expected contents of " + f.path); - } - }); - } - - function createExpectedToNotEmitFile(fileName: string): ExpectedFile { - return { - path: outDirFolder + fileName, - isExpectedToEmit: false - }; - } - - function createExpectedEmittedFile(file: File): ExpectedFile { - return { - path: removeFileExtension(file.path.replace(configDir, outDirFolder)) + Extension.Js, - isExpectedToEmit: true, - content: '"use strict";\nexports.__esModule = true;\n' + file.content.replace("import", "var") + "\n" - }; - } - }); - - it("works when renaming node_modules folder that already contains @types folder", () => { - const currentDirectory = "/user/username/projects/myproject"; - const file: File = { - path: `${currentDirectory}/a.ts`, - content: `import * as q from "qqq";` - }; - const module: File = { - path: `${currentDirectory}/node_modules2/@types/qqq/index.d.ts`, - content: "export {}" - }; - const files = [file, module, libFile]; - const host = createWatchedSystem(files, { currentDirectory }); - const watch = createWatchOfFilesAndCompilerOptions([file.path], host); - - checkProgramActualFiles(watch(), [file.path, libFile.path]); - checkOutputErrorsInitial(host, [getDiagnosticModuleNotFoundOfFile(watch(), file, "qqq")]); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectories(host, [`${currentDirectory}/node_modules`, `${currentDirectory}/node_modules/@types`], /*recursive*/ true); - - host.renameFolder(`${currentDirectory}/node_modules2`, `${currentDirectory}/node_modules`); - host.runQueuedTimeoutCallbacks(); - checkProgramActualFiles(watch(), [file.path, libFile.path, `${currentDirectory}/node_modules/@types/qqq/index.d.ts`]); - checkOutputErrorsIncremental(host, emptyArray); - }); - - describe("ignores files/folder changes in node_modules that start with '.'", () => { - const projectPath = "/user/username/projects/project"; - const npmCacheFile: File = { - path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, - content: JSON.stringify({ something: 10 }) - }; - const file1: File = { - path: `${projectPath}/test.ts`, - content: `import { x } from "somemodule";` - }; - const file2: File = { - path: `${projectPath}/node_modules/somemodule/index.d.ts`, - content: `export const x = 10;` - }; - const files = [libFile, file1, file2]; - const expectedFiles = files.map(f => f.path); - it("when watching node_modules in inferred project for failed lookup", () => { - const host = createWatchedSystem(files); - const watch = createWatchOfFilesAndCompilerOptions([file1.path], host, {}, /*maxNumberOfFilesToIterateForInvalidation*/ 1); - checkProgramActualFiles(watch(), expectedFiles); - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - it("when watching node_modules as part of wild card directories in config project", () => { - const config: File = { - path: `${projectPath}/tsconfig.json`, - content: "{}" - }; - const host = createWatchedSystem(files.concat(config)); - const watch = createWatchOfConfigFile(config.path, host); - checkProgramActualFiles(watch(), expectedFiles); - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - }); - }); - describe("tsc-watch with when module emit is specified as node", () => { it("when instead of filechanged recursive directory watcher is invoked", () => { const configFile: File = { @@ -2883,85 +2319,4 @@ declare module "fs" { }); }); }); - - describe("tsc-watch with modules linked to sibling folder", () => { - const projectRoot = "/user/username/projects/project"; - const mainPackageRoot = `${projectRoot}/main`; - const linkedPackageRoot = `${projectRoot}/linked-package`; - const mainFile: File = { - path: `${mainPackageRoot}/index.ts`, - content: "import { Foo } from '@scoped/linked-package'" - }; - const config: File = { - path: `${mainPackageRoot}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { module: "commonjs", moduleResolution: "node", baseUrl: ".", rootDir: "." }, - files: ["index.ts"] - }) - }; - const linkedPackageInMain: SymLink = { - path: `${mainPackageRoot}/node_modules/@scoped/linked-package`, - symLink: `${linkedPackageRoot}` - }; - const linkedPackageJson: File = { - path: `${linkedPackageRoot}/package.json`, - content: JSON.stringify({ name: "@scoped/linked-package", version: "0.0.1", types: "dist/index.d.ts", main: "dist/index.js" }) - }; - const linkedPackageIndex: File = { - path: `${linkedPackageRoot}/dist/index.d.ts`, - content: "export * from './other';" - }; - const linkedPackageOther: File = { - path: `${linkedPackageRoot}/dist/other.d.ts`, - content: 'export declare const Foo = "BAR";' - }; - - it("verify watched directories", () => { - const files = [libFile, mainFile, config, linkedPackageInMain, linkedPackageJson, linkedPackageIndex, linkedPackageOther]; - const host = createWatchedSystem(files, { currentDirectory: mainPackageRoot }); - createWatchOfConfigFile("tsconfig.json", host); - checkWatchedFilesDetailed(host, [libFile.path, mainFile.path, config.path, linkedPackageIndex.path, linkedPackageOther.path], 1); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, [`${mainPackageRoot}/@scoped`, `${mainPackageRoot}/node_modules`, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); - }); - }); - - describe("tsc-watch with custom module resolution", () => { - const projectRoot = "/user/username/projects/project"; - const configFileJson: any = { - compilerOptions: { module: "commonjs", resolveJsonModule: true }, - files: ["index.ts"] - }; - const mainFile: File = { - path: `${projectRoot}/index.ts`, - content: "import settings from './settings.json';" - }; - const config: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify(configFileJson) - }; - const settingsJson: File = { - path: `${projectRoot}/settings.json`, - content: JSON.stringify({ content: "Print this" }) - }; - - it("verify that module resolution with json extension works when returned without extension", () => { - const files = [libFile, mainFile, config, settingsJson]; - const host = createWatchedSystem(files, { currentDirectory: projectRoot }); - const compilerHost = createWatchCompilerHostOfConfigFile(config.path, {}, host); - const parsedCommandResult = parseJsonConfigFileContent(configFileJson, host, config.path); - compilerHost.resolveModuleNames = (moduleNames, containingFile) => moduleNames.map(m => { - const result = resolveModuleName(m, containingFile, parsedCommandResult.options, compilerHost); - const resolvedModule = result.resolvedModule!; - return { - resolvedFileName: resolvedModule.resolvedFileName, - isExternalLibraryImport: resolvedModule.isExternalLibraryImport, - originalFileName: resolvedModule.originalPath, - }; - }); - const watch = createWatchProgram(compilerHost); - const program = watch.getCurrentProgram().getProgram(); - checkProgramActualFiles(program, [mainFile.path, libFile.path, settingsJson.path]); - }); - }); } diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts new file mode 100644 index 00000000000..5162f17d6ae --- /dev/null +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -0,0 +1,679 @@ +namespace ts.projectSystem { + export import TI = server.typingsInstaller; + export import protocol = server.protocol; + export import CommandNames = server.CommandNames; + + export import TestServerHost = TestFSWithWatch.TestServerHost; + export type File = TestFSWithWatch.File; + export type SymLink = TestFSWithWatch.SymLink; + export type Folder = TestFSWithWatch.Folder; + export import createServerHost = TestFSWithWatch.createServerHost; + export import checkArray = TestFSWithWatch.checkArray; + export import libFile = TestFSWithWatch.libFile; + export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; + export import checkWatchedFilesDetailed = TestFSWithWatch.checkWatchedFilesDetailed; + export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; + export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; + + //const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; + //function mapOutputToJson(s: string) { + // return convertToObject( + // parseJsonText("json.json", s.replace(outputEventRegex, "")), + // [] + // ); + //} + + export const customTypesMap = { + path: "/typesMap.json", + content: `{ + "typesMap": { + "jquery": { + "match": "jquery(-(\\\\.?\\\\d+)+)?(\\\\.intellisense)?(\\\\.min)?\\\\.js$", + "types": ["jquery"] + }, + "quack": { + "match": "/duckquack-(\\\\d+)\\\\.min\\\\.js", + "types": ["duck-types"] + } + }, + "simpleMap": { + "Bacon": "baconjs", + "bliss": "blissfuljs", + "commander": "commander", + "cordova": "cordova", + "react": "react", + "lodash": "lodash" + } + }` + }; + + export interface PostExecAction { + readonly success: boolean; + readonly callback: TI.RequestCompletedAction; + } + + export const nullLogger: server.Logger = { + close: noop, + hasLevel: () => false, + loggingEnabled: () => false, + perftrc: noop, + info: noop, + msg: noop, + startGroup: noop, + endGroup: noop, + getLogFileName: () => undefined, + }; + + export function createHasErrorMessageLogger() { + let hasErrorMsg = false; + const { close, hasLevel, loggingEnabled, startGroup, endGroup, info, getLogFileName, perftrc } = nullLogger; + const logger: server.Logger = { + close, hasLevel, loggingEnabled, startGroup, endGroup, info, getLogFileName, perftrc, + msg: (s, type) => { + Debug.fail(`Error: ${s}, type: ${type}`); + hasErrorMsg = true; + } + }; + return { logger, hasErrorMsg: () => hasErrorMsg }; + } + + export class TestTypingsInstaller extends TI.TypingsInstaller implements server.ITypingsInstaller { + protected projectService!: server.ProjectService; + constructor( + readonly globalTypingsCacheLocation: string, + throttleLimit: number, + installTypingHost: server.ServerHost, + readonly typesRegistry = createMap>(), + log?: TI.Log) { + super(installTypingHost, globalTypingsCacheLocation, TestFSWithWatch.safeList.path, customTypesMap.path, throttleLimit, log); + } + + protected postExecActions: PostExecAction[] = []; + + isKnownTypesPackageName = notImplemented; + installPackage = notImplemented; + inspectValue = notImplemented; + + executePendingCommands() { + const actionsToRun = this.postExecActions; + this.postExecActions = []; + for (const action of actionsToRun) { + action.callback(action.success); + } + } + + checkPendingCommands(expectedCount: number) { + assert.equal(this.postExecActions.length, expectedCount, `Expected ${expectedCount} post install actions`); + } + + onProjectClosed = noop; + + attach(projectService: server.ProjectService) { + this.projectService = projectService; + } + + getInstallTypingHost() { + return this.installTypingHost; + } + + installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { + this.addPostExecAction("success", cb); + } + + sendResponse(response: server.SetTypings | server.InvalidateCachedTypings) { + this.projectService.updateTypingsForProject(response); + } + + enqueueInstallTypingsRequest(project: server.Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray) { + const request = server.createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, this.globalTypingsCacheLocation); + this.install(request); + } + + addPostExecAction(stdout: string | string[], cb: TI.RequestCompletedAction) { + const out = isString(stdout) ? stdout : createNpmPackageJsonString(stdout); + const action: PostExecAction = { + success: !!out, + callback: cb + }; + this.postExecActions.push(action); + } + } + + function createNpmPackageJsonString(installedTypings: string[]): string { + const dependencies: MapLike = {}; + for (const typing of installedTypings) { + dependencies[typing] = "1.0.0"; + } + return JSON.stringify({ dependencies }); + } + + export function createTypesRegistry(...list: string[]): Map> { + const versionMap = { + "latest": "1.3.0", + "ts2.0": "1.0.0", + "ts2.1": "1.0.0", + "ts2.2": "1.2.0", + "ts2.3": "1.3.0", + "ts2.4": "1.3.0", + "ts2.5": "1.3.0", + "ts2.6": "1.3.0", + "ts2.7": "1.3.0" + }; + const map = createMap>(); + for (const l of list) { + map.set(l, versionMap); + } + return map; + } + + export function toExternalFile(fileName: string): protocol.ExternalFile { + return { fileName }; + } + + export function toExternalFiles(fileNames: string[]) { + return map(fileNames, toExternalFile); + } + + export function fileStats(nonZeroStats: Partial): server.FileStats { + return { ts: 0, tsSize: 0, tsx: 0, tsxSize: 0, dts: 0, dtsSize: 0, js: 0, jsSize: 0, jsx: 0, jsxSize: 0, deferred: 0, deferredSize: 0, ...nonZeroStats }; + } + + export interface ConfigFileDiagnostic { + fileName: string | undefined; + start: number | undefined; + length: number | undefined; + messageText: string; + category: DiagnosticCategory; + code: number; + reportsUnnecessary?: {}; + source?: string; + relatedInformation?: DiagnosticRelatedInformation[]; + } + + export class TestServerEventManager { + private events: server.ProjectServiceEvent[] = []; + readonly session: TestSession; + readonly service: server.ProjectService; + readonly host: TestServerHost; + constructor(files: File[], suppressDiagnosticEvents?: boolean) { + this.host = createServerHost(files); + this.session = createSession(this.host, { + canUseEvents: true, + eventHandler: event => this.events.push(event), + suppressDiagnosticEvents, + }); + this.service = this.session.getProjectService(); + } + + getEvents(): ReadonlyArray { + const events = this.events; + this.events = []; + return events; + } + + getEvent(eventName: T["eventName"]): T["data"] { + let eventData: T["data"] | undefined; + filterMutate(this.events, e => { + if (e.eventName === eventName) { + if (eventData !== undefined) { + assert(false, "more than one event found"); + } + eventData = e.data; + return false; + } + return true; + }); + return Debug.assertDefined(eventData); + } + + hasZeroEvent(eventName: T["eventName"]) { + this.events.forEach(event => assert.notEqual(event.eventName, eventName)); + } + + checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string, errors: ReadonlyArray) { + const eventData = this.getEvent(server.ConfigFileDiagEvent); + assert.equal(eventData.configFileName, configFileName); + assert.equal(eventData.triggerFile, triggerFile); + const actual = eventData.diagnostics.map(({ file, messageText, ...rest }) => ({ fileName: file && file.fileName, messageText: isString(messageText) ? messageText : "", ...rest })); + if (errors) { + assert.deepEqual(actual, errors); + } + } + + assertProjectInfoTelemetryEvent(partial: Partial, configFile = "/tsconfig.json"): void { + assert.deepEqual(this.getEvent(server.ProjectInfoTelemetryEvent), { + projectId: sys.createSHA256Hash!(configFile), + fileStats: fileStats({ ts: 1 }), + compilerOptions: {}, + extends: false, + files: false, + include: false, + exclude: false, + compileOnSave: false, + typeAcquisition: { + enable: false, + exclude: false, + include: false, + }, + configFileName: "tsconfig.json", + projectType: "configured", + languageServiceEnabled: true, + version, + ...partial, + }); + } + + assertOpenFileTelemetryEvent(info: server.OpenFileInfo): void { + assert.deepEqual(this.getEvent(server.OpenFileInfoTelemetryEvent), { info }); + } + assertNoOpenFilesTelemetryEvent(): void { + this.hasZeroEvent(server.OpenFileInfoTelemetryEvent); + } + } + + export class TestSession extends server.Session { + private seq = 0; + public events: protocol.Event[] = []; + public host!: TestServerHost; + + getProjectService() { + return this.projectService; + } + + public getSeq() { + return this.seq; + } + + public getNextSeq() { + return this.seq + 1; + } + + public executeCommandSeq(request: Partial) { + this.seq++; + request.seq = this.seq; + request.type = "request"; + return this.executeCommand(request); + } + + public event(body: T, eventName: string) { + this.events.push(server.toEvent(eventName, body)); + super.event(body, eventName); + } + + public clearMessages() { + clear(this.events); + this.host.clearOutput(); + } + } + + export function createSession(host: server.ServerHost, opts: Partial = {}) { + if (opts.typingsInstaller === undefined) { + opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); + } + + if (opts.eventHandler !== undefined) { + opts.canUseEvents = true; + } + + const sessionOptions: server.SessionOptions = { + host, + cancellationToken: server.nullCancellationToken, + useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, + typingsInstaller: undefined!, // TODO: GH#18217 + byteLength: Utils.byteLength, + hrtime: process.hrtime, + logger: opts.logger || createHasErrorMessageLogger().logger, + canUseEvents: false + }; + + return new TestSession({ ...sessionOptions, ...opts }); + } + + //function createSessionWithEventTracking(host: server.ServerHost, eventName: T["eventName"], ...eventNames: T["eventName"][]) { + // const events: T[] = []; + // const session = createSession(host, { + // eventHandler: e => { + // if (e.eventName === eventName || eventNames.some(eventName => e.eventName === eventName)) { + // events.push(e as T); + // } + // } + // }); + + // return { session, events }; + //} + + //function createSessionWithDefaultEventHandler(host: TestServerHost, eventNames: T["event"] | T["event"][], opts: Partial = {}) { + // const session = createSession(host, { canUseEvents: true, ...opts }); + + // return { + // session, + // getEvents, + // clearEvents + // }; + + // function getEvents() { + // return mapDefined(host.getOutput(), s => { + // const e = mapOutputToJson(s); + // return (isArray(eventNames) ? eventNames.some(eventName => e.event === eventName) : e.event === eventNames) ? e as T : undefined; + // }); + // } + + // function clearEvents() { + // session.clearMessages(); + // } + //} + + export interface CreateProjectServiceParameters { + cancellationToken?: HostCancellationToken; + logger?: server.Logger; + useSingleInferredProject?: boolean; + typingsInstaller?: server.ITypingsInstaller; + eventHandler?: server.ProjectServiceEventHandler; + } + + export class TestProjectService extends server.ProjectService { + constructor(host: server.ServerHost, logger: server.Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, + typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler, opts: Partial = {}) { + super({ + host, + logger, + cancellationToken, + useSingleInferredProject, + useInferredProjectPerProjectRoot: false, + typingsInstaller, + typesMapLocation: customTypesMap.path, + eventHandler, + ...opts + }); + } + + checkNumberOfProjects(count: { inferredProjects?: number, configuredProjects?: number, externalProjects?: number }) { + checkNumberOfProjects(this, count); + } + } + export function createProjectService(host: server.ServerHost, parameters: CreateProjectServiceParameters = {}, options?: Partial) { + const cancellationToken = parameters.cancellationToken || server.nullCancellationToken; + const logger = parameters.logger || createHasErrorMessageLogger().logger; + const useSingleInferredProject = parameters.useSingleInferredProject !== undefined ? parameters.useSingleInferredProject : false; + return new TestProjectService(host, logger, cancellationToken, useSingleInferredProject, parameters.typingsInstaller!, parameters.eventHandler!, options); // TODO: GH#18217 + } + + export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { + assert.equal(projectService.configuredProjects.size, expected, `expected ${expected} configured project(s)`); + } + + export function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) { + assert.equal(projectService.externalProjects.length, expected, `expected ${expected} external project(s)`); + } + + export function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) { + assert.equal(projectService.inferredProjects.length, expected, `expected ${expected} inferred project(s)`); + } + + export function checkNumberOfProjects(projectService: server.ProjectService, count: { inferredProjects?: number, configuredProjects?: number, externalProjects?: number }) { + checkNumberOfConfiguredProjects(projectService, count.configuredProjects || 0); + checkNumberOfExternalProjects(projectService, count.externalProjects || 0); + checkNumberOfInferredProjects(projectService, count.inferredProjects || 0); + } + + export function configuredProjectAt(projectService: server.ProjectService, index: number) { + const values = projectService.configuredProjects.values(); + while (index > 0) { + values.next(); + index--; + } + return values.next().value; + } + + export function checkProjectActualFiles(project: server.Project, expectedFiles: ReadonlyArray) { + checkArray(`${server.ProjectKind[project.projectKind]} project, actual files`, project.getFileNames(), expectedFiles); + } + + //function checkProjectRootFiles(project: server.Project, expectedFiles: ReadonlyArray) { + // checkArray(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); + //} + + export function mapCombinedPathsInAncestor(dir: string, path2: string, mapAncestor: (ancestor: string) => boolean) { + dir = normalizePath(dir); + const result: string[] = []; + forEachAncestorDirectory(dir, ancestor => { + if (mapAncestor(ancestor)) { + result.push(combinePaths(ancestor, path2)); + } + }); + return result; + } + + export function getRootsToWatchWithAncestorDirectory(dir: string, path2: string) { + return mapCombinedPathsInAncestor(dir, path2, ancestor => ancestor.split(directorySeparator).length > 4); + } + + export const nodeModules = "node_modules"; + //function getNodeModuleDirectories(dir: string) { + // return getRootsToWatchWithAncestorDirectory(dir, nodeModules); + //} + + export const nodeModulesAtTypes = "node_modules/@types"; + export function getTypeRootsFromLocation(currentDirectory: string) { + return getRootsToWatchWithAncestorDirectory(currentDirectory, nodeModulesAtTypes); + } + + //function getNumberOfWatchesInvokedForRecursiveWatches(recursiveWatchedDirs: string[], file: string) { + // return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); + //} + + //function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { + // checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); + //} + + //function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { + // const start = str.indexOf(substring); + // Debug.assert(start !== -1); + // return protocolToLocation(str)(start); + //} + //function protocolToLocation(text: string): (pos: number) => protocol.Location { + // const lineStarts = computeLineStarts(text); + // return pos => { + // const x = computeLineAndCharacterOfPosition(lineStarts, pos); + // return { line: x.line + 1, offset: x.character + 1 }; + // }; + //} + //function protocolTextSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): protocol.TextSpan { + // const span = textSpanFromSubstring(str, substring, options); + // const toLocation = protocolToLocation(str); + // return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; + //} + //function protocolRenameSpanFromSubstring( + // str: string, + // substring: string, + // options?: SpanFromSubstringOptions, + // prefixSuffixText?: { readonly prefixText?: string, readonly suffixText?: string }, + //): protocol.RenameTextSpan { + // return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; + //} + //function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { + // const start = nthIndexOf(str, substring, options ? options.index : 0); + // Debug.assert(start !== -1); + // return createTextSpan(start, substring.length); + //} + //function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { + // return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; + //} + //function protocolFileSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): protocol.FileSpan { + // return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring, options) }; + //} + //function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan { + // return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) }; + //} + //function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { + // return documentSpanFromSubstring(file, substring, options); + //} + //interface SpanFromSubstringOptions { + // readonly index: number; + //} + + //function nthIndexOf(str: string, substr: string, n: number): number { + // let index = -1; + // for (; n >= 0; n--) { + // index = str.indexOf(substr, index + 1); + // if (index === -1) return -1; + // } + // return index; + //} + + /** + * Test server cancellation token used to mock host token cancellation requests. + * The cancelAfterRequest constructor param specifies how many isCancellationRequested() calls + * should be made before canceling the token. The id of the request to cancel should be set with + * setRequestToCancel(); + */ + export class TestServerCancellationToken implements server.ServerCancellationToken { + private currentId: number | undefined = -1; + private requestToCancel = -1; + private isCancellationRequestedCount = 0; + + constructor(private cancelAfterRequest = 0) { + } + + setRequest(requestId: number) { + this.currentId = requestId; + } + + setRequestToCancel(requestId: number) { + this.resetToken(); + this.requestToCancel = requestId; + } + + resetRequest(requestId: number) { + assert.equal(requestId, this.currentId, "unexpected request id in cancellation"); + this.currentId = undefined; + } + + isCancellationRequested() { + this.isCancellationRequestedCount++; + // If the request id is the request to cancel and isCancellationRequestedCount + // has been met then cancel the request. Ex: cancel the request if it is a + // nav bar request & isCancellationRequested() has already been called three times. + return this.requestToCancel === this.currentId && this.isCancellationRequestedCount >= this.cancelAfterRequest; + } + + resetToken() { + this.currentId = -1; + this.isCancellationRequestedCount = 0; + this.requestToCancel = -1; + } + } + + export function makeSessionRequest(command: string, args: T): protocol.Request { + return { + seq: 0, + type: "request", + command, + arguments: args + }; + } + + export function executeSessionRequest(session: server.Session, command: TRequest["command"], args: TRequest["arguments"]): TResponse["body"] { + return session.executeCommand(makeSessionRequest(command, args)).response as TResponse["body"]; + } + + export function executeSessionRequestNoResponse(session: server.Session, command: TRequest["command"], args: TRequest["arguments"]): void { + session.executeCommand(makeSessionRequest(command, args)); + } + + export function openFilesForSession(files: ReadonlyArray, session: server.Session): void { + for (const file of files) { + session.executeCommand(makeSessionRequest(CommandNames.Open, + "projectRootPath" in file ? { file: typeof file.file === "string" ? file.file : file.file.path, projectRootPath: file.projectRootPath } : { file: file.path })); + } + } + + export function closeFilesForSession(files: ReadonlyArray, session: server.Session): void { + for (const file of files) { + session.executeCommand(makeSessionRequest(CommandNames.Close, { file: file.path })); + } + } + + //interface ErrorInformation { + // diagnosticMessage: DiagnosticMessage; + // errorTextArguments?: string[]; + //} + + //function getProtocolDiagnosticMessage({ diagnosticMessage, errorTextArguments = [] }: ErrorInformation) { + // return formatStringFromArgs(diagnosticMessage.message, errorTextArguments); + //} + + //function verifyDiagnostics(actual: server.protocol.Diagnostic[], expected: ErrorInformation[]) { + // const expectedErrors = expected.map(getProtocolDiagnosticMessage); + // assert.deepEqual(actual.map(diag => flattenDiagnosticMessageText(diag.text, "\n")), expectedErrors); + //} + + //function verifyNoDiagnostics(actual: server.protocol.Diagnostic[]) { + // verifyDiagnostics(actual, []); + //} + + //function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { + // checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); + //} + + //function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}, relatedInformation?: protocol.DiagnosticRelatedInformation[]): protocol.Diagnostic { + // return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, relatedInformation, source: undefined }; + //} + + //function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { + // checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); + //} + + //function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { + // checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); + //} + + //function checkNoDiagnosticEvents(session: TestSession) { + // for (const event of session.events) { + // assert.isFalse(event.event.endsWith("Diag"), JSON.stringify(event)); + // } + //} + + //function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { + // const events = session.events; + // assert.deepEqual(events[index], expectedEvent, `Expected ${JSON.stringify(expectedEvent)} at ${index} in ${JSON.stringify(events)}`); + + // const outputs = session.host.getOutput(); + // assert.equal(outputs[index], server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, session.host.newLine)); + + // if (isMostRecent) { + // assert.strictEqual(events.length, index + 1, JSON.stringify(events)); + // assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs)); + // } + //} + + //function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { + // return { + // ...protocolFileSpanFromSubstring(file, text, options), + // isDefinition, + // isWriteAccess: isDefinition, + // lineText, + // }; + //} + + //function makeReferenceEntry(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): ReferenceEntry { + // return { + // ...documentSpanFromSubstring(file, text, options), + // isDefinition, + // isWriteAccess: isDefinition, + // isInString: undefined, + // }; + //} + + //function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray): void { + // openFilesForSession([file], session); + // const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false)); + // const program = project.getCurrentProgram()!; + // const output = getFileEmitOutput(program, Debug.assertDefined(program.getSourceFile(file.path)), /*emitOnlyDtsFiles*/ true); + // closeFilesForSession([file], session); + + // Debug.assert(!output.emitSkipped); + // assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false }))); + //} +} diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index cefa8a5e34c..3b7c276cfc4 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -1,21 +1,4 @@ namespace ts.projectSystem { - import TI = server.typingsInstaller; - import protocol = server.protocol; - import CommandNames = server.CommandNames; - - export import TestServerHost = TestFSWithWatch.TestServerHost; - export type File = TestFSWithWatch.File; - export type SymLink = TestFSWithWatch.SymLink; - export type Folder = TestFSWithWatch.Folder; - export import createServerHost = TestFSWithWatch.createServerHost; - export import checkArray = TestFSWithWatch.checkArray; - export import libFile = TestFSWithWatch.libFile; - export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; - export import checkWatchedFilesDetailed = TestFSWithWatch.checkWatchedFilesDetailed; - export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; - export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; - import safeList = TestFSWithWatch.safeList; - const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; function mapOutputToJson(s: string) { return convertToObject( @@ -24,319 +7,6 @@ namespace ts.projectSystem { ); } - export const customTypesMap = { - path: "/typesMap.json", - content: `{ - "typesMap": { - "jquery": { - "match": "jquery(-(\\\\.?\\\\d+)+)?(\\\\.intellisense)?(\\\\.min)?\\\\.js$", - "types": ["jquery"] - }, - "quack": { - "match": "/duckquack-(\\\\d+)\\\\.min\\\\.js", - "types": ["duck-types"] - } - }, - "simpleMap": { - "Bacon": "baconjs", - "bliss": "blissfuljs", - "commander": "commander", - "cordova": "cordova", - "react": "react", - "lodash": "lodash" - } - }` - }; - - export interface PostExecAction { - readonly success: boolean; - readonly callback: TI.RequestCompletedAction; - } - - export const nullLogger: server.Logger = { - close: noop, - hasLevel: () => false, - loggingEnabled: () => false, - perftrc: noop, - info: noop, - msg: noop, - startGroup: noop, - endGroup: noop, - getLogFileName: () => undefined, - }; - - export function createHasErrorMessageLogger() { - let hasErrorMsg = false; - const { close, hasLevel, loggingEnabled, startGroup, endGroup, info, getLogFileName, perftrc } = nullLogger; - const logger: server.Logger = { - close, hasLevel, loggingEnabled, startGroup, endGroup, info, getLogFileName, perftrc, - msg: (s, type) => { - Debug.fail(`Error: ${s}, type: ${type}`); - hasErrorMsg = true; - } - }; - return { logger, hasErrorMsg: () => hasErrorMsg }; - } - - export class TestTypingsInstaller extends TI.TypingsInstaller implements server.ITypingsInstaller { - protected projectService!: server.ProjectService; - constructor( - readonly globalTypingsCacheLocation: string, - throttleLimit: number, - installTypingHost: server.ServerHost, - readonly typesRegistry = createMap>(), - log?: TI.Log) { - super(installTypingHost, globalTypingsCacheLocation, safeList.path, customTypesMap.path, throttleLimit, log); - } - - protected postExecActions: PostExecAction[] = []; - - isKnownTypesPackageName = notImplemented; - installPackage = notImplemented; - inspectValue = notImplemented; - - executePendingCommands() { - const actionsToRun = this.postExecActions; - this.postExecActions = []; - for (const action of actionsToRun) { - action.callback(action.success); - } - } - - checkPendingCommands(expectedCount: number) { - assert.equal(this.postExecActions.length, expectedCount, `Expected ${expectedCount} post install actions`); - } - - onProjectClosed = noop; - - attach(projectService: server.ProjectService) { - this.projectService = projectService; - } - - getInstallTypingHost() { - return this.installTypingHost; - } - - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - this.addPostExecAction("success", cb); - } - - sendResponse(response: server.SetTypings | server.InvalidateCachedTypings) { - this.projectService.updateTypingsForProject(response); - } - - enqueueInstallTypingsRequest(project: server.Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray) { - const request = server.createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, this.globalTypingsCacheLocation); - this.install(request); - } - - addPostExecAction(stdout: string | string[], cb: TI.RequestCompletedAction) { - const out = isString(stdout) ? stdout : createNpmPackageJsonString(stdout); - const action: PostExecAction = { - success: !!out, - callback: cb - }; - this.postExecActions.push(action); - } - } - - function createNpmPackageJsonString(installedTypings: string[]): string { - const dependencies: MapLike = {}; - for (const typing of installedTypings) { - dependencies[typing] = "1.0.0"; - } - return JSON.stringify({ dependencies }); - } - - export function createTypesRegistry(...list: string[]): Map> { - const versionMap = { - "latest": "1.3.0", - "ts2.0": "1.0.0", - "ts2.1": "1.0.0", - "ts2.2": "1.2.0", - "ts2.3": "1.3.0", - "ts2.4": "1.3.0", - "ts2.5": "1.3.0", - "ts2.6": "1.3.0", - "ts2.7": "1.3.0" - }; - const map = createMap>(); - for (const l of list) { - map.set(l, versionMap); - } - return map; - } - - function createHostModuleResolutionTrace(host: TestServerHost & ModuleResolutionHost) { - const resolutionTrace: string[] = []; - host.trace = resolutionTrace.push.bind(resolutionTrace); - return resolutionTrace; - } - - export function toExternalFile(fileName: string): protocol.ExternalFile { - return { fileName }; - } - - export function toExternalFiles(fileNames: string[]) { - return map(fileNames, toExternalFile); - } - - export function fileStats(nonZeroStats: Partial): server.FileStats { - return { ts: 0, tsSize: 0, tsx: 0, tsxSize: 0, dts: 0, dtsSize: 0, js: 0, jsSize: 0, jsx: 0, jsxSize: 0, deferred: 0, deferredSize: 0, ...nonZeroStats }; - } - - export interface ConfigFileDiagnostic { - fileName: string | undefined; - start: number | undefined; - length: number | undefined; - messageText: string; - category: DiagnosticCategory; - code: number; - reportsUnnecessary?: {}; - source?: string; - relatedInformation?: DiagnosticRelatedInformation[]; - } - - export class TestServerEventManager { - private events: server.ProjectServiceEvent[] = []; - readonly session: TestSession; - readonly service: server.ProjectService; - readonly host: TestServerHost; - constructor(files: File[], suppressDiagnosticEvents?: boolean) { - this.host = createServerHost(files); - this.session = createSession(this.host, { - canUseEvents: true, - eventHandler: event => this.events.push(event), - suppressDiagnosticEvents, - }); - this.service = this.session.getProjectService(); - } - - getEvents(): ReadonlyArray { - const events = this.events; - this.events = []; - return events; - } - - getEvent(eventName: T["eventName"]): T["data"] { - let eventData: T["data"] | undefined; - filterMutate(this.events, e => { - if (e.eventName === eventName) { - if (eventData !== undefined) { - assert(false, "more than one event found"); - } - eventData = e.data; - return false; - } - return true; - }); - return Debug.assertDefined(eventData); - } - - hasZeroEvent(eventName: T["eventName"]) { - this.events.forEach(event => assert.notEqual(event.eventName, eventName)); - } - - checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string, errors: ReadonlyArray) { - const eventData = this.getEvent(server.ConfigFileDiagEvent); - assert.equal(eventData.configFileName, configFileName); - assert.equal(eventData.triggerFile, triggerFile); - const actual = eventData.diagnostics.map(({ file, messageText, ...rest }) => ({ fileName: file && file.fileName, messageText: isString(messageText) ? messageText : "", ...rest })); - if (errors) { - assert.deepEqual(actual, errors); - } - } - - assertProjectInfoTelemetryEvent(partial: Partial, configFile = "/tsconfig.json"): void { - assert.deepEqual(this.getEvent(server.ProjectInfoTelemetryEvent), { - projectId: sys.createSHA256Hash!(configFile), - fileStats: fileStats({ ts: 1 }), - compilerOptions: {}, - extends: false, - files: false, - include: false, - exclude: false, - compileOnSave: false, - typeAcquisition: { - enable: false, - exclude: false, - include: false, - }, - configFileName: "tsconfig.json", - projectType: "configured", - languageServiceEnabled: true, - version, - ...partial, - }); - } - - assertOpenFileTelemetryEvent(info: server.OpenFileInfo): void { - assert.deepEqual(this.getEvent(server.OpenFileInfoTelemetryEvent), { info }); - } - assertNoOpenFilesTelemetryEvent(): void { - this.hasZeroEvent(server.OpenFileInfoTelemetryEvent); - } - } - - class TestSession extends server.Session { - private seq = 0; - public events: protocol.Event[] = []; - public host!: TestServerHost; - - getProjectService() { - return this.projectService; - } - - public getSeq() { - return this.seq; - } - - public getNextSeq() { - return this.seq + 1; - } - - public executeCommandSeq(request: Partial) { - this.seq++; - request.seq = this.seq; - request.type = "request"; - return this.executeCommand(request); - } - - public event(body: T, eventName: string) { - this.events.push(server.toEvent(eventName, body)); - super.event(body, eventName); - } - - public clearMessages() { - clear(this.events); - this.host.clearOutput(); - } - } - - export function createSession(host: server.ServerHost, opts: Partial = {}) { - if (opts.typingsInstaller === undefined) { - opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); - } - - if (opts.eventHandler !== undefined) { - opts.canUseEvents = true; - } - - const sessionOptions: server.SessionOptions = { - host, - cancellationToken: server.nullCancellationToken, - useSingleInferredProject: false, - useInferredProjectPerProjectRoot: false, - typingsInstaller: undefined!, // TODO: GH#18217 - byteLength: Utils.byteLength, - hrtime: process.hrtime, - logger: opts.logger || createHasErrorMessageLogger().logger, - canUseEvents: false - }; - - return new TestSession({ ...sessionOptions, ...opts }); - } - function createSessionWithEventTracking(host: server.ServerHost, eventName: T["eventName"], ...eventNames: T["eventName"][]) { const events: T[] = []; const session = createSession(host, { @@ -371,101 +41,14 @@ namespace ts.projectSystem { } } - interface CreateProjectServiceParameters { - cancellationToken?: HostCancellationToken; - logger?: server.Logger; - useSingleInferredProject?: boolean; - typingsInstaller?: server.ITypingsInstaller; - eventHandler?: server.ProjectServiceEventHandler; - } - - export class TestProjectService extends server.ProjectService { - constructor(host: server.ServerHost, logger: server.Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean, - typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler, opts: Partial = {}) { - super({ - host, - logger, - cancellationToken, - useSingleInferredProject, - useInferredProjectPerProjectRoot: false, - typingsInstaller, - typesMapLocation: customTypesMap.path, - eventHandler, - ...opts - }); - } - - checkNumberOfProjects(count: { inferredProjects?: number, configuredProjects?: number, externalProjects?: number }) { - checkNumberOfProjects(this, count); - } - } - export function createProjectService(host: server.ServerHost, parameters: CreateProjectServiceParameters = {}, options?: Partial) { - const cancellationToken = parameters.cancellationToken || server.nullCancellationToken; - const logger = parameters.logger || createHasErrorMessageLogger().logger; - const useSingleInferredProject = parameters.useSingleInferredProject !== undefined ? parameters.useSingleInferredProject : false; - return new TestProjectService(host, logger, cancellationToken, useSingleInferredProject, parameters.typingsInstaller!, parameters.eventHandler!, options); // TODO: GH#18217 - } - - export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { - assert.equal(projectService.configuredProjects.size, expected, `expected ${expected} configured project(s)`); - } - - function checkNumberOfExternalProjects(projectService: server.ProjectService, expected: number) { - assert.equal(projectService.externalProjects.length, expected, `expected ${expected} external project(s)`); - } - - function checkNumberOfInferredProjects(projectService: server.ProjectService, expected: number) { - assert.equal(projectService.inferredProjects.length, expected, `expected ${expected} inferred project(s)`); - } - - export function checkNumberOfProjects(projectService: server.ProjectService, count: { inferredProjects?: number, configuredProjects?: number, externalProjects?: number }) { - checkNumberOfConfiguredProjects(projectService, count.configuredProjects || 0); - checkNumberOfExternalProjects(projectService, count.externalProjects || 0); - checkNumberOfInferredProjects(projectService, count.inferredProjects || 0); - } - - export function configuredProjectAt(projectService: server.ProjectService, index: number) { - const values = projectService.configuredProjects.values(); - while (index > 0) { - values.next(); - index--; - } - return values.next().value; - } - - export function checkProjectActualFiles(project: server.Project, expectedFiles: ReadonlyArray) { - checkArray(`${server.ProjectKind[project.projectKind]} project, actual files`, project.getFileNames(), expectedFiles); - } - function checkProjectRootFiles(project: server.Project, expectedFiles: ReadonlyArray) { checkArray(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); } - function mapCombinedPathsInAncestor(dir: string, path2: string, mapAncestor: (ancestor: string) => boolean) { - dir = normalizePath(dir); - const result: string[] = []; - forEachAncestorDirectory(dir, ancestor => { - if (mapAncestor(ancestor)) { - result.push(combinePaths(ancestor, path2)); - } - }); - return result; - } - - function getRootsToWatchWithAncestorDirectory(dir: string, path2: string) { - return mapCombinedPathsInAncestor(dir, path2, ancestor => ancestor.split(directorySeparator).length > 4); - } - - const nodeModules = "node_modules"; function getNodeModuleDirectories(dir: string) { return getRootsToWatchWithAncestorDirectory(dir, nodeModules); } - export const nodeModulesAtTypes = "node_modules/@types"; - export function getTypeRootsFromLocation(currentDirectory: string) { - return getRootsToWatchWithAncestorDirectory(currentDirectory, nodeModulesAtTypes); - } - function getNumberOfWatchesInvokedForRecursiveWatches(recursiveWatchedDirs: string[], file: string) { return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); } @@ -533,79 +116,6 @@ namespace ts.projectSystem { return index; } - /** - * Test server cancellation token used to mock host token cancellation requests. - * The cancelAfterRequest constructor param specifies how many isCancellationRequested() calls - * should be made before canceling the token. The id of the request to cancel should be set with - * setRequestToCancel(); - */ - export class TestServerCancellationToken implements server.ServerCancellationToken { - private currentId: number | undefined = -1; - private requestToCancel = -1; - private isCancellationRequestedCount = 0; - - constructor(private cancelAfterRequest = 0) { - } - - setRequest(requestId: number) { - this.currentId = requestId; - } - - setRequestToCancel(requestId: number) { - this.resetToken(); - this.requestToCancel = requestId; - } - - resetRequest(requestId: number) { - assert.equal(requestId, this.currentId, "unexpected request id in cancellation"); - this.currentId = undefined; - } - - isCancellationRequested() { - this.isCancellationRequestedCount++; - // If the request id is the request to cancel and isCancellationRequestedCount - // has been met then cancel the request. Ex: cancel the request if it is a - // nav bar request & isCancellationRequested() has already been called three times. - return this.requestToCancel === this.currentId && this.isCancellationRequestedCount >= this.cancelAfterRequest; - } - - resetToken() { - this.currentId = -1; - this.isCancellationRequestedCount = 0; - this.requestToCancel = -1; - } - } - - export function makeSessionRequest(command: string, args: T): protocol.Request { - return { - seq: 0, - type: "request", - command, - arguments: args - }; - } - - export function executeSessionRequest(session: server.Session, command: TRequest["command"], args: TRequest["arguments"]): TResponse["body"] { - return session.executeCommand(makeSessionRequest(command, args)).response as TResponse["body"]; - } - - export function executeSessionRequestNoResponse(session: server.Session, command: TRequest["command"], args: TRequest["arguments"]): void { - session.executeCommand(makeSessionRequest(command, args)); - } - - export function openFilesForSession(files: ReadonlyArray, session: server.Session): void { - for (const file of files) { - session.executeCommand(makeSessionRequest(CommandNames.Open, - "projectRootPath" in file ? { file: typeof file.file === "string" ? file.file : file.file.path, projectRootPath: file.projectRootPath } : { file: file.path })); - } - } - - export function closeFilesForSession(files: ReadonlyArray, session: server.Session): void { - for (const file of files) { - session.executeCommand(makeSessionRequest(CommandNames.Close, { file: file.path })); - } - } - interface ErrorInformation { diagnosticMessage: DiagnosticMessage; errorTextArguments?: string[]; @@ -4171,47 +3681,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem extra resolution pass in lshost", () => { - it("can load typings that are proper modules", () => { - const file1 = { - path: "/a/b/app.js", - content: `var x = require("lib")` - }; - const lib = { - path: "/a/cache/node_modules/@types/lib/index.d.ts", - content: "export let x = 1" - }; - const host: TestServerHost & ModuleResolutionHost = createServerHost([file1, lib]); - const resolutionTrace = createHostModuleResolutionTrace(host); - const projectService = createProjectService(host, { typingsInstaller: new TestTypingsInstaller("/a/cache", /*throttleLimit*/5, host) }); - - projectService.setCompilerOptionsForInferredProjects({ traceResolution: true, allowJs: true }); - projectService.openClientFile(file1.path); - projectService.checkNumberOfProjects({ inferredProjects: 1 }); - const proj = projectService.inferredProjects[0]; - - assert.deepEqual(resolutionTrace, [ - "======== Resolving module 'lib' from '/a/b/app.js'. ========", - "Module resolution kind is not specified, using 'NodeJs'.", - "Loading module 'lib' from 'node_modules' folder, target file type 'TypeScript'.", - "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", - "Directory '/a/node_modules' does not exist, skipping all lookups in it.", - "Directory '/node_modules' does not exist, skipping all lookups in it.", - "Loading module 'lib' from 'node_modules' folder, target file type 'JavaScript'.", - "Directory '/a/b/node_modules' does not exist, skipping all lookups in it.", - "Directory '/a/node_modules' does not exist, skipping all lookups in it.", - "Directory '/node_modules' does not exist, skipping all lookups in it.", - "======== Module name 'lib' was not resolved. ========", - `Auto discovery for typings is enabled in project '${proj.getProjectName()}'. Running extra resolution pass for module 'lib' using cache location '/a/cache'.`, - "File '/a/cache/node_modules/lib.d.ts' does not exist.", - "File '/a/cache/node_modules/@types/lib/package.json' does not exist.", - "File '/a/cache/node_modules/@types/lib.d.ts' does not exist.", - "File '/a/cache/node_modules/@types/lib/index.d.ts' exist - use it as a name resolution result.", - ]); - checkProjectActualFiles(proj, [file1.path, lib.path]); - }); - }); - describe("tsserverProjectSystem navigate-to for javascript project", () => { function containsNavToItem(items: protocol.NavtoItem[], itemName: string, itemKind: string) { return find(items, item => item.name === itemName && item.kind === itemKind) !== undefined; @@ -8218,56 +7687,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem Watched recursive directories with windows style file system", () => { - function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { - const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; - const configFile: File = { - path: root + "project/tsconfig.json", - content: "{}" - }; - const file1: File = { - path: root + "project/file1.ts", - content: "let x = 10;" - }; - const file2: File = { - path: root + "project/file2.ts", - content: "let y = 10;" - }; - const files = [configFile, file1, file2, libFile]; - const host = createServerHost(files, { useWindowsStylePaths: true }); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - const project = projectService.configuredProjects.get(configFile.path)!; - assert.isDefined(project); - const winsowsStyleLibFilePath = "c:/" + libFile.path.substring(1); - checkProjectActualFiles(project, files.map(f => f === libFile ? winsowsStyleLibFilePath : f.path)); - checkWatchedFiles(host, mapDefined(files, f => f === libFile ? winsowsStyleLibFilePath : f === file1 ? undefined : f.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, [ - root + "project", - root + "project/node_modules/@types" - ].concat(useProjectAtRoot ? [] : [root + nodeModulesAtTypes]), /*recursive*/ true); - } - - function verifyRootedDirectoryWatch(rootedPath: string) { - it("When project is in rootFolder of style c:/", () => { - verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ true); - }); - - it("When files at some folder other than root", () => { - verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ false); - }); - } - - describe("for rootFolder of style c:/", () => { - verifyRootedDirectoryWatch("c:/"); - }); - - describe("for rootFolder of style c:/users/username", () => { - verifyRootedDirectoryWatch("c:/users/username/"); - }); - }); - describe("tsserverProjectSystem typingsInstaller on inferred Project", () => { it("when projectRootPath is provided", () => { const projects = "/users/username/projects"; @@ -8671,490 +8090,6 @@ new C();` }); }); - describe("tsserverProjectSystem module resolution caching", () => { - const projectLocation = "/user/username/projects/myproject"; - const configFile: File = { - path: `${projectLocation}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { traceResolution: true } }) - }; - - function getModules(module1Path: string, module2Path: string) { - const module1: File = { - path: module1Path, - content: `export function module1() {}` - }; - const module2: File = { - path: module2Path, - content: `export function module2() {}` - }; - return { module1, module2 }; - } - - function verifyTrace(resolutionTrace: string[], expected: string[]) { - assert.deepEqual(resolutionTrace, expected); - resolutionTrace.length = 0; - } - - function getExpectedFileDoesNotExistResolutionTrace(host: TestServerHost, expectedTrace: string[], foundModule: boolean, module: File, directory: string, file: string, ignoreIfParentMissing?: boolean) { - if (!foundModule) { - const path = combinePaths(directory, file); - if (!ignoreIfParentMissing || host.directoryExists(getDirectoryPath(path))) { - if (module.path === path) { - foundModule = true; - } - else { - expectedTrace.push(`File '${path}' does not exist.`); - } - } - } - return foundModule; - } - - function getExpectedMissedLocationResolutionTrace(host: TestServerHost, expectedTrace: string[], dirPath: string, module: File, moduleName: string, useNodeModules: boolean, cacheLocation?: string) { - let foundModule = false; - forEachAncestorDirectory(dirPath, dirPath => { - if (dirPath === cacheLocation) { - return foundModule; - } - - const directory = useNodeModules ? combinePaths(dirPath, nodeModules) : dirPath; - if (useNodeModules && !foundModule && !host.directoryExists(directory)) { - expectedTrace.push(`Directory '${directory}' does not exist, skipping all lookups in it.`); - return undefined; - } - foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/package.json`, /*ignoreIfParentMissing*/ true); - foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.ts`); - foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.tsx`); - foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.d.ts`); - foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/index.ts`, /*ignoreIfParentMissing*/ true); - if (useNodeModules && !foundModule) { - expectedTrace.push(`Directory '${directory}/@types' does not exist, skipping all lookups in it.`); - } - return foundModule ? true : undefined; - }); - } - - function getExpectedResolutionTraceHeader(expectedTrace: string[], file: File, moduleName: string) { - expectedTrace.push( - `======== Resolving module '${moduleName}' from '${file.path}'. ========`, - `Module resolution kind is not specified, using 'NodeJs'.` - ); - } - - function getExpectedResolutionTraceFooter(expectedTrace: string[], module: File, moduleName: string, addRealPathTrace: boolean, ignoreModuleFileFound?: boolean) { - if (!ignoreModuleFileFound) { - expectedTrace.push(`File '${module.path}' exist - use it as a name resolution result.`); - } - if (addRealPathTrace) { - expectedTrace.push(`Resolving real path for '${module.path}', result '${module.path}'.`); - } - expectedTrace.push(`======== Module name '${moduleName}' was successfully resolved to '${module.path}'. ========`); - } - - function getExpectedRelativeModuleResolutionTrace(host: TestServerHost, file: File, module: File, moduleName: string, expectedTrace: string[] = []) { - getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); - expectedTrace.push(`Loading module as file / folder, candidate module location '${removeFileExtension(module.path)}', target file type 'TypeScript'.`); - getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(normalizePath(combinePaths(getDirectoryPath(file.path), moduleName))), module, moduleName.substring(moduleName.lastIndexOf("/") + 1), /*useNodeModules*/ false); - getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ false); - return expectedTrace; - } - - function getExpectedNonRelativeModuleResolutionTrace(host: TestServerHost, file: File, module: File, moduleName: string, expectedTrace: string[] = []) { - getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); - expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); - getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true); - getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ true); - return expectedTrace; - } - - function getExpectedNonRelativeModuleResolutionFromCacheTrace(host: TestServerHost, file: File, module: File, moduleName: string, cacheLocation: string, expectedTrace: string[] = []) { - getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); - expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); - getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true, cacheLocation); - expectedTrace.push(`Resolution for module '${moduleName}' was found in cache from location '${cacheLocation}'.`); - getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ false, /*ignoreModuleFileFound*/ true); - return expectedTrace; - } - - function getExpectedReusingResolutionFromOldProgram(file: File, moduleName: string) { - return `Reusing resolution of module '${moduleName}' to file '${file.path}' from old program.`; - } - - function verifyWatchesWithConfigFile(host: TestServerHost, files: File[], openFile: File, extraExpectedDirectories?: ReadonlyArray) { - const expectedRecursiveDirectories = arrayToSet([projectLocation, `${projectLocation}/${nodeModulesAtTypes}`, ...(extraExpectedDirectories || emptyArray)]); - checkWatchedFiles(host, mapDefined(files, f => { - if (f === openFile) { - return undefined; - } - const indexOfNodeModules = f.path.indexOf("/node_modules/"); - if (indexOfNodeModules === -1) { - return f.path; - } - expectedRecursiveDirectories.set(f.path.substr(0, indexOfNodeModules + "/node_modules".length), true); - return undefined; - })); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, arrayFrom(expectedRecursiveDirectories.keys()), /*recursive*/ true); - } - - describe("from files in same folder", () => { - function getFiles(fileContent: string) { - const file1: File = { - path: `${projectLocation}/src/file1.ts`, - content: fileContent - }; - const file2: File = { - path: `${projectLocation}/src/file2.ts`, - content: fileContent - }; - return { file1, file2 }; - } - - it("relative module name", () => { - const module1Name = "./module1"; - const module2Name = "../module2"; - const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; - const { file1, file2 } = getFiles(fileContent); - const { module1, module2 } = getModules(`${projectLocation}/src/module1.ts`, `${projectLocation}/module2.ts`); - const files = [module1, module2, file1, file2, configFile, libFile]; - const host = createServerHost(files); - const resolutionTrace = createHostModuleResolutionTrace(host); - const service = createProjectService(host); - service.openClientFile(file1.path); - const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); - getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1); - - file1.content += fileContent; - file2.content += fileContent; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - verifyTrace(resolutionTrace, [ - getExpectedReusingResolutionFromOldProgram(file1, module1Name), - getExpectedReusingResolutionFromOldProgram(file1, module2Name) - ]); - verifyWatchesWithConfigFile(host, files, file1); - }); - - it("non relative module name", () => { - const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/src`]; - const module1Name = "module1"; - const module2Name = "module2"; - const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; - const { file1, file2 } = getFiles(fileContent); - const { module1, module2 } = getModules(`${projectLocation}/src/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); - const files = [module1, module2, file1, file2, configFile, libFile]; - const host = createServerHost(files); - const resolutionTrace = createHostModuleResolutionTrace(host); - const service = createProjectService(host); - service.openClientFile(file1.path); - const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); - getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); - - file1.content += fileContent; - file2.content += fileContent; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - verifyTrace(resolutionTrace, [ - getExpectedReusingResolutionFromOldProgram(file1, module1Name), - getExpectedReusingResolutionFromOldProgram(file1, module2Name) - ]); - verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); - }); - }); - - describe("from files in different folders", () => { - function getFiles(fileContent1: string, fileContent2 = fileContent1, fileContent3 = fileContent1, fileContent4 = fileContent1) { - const file1: File = { - path: `${projectLocation}/product/src/file1.ts`, - content: fileContent1 - }; - const file2: File = { - path: `${projectLocation}/product/src/feature/file2.ts`, - content: fileContent2 - }; - const file3: File = { - path: `${projectLocation}/product/test/src/file3.ts`, - content: fileContent3 - }; - const file4: File = { - path: `${projectLocation}/product/test/file4.ts`, - content: fileContent4 - }; - return { file1, file2, file3, file4 }; - } - - it("relative module name", () => { - const module1Name = "./module1"; - const module2Name = "../module2"; - const module3Name = "../module1"; - const module4Name = "../../module2"; - const module5Name = "../../src/module1"; - const module6Name = "../src/module1"; - const fileContent1 = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; - const fileContent2 = `import { module1 } from "${module3Name}";import { module2 } from "${module4Name}";`; - const fileContent3 = `import { module1 } from "${module5Name}";import { module2 } from "${module4Name}";`; - const fileContent4 = `import { module1 } from "${module6Name}";import { module2 } from "${module2Name}";`; - const { file1, file2, file3, file4 } = getFiles(fileContent1, fileContent2, fileContent3, fileContent4); - const { module1, module2 } = getModules(`${projectLocation}/product/src/module1.ts`, `${projectLocation}/product/module2.ts`); - const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; - const host = createServerHost(files); - const resolutionTrace = createHostModuleResolutionTrace(host); - const service = createProjectService(host); - service.openClientFile(file1.path); - const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); - getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file2, module1, module3Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file2, module2, module4Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file4, module1, module6Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file3, module1, module5Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file3, module2, module4Name, expectedTrace); - verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1); - - file1.content += fileContent1; - file2.content += fileContent2; - file3.content += fileContent3; - file4.content += fileContent4; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - verifyTrace(resolutionTrace, [ - getExpectedReusingResolutionFromOldProgram(file1, module1Name), - getExpectedReusingResolutionFromOldProgram(file1, module2Name) - ]); - verifyWatchesWithConfigFile(host, files, file1); - }); - - it("non relative module name", () => { - const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/product`]; - const module1Name = "module1"; - const module2Name = "module2"; - const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; - const { file1, file2, file3, file4 } = getFiles(fileContent); - const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); - const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; - const host = createServerHost(files); - const resolutionTrace = createHostModuleResolutionTrace(host); - const service = createProjectService(host); - service.openClientFile(file1.path); - const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); - getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); - verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); - - file1.content += fileContent; - file2.content += fileContent; - file3.content += fileContent; - file4.content += fileContent; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - verifyTrace(resolutionTrace, [ - getExpectedReusingResolutionFromOldProgram(file1, module1Name), - getExpectedReusingResolutionFromOldProgram(file1, module2Name) - ]); - verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); - }); - - it("non relative module name from inferred project", () => { - const module1Name = "module1"; - const module2Name = "module2"; - const file2Name = "./feature/file2"; - const file3Name = "../test/src/file3"; - const file4Name = "../test/file4"; - const importModuleContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; - const { file1, file2, file3, file4 } = getFiles(`import "${file2Name}"; import "${file4Name}"; import "${file3Name}"; ${importModuleContent}`, importModuleContent, importModuleContent, importModuleContent); - const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); - const files = [module1, module2, file1, file2, file3, file4, libFile]; - const host = createServerHost(files); - const resolutionTrace = createHostModuleResolutionTrace(host); - const service = createProjectService(host); - service.setCompilerOptionsForInferredProjects({ traceResolution: true }); - service.openClientFile(file1.path); - const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, file2, file2Name); - getExpectedRelativeModuleResolutionTrace(host, file1, file4, file4Name, expectedTrace); - getExpectedRelativeModuleResolutionTrace(host, file1, file3, file3Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); - getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); - verifyTrace(resolutionTrace, expectedTrace); - - const currentDirectory = getDirectoryPath(file1.path); - const watchedFiles = mapDefined(files, f => f === file1 || f.path.indexOf("/node_modules/") !== -1 ? undefined : f.path); - forEachAncestorDirectory(currentDirectory, d => { - watchedFiles.push(combinePaths(d, "tsconfig.json"), combinePaths(d, "jsconfig.json")); - }); - const watchedRecursiveDirectories = getTypeRootsFromLocation(currentDirectory).concat([ - `${currentDirectory}/node_modules`, `${currentDirectory}/feature`, `${projectLocation}/product/${nodeModules}`, - `${projectLocation}/${nodeModules}`, `${projectLocation}/product/test/${nodeModules}`, - `${projectLocation}/product/test/src/${nodeModules}` - ]); - checkWatches(); - - file1.content += importModuleContent; - file2.content += importModuleContent; - file3.content += importModuleContent; - file4.content += importModuleContent; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - verifyTrace(resolutionTrace, [ - getExpectedReusingResolutionFromOldProgram(file1, file2Name), - getExpectedReusingResolutionFromOldProgram(file1, file4Name), - getExpectedReusingResolutionFromOldProgram(file1, file3Name), - getExpectedReusingResolutionFromOldProgram(file1, module1Name), - getExpectedReusingResolutionFromOldProgram(file1, module2Name) - ]); - checkWatches(); - - function checkWatches() { - checkWatchedFiles(host, watchedFiles); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); - } - }); - }); - - describe("when watching directories for failed lookup locations in amd resolution", () => { - const projectRoot = "/user/username/projects/project"; - const nodeFile: File = { - path: `${projectRoot}/src/typings/node.d.ts`, - content: ` -declare module "fs" { - export interface something { - } -}` - }; - const electronFile: File = { - path: `${projectRoot}/src/typings/electron.d.ts`, - content: ` -declare module 'original-fs' { - import * as fs from 'fs'; - export = fs; -}` - }; - const srcFile: File = { - path: `${projectRoot}/src/somefolder/srcfile.ts`, - content: ` -import { x } from "somefolder/module1"; -import { x } from "somefolder/module2"; -const y = x;` - }; - const moduleFile: File = { - path: `${projectRoot}/src/somefolder/module1.ts`, - content: ` -export const x = 10;` - }; - const configFile: File = { - path: `${projectRoot}/src/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { - module: "amd", - moduleResolution: "classic", - target: "es5", - outDir: "../out", - baseUrl: "./", - typeRoots: ["typings"] - } - }) - }; - - function verifyModuleResolution(useNodeFile: boolean) { - const files = [...(useNodeFile ? [nodeFile] : []), electronFile, srcFile, moduleFile, configFile, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(srcFile.path, srcFile.content, ScriptKind.TS, projectRoot); - checkProjectActualFiles(service.configuredProjects.get(configFile.path)!, files.map(f => f.path)); - checkWatchedFilesDetailed(host, mapDefined(files, f => f === srcFile ? undefined : f.path), 1); - if (useNodeFile) { - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); // since fs resolves to ambient module, shouldnt watch failed lookup - } - else { - checkWatchedDirectoriesDetailed(host, [`${projectRoot}`, `${projectRoot}/src`], 1, /*recursive*/ false); // failed lookup for fs - } - const expectedWatchedDirectories = createMap(); - expectedWatchedDirectories.set(`${projectRoot}/src`, 1); // Wild card - expectedWatchedDirectories.set(`${projectRoot}/src/somefolder`, 1); // failedLookup for somefolder/module2 - expectedWatchedDirectories.set(`${projectRoot}/src/node_modules`, 1); // failed lookup for somefolder/module2 - expectedWatchedDirectories.set(`${projectRoot}/somefolder`, 1); // failed lookup for somefolder/module2 - expectedWatchedDirectories.set(`${projectRoot}/node_modules`, 1); // failed lookup for with node_modules/@types/fs - expectedWatchedDirectories.set(`${projectRoot}/src/typings`, useNodeFile ? 1 : 2); // typeroot directory + failed lookup if not using node file - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ true); - } - - it("when resolves to ambient module", () => { - verifyModuleResolution(/*useNodeFile*/ true); - }); - - it("when resolution fails", () => { - verifyModuleResolution(/*useNodeFile*/ false); - }); - }); - - describe("ignores files/folder changes in node_modules that start with '.'", () => { - const projectPath = "/user/username/projects/project"; - const npmCacheFile: File = { - path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, - content: JSON.stringify({ something: 10 }) - }; - const file1: File = { - path: `${projectPath}/test.ts`, - content: `import { x } from "somemodule";` - }; - const file2: File = { - path: `${projectPath}/node_modules/somemodule/index.d.ts`, - content: `export const x = 10;` - }; - it("when watching node_modules in inferred project for failed lookup/closed script infos", () => { - const files = [libFile, file1, file2]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(file1.path); - checkNumberOfProjects(service, { inferredProjects: 1 }); - const project = service.inferredProjects[0]; - checkProjectActualFiles(project, files.map(f => f.path)); - (project as ResolutionCacheHost).maxNumberOfFilesToIterateForInvalidation = 1; - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - it("when watching node_modules as part of wild card directories in config project", () => { - const config: File = { - path: `${projectPath}/tsconfig.json`, - content: "{}" - }; - const files = [libFile, file1, file2, config]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(file1.path); - checkNumberOfProjects(service, { configuredProjects: 1 }); - const project = Debug.assertDefined(service.configuredProjects.get(config.path)); - checkProjectActualFiles(project, files.map(f => f.path)); - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - }); - }); - describe("tsserverProjectSystem getEditsForFileRename", () => { it("works for host implementing 'resolveModuleNames' and 'getResolvedModuleWithFailedLookupLocationsFromCache'", () => { const userTs: File = { diff --git a/src/testRunner/unittests/typingsInstaller.ts b/src/testRunner/unittests/typingsInstaller.ts index 34c5fa2a413..2b18af6a71f 100644 --- a/src/testRunner/unittests/typingsInstaller.ts +++ b/src/testRunner/unittests/typingsInstaller.ts @@ -1,5 +1,4 @@ namespace ts.projectSystem { - import TI = server.typingsInstaller; import validatePackageName = JsTyping.validatePackageName; import PackageNameValidationResult = JsTyping.PackageNameValidationResult; diff --git a/src/testRunner/unittests/watchApi.ts b/src/testRunner/unittests/watchApi.ts new file mode 100644 index 00000000000..60072e24730 --- /dev/null +++ b/src/testRunner/unittests/watchApi.ts @@ -0,0 +1,40 @@ +namespace ts.tscWatch { + describe("watchAPI:: tsc-watch with custom module resolution", () => { + const projectRoot = "/user/username/projects/project"; + const configFileJson: any = { + compilerOptions: { module: "commonjs", resolveJsonModule: true }, + files: ["index.ts"] + }; + const mainFile: File = { + path: `${projectRoot}/index.ts`, + content: "import settings from './settings.json';" + }; + const config: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify(configFileJson) + }; + const settingsJson: File = { + path: `${projectRoot}/settings.json`, + content: JSON.stringify({ content: "Print this" }) + }; + + it("verify that module resolution with json extension works when returned without extension", () => { + const files = [libFile, mainFile, config, settingsJson]; + const host = createWatchedSystem(files, { currentDirectory: projectRoot }); + const compilerHost = createWatchCompilerHostOfConfigFile(config.path, {}, host); + const parsedCommandResult = parseJsonConfigFileContent(configFileJson, host, config.path); + compilerHost.resolveModuleNames = (moduleNames, containingFile) => moduleNames.map(m => { + const result = resolveModuleName(m, containingFile, parsedCommandResult.options, compilerHost); + const resolvedModule = result.resolvedModule!; + return { + resolvedFileName: resolvedModule.resolvedFileName, + isExternalLibraryImport: resolvedModule.isExternalLibraryImport, + originalFileName: resolvedModule.originalPath, + }; + }); + const watch = createWatchProgram(compilerHost); + const program = watch.getCurrentProgram().getProgram(); + checkProgramActualFiles(program, [mainFile.path, libFile.path, settingsJson.path]); + }); + }); +} diff --git a/src/testRunner/unittests/watchEnvironment.ts b/src/testRunner/unittests/watchEnvironment.ts index 5b620b54e85..74a6637d6fc 100644 --- a/src/testRunner/unittests/watchEnvironment.ts +++ b/src/testRunner/unittests/watchEnvironment.ts @@ -262,5 +262,55 @@ namespace ts { verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); }); }); + + describe("watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { + function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { + const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; + const configFile: File = { + path: root + "project/tsconfig.json", + content: "{}" + }; + const file1: File = { + path: root + "project/file1.ts", + content: "let x = 10;" + }; + const file2: File = { + path: root + "project/file2.ts", + content: "let y = 10;" + }; + const files = [configFile, file1, file2, libFile]; + const host = createServerHost(files, { useWindowsStylePaths: true }); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isDefined(project); + const winsowsStyleLibFilePath = "c:/" + libFile.path.substring(1); + checkProjectActualFiles(project, files.map(f => f === libFile ? winsowsStyleLibFilePath : f.path)); + checkWatchedFiles(host, mapDefined(files, f => f === libFile ? winsowsStyleLibFilePath : f === file1 ? undefined : f.path)); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, [ + root + "project", + root + "project/node_modules/@types" + ].concat(useProjectAtRoot ? [] : [root + nodeModulesAtTypes]), /*recursive*/ true); + } + + function verifyRootedDirectoryWatch(rootedPath: string) { + it("When project is in rootFolder of style c:/", () => { + verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ true); + }); + + it("When files at some folder other than root", () => { + verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ false); + }); + } + + describe("for rootFolder of style c:/", () => { + verifyRootedDirectoryWatch("c:/"); + }); + + describe("for rootFolder of style c:/users/username", () => { + verifyRootedDirectoryWatch("c:/users/username/"); + }); + }); } } From 347f89c8516f755cc47849f5fa90517d2893707a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 10:52:00 -0800 Subject: [PATCH 225/322] tsc-watch emit tests in to its own tests --- src/testRunner/tsconfig.json | 1 + src/testRunner/unittests/tscWatchEmit.ts | 718 +++++++++++++++++++ src/testRunner/unittests/tscWatchHelpers.ts | 66 +- src/testRunner/unittests/tscWatchMode.ts | 729 -------------------- 4 files changed, 720 insertions(+), 794 deletions(-) create mode 100644 src/testRunner/unittests/tscWatchEmit.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 674188eee63..a95bc106fb1 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -86,6 +86,7 @@ "unittests/tsbuild.ts", "unittests/tsbuildWatchMode.ts", "unittests/tsconfigParsing.ts", + "unittests/tscWatchEmit.ts", "unittests/tscWatchMode.ts", "unittests/tsserverProjectSystem.ts", "unittests/typingsInstaller.ts", diff --git a/src/testRunner/unittests/tscWatchEmit.ts b/src/testRunner/unittests/tscWatchEmit.ts new file mode 100644 index 00000000000..e0e9abe516c --- /dev/null +++ b/src/testRunner/unittests/tscWatchEmit.ts @@ -0,0 +1,718 @@ +namespace ts.tscWatch { + function getEmittedLineForMultiFileOutput(file: File, host: WatchedSystem) { + return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; + } + + function getEmittedLineForSingleFileOutput(filename: string, host: WatchedSystem) { + return `TSFILE: ${filename}${host.newLine}`; + } + + interface FileOrFolderEmit extends File { + output?: string; + } + + function getFileOrFolderEmit(file: File, getOutput?: (file: File) => string): FileOrFolderEmit { + const result = file as FileOrFolderEmit; + if (getOutput) { + result.output = getOutput(file); + } + return result; + } + + function getEmittedLines(files: FileOrFolderEmit[]) { + const seen = createMap(); + const result: string[] = []; + for (const { output } of files) { + if (output && !seen.has(output)) { + seen.set(output, true); + result.push(output); + } + } + return result; + } + + function checkAffectedLines(host: WatchedSystem, affectedFiles: FileOrFolderEmit[], allEmittedFiles: string[]) { + const expectedAffectedFiles = getEmittedLines(affectedFiles); + const expectedNonAffectedFiles = mapDefined(allEmittedFiles, line => contains(expectedAffectedFiles, line) ? undefined : line); + checkOutputContains(host, expectedAffectedFiles); + checkOutputDoesNotContain(host, expectedNonAffectedFiles); + } + + describe("tsc-watch emit with outFile or out setting", () => { + function createWatchForOut(out?: string, outFile?: string) { + const host = createWatchedSystem([]); + const config: FileOrFolderEmit = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { listEmittedFiles: true } + }) + }; + + let getOutput: (file: File) => string; + if (out) { + config.content = JSON.stringify({ + compilerOptions: { listEmittedFiles: true, out } + }); + getOutput = __ => getEmittedLineForSingleFileOutput(out, host); + } + else if (outFile) { + config.content = JSON.stringify({ + compilerOptions: { listEmittedFiles: true, outFile } + }); + getOutput = __ => getEmittedLineForSingleFileOutput(outFile, host); + } + else { + getOutput = file => getEmittedLineForMultiFileOutput(file, host); + } + + const f1 = getFileOrFolderEmit({ + path: "/a/a.ts", + content: "let x = 1" + }, getOutput); + const f2 = getFileOrFolderEmit({ + path: "/a/b.ts", + content: "let y = 1" + }, getOutput); + + const files = [f1, f2, config, libFile]; + host.reloadFS(files); + createWatchOfConfigFile(config.path, host); + + const allEmittedLines = getEmittedLines(files); + checkOutputContains(host, allEmittedLines); + host.clearOutput(); + + f1.content = "let x = 11"; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkAffectedLines(host, [f1], allEmittedLines); + } + + it("projectUsesOutFile should not be returned if not set", () => { + createWatchForOut(); + }); + + it("projectUsesOutFile should be true if out is set", () => { + const outJs = "/a/out.js"; + createWatchForOut(outJs); + }); + + it("projectUsesOutFile should be true if outFile is set", () => { + const outJs = "/a/out.js"; + createWatchForOut(/*out*/ undefined, outJs); + }); + + function verifyFilesEmittedOnce(useOutFile: boolean) { + const file1: File = { + path: "/a/b/output/AnotherDependency/file1.d.ts", + content: "declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }" + }; + const file2: File = { + path: "/a/b/dependencies/file2.d.ts", + content: "declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }" + }; + const file3: File = { + path: "/a/b/project/src/main.ts", + content: "namespace Main { export function fooBar() {} }" + }; + const file4: File = { + path: "/a/b/project/src/main2.ts", + content: "namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }" + }; + const configFile: File = { + path: "/a/b/project/tsconfig.json", + content: JSON.stringify({ + compilerOptions: useOutFile ? + { outFile: "../output/common.js", target: "es5" } : + { outDir: "../output", target: "es5" }, + files: [file1.path, file2.path, file3.path, file4.path] + }) + }; + const files = [file1, file2, file3, file4]; + const allfiles = files.concat(configFile); + const host = createWatchedSystem(allfiles); + const originalWriteFile = host.writeFile.bind(host); + const mapOfFilesWritten = createMap(); + host.writeFile = (p: string, content: string) => { + const count = mapOfFilesWritten.get(p); + mapOfFilesWritten.set(p, count ? count + 1 : 1); + return originalWriteFile(p, content); + }; + createWatchOfConfigFile(configFile.path, host); + if (useOutFile) { + // Only out file + assert.equal(mapOfFilesWritten.size, 1); + } + else { + // main.js and main2.js + assert.equal(mapOfFilesWritten.size, 2); + } + mapOfFilesWritten.forEach((value, key) => { + assert.equal(value, 1, "Key: " + key); + }); + } + + it("with --outFile and multiple declaration files in the program", () => { + verifyFilesEmittedOnce(/*useOutFile*/ true); + }); + + it("without --outFile and multiple declaration files in the program", () => { + verifyFilesEmittedOnce(/*useOutFile*/ false); + }); + }); + + describe("tsc-watch emit for configured projects", () => { + const file1Consumer1Path = "/a/b/file1Consumer1.ts"; + const moduleFile1Path = "/a/b/moduleFile1.ts"; + const configFilePath = "/a/b/tsconfig.json"; + interface InitialStateParams { + /** custom config file options */ + configObj?: any; + /** list of the files that will be emitted for first compilation */ + firstCompilationEmitFiles?: string[]; + /** get the emit file for file - default is multi file emit line */ + getEmitLine?(file: File, host: WatchedSystem): string; + /** Additional files and folders to add */ + getAdditionalFileOrFolder?(): File[]; + /** initial list of files to emit if not the default list */ + firstReloadFileList?: string[]; + } + function getInitialState({ configObj = {}, firstCompilationEmitFiles, getEmitLine, getAdditionalFileOrFolder, firstReloadFileList }: InitialStateParams = {}) { + const host = createWatchedSystem([]); + const getOutputName = getEmitLine ? (file: File) => getEmitLine(file, host) : + (file: File) => getEmittedLineForMultiFileOutput(file, host); + + const moduleFile1 = getFileOrFolderEmit({ + path: moduleFile1Path, + content: "export function Foo() { };", + }, getOutputName); + + const file1Consumer1 = getFileOrFolderEmit({ + path: file1Consumer1Path, + content: `import {Foo} from "./moduleFile1"; export var y = 10;`, + }, getOutputName); + + const file1Consumer2 = getFileOrFolderEmit({ + path: "/a/b/file1Consumer2.ts", + content: `import {Foo} from "./moduleFile1"; let z = 10;`, + }, getOutputName); + + const moduleFile2 = getFileOrFolderEmit({ + path: "/a/b/moduleFile2.ts", + content: `export var Foo4 = 10;`, + }, getOutputName); + + const globalFile3 = getFileOrFolderEmit({ + path: "/a/b/globalFile3.ts", + content: `interface GlobalFoo { age: number }` + }); + + const additionalFiles = getAdditionalFileOrFolder ? + map(getAdditionalFileOrFolder(), file => getFileOrFolderEmit(file, getOutputName)) : + []; + + (configObj.compilerOptions || (configObj.compilerOptions = {})).listEmittedFiles = true; + const configFile = getFileOrFolderEmit({ + path: configFilePath, + content: JSON.stringify(configObj) + }); + + const files = [moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile, ...additionalFiles]; + let allEmittedFiles = getEmittedLines(files); + host.reloadFS(firstReloadFileList ? getFiles(firstReloadFileList) : files); + + // Initial compile + createWatchOfConfigFile(configFile.path, host); + if (firstCompilationEmitFiles) { + checkAffectedLines(host, getFiles(firstCompilationEmitFiles), allEmittedFiles); + } + else { + checkOutputContains(host, allEmittedFiles); + } + host.clearOutput(); + + return { + moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, + files, + getFile, + verifyAffectedFiles, + verifyAffectedAllFiles, + getOutputName + }; + + function getFiles(filelist: string[]) { + return map(filelist, getFile); + } + + function getFile(fileName: string) { + return find(files, file => file.path === fileName)!; + } + + function verifyAffectedAllFiles() { + host.reloadFS(files); + host.checkTimeoutQueueLengthAndRun(1); + checkOutputContains(host, allEmittedFiles); + host.clearOutput(); + } + + function verifyAffectedFiles(expected: FileOrFolderEmit[], filesToReload?: FileOrFolderEmit[]) { + if (!filesToReload) { + filesToReload = files; + } + else if (filesToReload.length > files.length) { + allEmittedFiles = getEmittedLines(filesToReload); + } + host.reloadFS(filesToReload); + host.checkTimeoutQueueLengthAndRun(1); + checkAffectedLines(host, expected, allEmittedFiles); + host.clearOutput(); + } + } + + it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { + const { + moduleFile1, file1Consumer1, file1Consumer2, + verifyAffectedFiles + } = getInitialState(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` + moduleFile1.content = `export var T: number;export function Foo() { console.log('hi'); };`; + verifyAffectedFiles([moduleFile1]); + }); + + it("should be up-to-date with the reference map changes", () => { + const { + moduleFile1, file1Consumer1, file1Consumer2, + verifyAffectedFiles + } = getInitialState(); + + // Change file1Consumer1 content to `export let y = Foo();` + file1Consumer1.content = `export let y = Foo();`; + verifyAffectedFiles([file1Consumer1]); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer2]); + + // Add the import statements back to file1Consumer1 + file1Consumer1.content = `import {Foo} from "./moduleFile1";let y = Foo();`; + verifyAffectedFiles([file1Consumer1]); + + // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` + moduleFile1.content = `export var T: number;export var T2: string;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer2, file1Consumer1]); + + // Multiple file edits in one go: + + // Change file1Consumer1 content to `export let y = Foo();` + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + file1Consumer1.content = `export let y = Foo();`; + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); + }); + + it("should be up-to-date with deleted files", () => { + const { + moduleFile1, file1Consumer1, file1Consumer2, + files, + verifyAffectedFiles + } = getInitialState(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + + // Delete file1Consumer2 + const filesToLoad = mapDefined(files, file => file === file1Consumer2 ? undefined : file); + verifyAffectedFiles([moduleFile1, file1Consumer1], filesToLoad); + }); + + it("should be up-to-date with newly created files", () => { + const { + moduleFile1, file1Consumer1, file1Consumer2, + files, + verifyAffectedFiles, + getOutputName + } = getInitialState(); + + const file1Consumer3 = getFileOrFolderEmit({ + path: "/a/b/file1Consumer3.ts", + content: `import {Foo} from "./moduleFile1"; let y = Foo();` + }, getOutputName); + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer3, file1Consumer2], files.concat(file1Consumer3)); + }); + + it("should detect changes in non-root files", () => { + const { + moduleFile1, file1Consumer1, + verifyAffectedFiles + } = getInitialState({ configObj: { files: [file1Consumer1Path] }, firstCompilationEmitFiles: [file1Consumer1Path, moduleFile1Path] }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1]); + + // change file1 internal, and verify only file1 is affected + moduleFile1.content += "var T1: number;"; + verifyAffectedFiles([moduleFile1]); + }); + + it("should return all files if a global file changed shape", () => { + const { + globalFile3, verifyAffectedAllFiles + } = getInitialState(); + + globalFile3.content += "var T2: string;"; + verifyAffectedAllFiles(); + }); + + it("should always return the file itself if '--isolatedModules' is specified", () => { + const { + moduleFile1, verifyAffectedFiles + } = getInitialState({ configObj: { compilerOptions: { isolatedModules: true } } }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1]); + }); + + it("should always return the file itself if '--out' or '--outFile' is specified", () => { + const outFilePath = "/a/b/out.js"; + const { + moduleFile1, verifyAffectedFiles + } = getInitialState({ + configObj: { compilerOptions: { module: "system", outFile: outFilePath } }, + getEmitLine: (_, host) => getEmittedLineForSingleFileOutput(outFilePath, host) + }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1]); + }); + + it("should return cascaded affected file list", () => { + const file1Consumer1Consumer1: File = { + path: "/a/b/file1Consumer1Consumer1.ts", + content: `import {y} from "./file1Consumer1";` + }; + const { + moduleFile1, file1Consumer1, file1Consumer2, verifyAffectedFiles, getFile + } = getInitialState({ + getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] + }); + + const file1Consumer1Consumer1Emit = getFile(file1Consumer1Consumer1.path); + file1Consumer1.content += "export var T: number;"; + verifyAffectedFiles([file1Consumer1, file1Consumer1Consumer1Emit]); + + // Doesnt change the shape of file1Consumer1 + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); + + // Change both files before the timeout + file1Consumer1.content += "export var T2: number;"; + moduleFile1.content = `export var T2: number;export function Foo() { };`; + verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2, file1Consumer1Consumer1Emit]); + }); + + it("should work fine for files with circular references", () => { + // TODO: do not exit on such errors? Just continue to watch the files for update in watch mode + + const file1: File = { + path: "/a/b/file1.ts", + content: ` + /// + export var t1 = 10;` + }; + const file2: File = { + path: "/a/b/file2.ts", + content: ` + /// + export var t2 = 10;` + }; + const { + configFile, + getFile, + verifyAffectedFiles + } = getInitialState({ + firstCompilationEmitFiles: [file1.path, file2.path], + getAdditionalFileOrFolder: () => [file1, file2], + firstReloadFileList: [libFile.path, file1.path, file2.path, configFilePath] + }); + const file1Emit = getFile(file1.path), file2Emit = getFile(file2.path); + + file1Emit.content += "export var t3 = 10;"; + verifyAffectedFiles([file1Emit, file2Emit], [file1, file2, libFile, configFile]); + + }); + + it("should detect removed code file", () => { + const referenceFile1: File = { + path: "/a/b/referenceFile1.ts", + content: ` + /// + export var x = Foo();` + }; + const { + configFile, + getFile, + verifyAffectedFiles + } = getInitialState({ + firstCompilationEmitFiles: [referenceFile1.path, moduleFile1Path], + getAdditionalFileOrFolder: () => [referenceFile1], + firstReloadFileList: [libFile.path, referenceFile1.path, moduleFile1Path, configFilePath] + }); + + const referenceFile1Emit = getFile(referenceFile1.path); + verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); + }); + + it("should detect non-existing code file", () => { + const referenceFile1: File = { + path: "/a/b/referenceFile1.ts", + content: ` + /// + export var x = Foo();` + }; + const { + configFile, + moduleFile2, + getFile, + verifyAffectedFiles + } = getInitialState({ + firstCompilationEmitFiles: [referenceFile1.path], + getAdditionalFileOrFolder: () => [referenceFile1], + firstReloadFileList: [libFile.path, referenceFile1.path, configFilePath] + }); + + const referenceFile1Emit = getFile(referenceFile1.path); + referenceFile1Emit.content += "export var yy = Foo();"; + verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); + + // Create module File2 and see both files are saved + verifyAffectedFiles([referenceFile1Emit, moduleFile2], [libFile, moduleFile2, referenceFile1Emit, configFile]); + }); + }); + + describe("tsc-watch emit file content", () => { + interface EmittedFile extends File { + shouldBeWritten: boolean; + } + function getEmittedFiles(files: FileOrFolderEmit[], contents: string[]): EmittedFile[] { + return map(contents, (content, index) => { + return { + content, + path: changeExtension(files[index].path, Extension.Js), + shouldBeWritten: true + }; + } + ); + } + function verifyEmittedFiles(host: WatchedSystem, emittedFiles: EmittedFile[]) { + for (const { path, content, shouldBeWritten } of emittedFiles) { + if (shouldBeWritten) { + assert.isTrue(host.fileExists(path), `Expected file ${path} to be present`); + assert.equal(host.readFile(path), content, `Contents of file ${path} do not match`); + } + else { + assert.isNotTrue(host.fileExists(path), `Expected file ${path} to be absent`); + } + } + } + + function verifyEmittedFileContents(newLine: string, inputFiles: File[], initialEmittedFileContents: string[], + modifyFiles: (files: FileOrFolderEmit[], emitedFiles: EmittedFile[]) => FileOrFolderEmit[], configFile?: File) { + const host = createWatchedSystem([], { newLine }); + const files = concatenate( + map(inputFiles, file => getFileOrFolderEmit(file, fileToConvert => getEmittedLineForMultiFileOutput(fileToConvert, host))), + configFile ? [libFile, configFile] : [libFile] + ); + const allEmittedFiles = getEmittedLines(files); + host.reloadFS(files); + + // Initial compile + if (configFile) { + createWatchOfConfigFile(configFile.path, host); + } + else { + // First file as the root + createWatchOfFilesAndCompilerOptions([files[0].path], host, { listEmittedFiles: true }); + } + checkOutputContains(host, allEmittedFiles); + + const emittedFiles = getEmittedFiles(files, initialEmittedFileContents); + verifyEmittedFiles(host, emittedFiles); + host.clearOutput(); + + const affectedFiles = modifyFiles(files, emittedFiles); + host.reloadFS(files); + host.checkTimeoutQueueLengthAndRun(1); + checkAffectedLines(host, affectedFiles, allEmittedFiles); + + verifyEmittedFiles(host, emittedFiles); + } + + function verifyNewLine(newLine: string) { + const lines = ["var x = 1;", "var y = 2;"]; + const fileContent = lines.join(newLine); + const f = { + path: "/a/app.ts", + content: fileContent + }; + + verifyEmittedFileContents(newLine, [f], [fileContent + newLine], modifyFiles); + + function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { + files[0].content = fileContent + newLine + "var z = 3;"; + emittedFiles[0].content = files[0].content + newLine; + return [files[0]]; + } + } + + it("handles new lines: \\n", () => { + verifyNewLine("\n"); + }); + + it("handles new lines: \\r\\n", () => { + verifyNewLine("\r\n"); + }); + + it("should emit specified file", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export function Foo() { return 10; }` + }; + + const file2 = { + path: "/a/b/f2.ts", + content: `import {Foo} from "./f1"; export let y = Foo();` + }; + + const file3 = { + path: "/a/b/f3.ts", + content: `import {y} from "./f2"; let x = y;` + }; + + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { listEmittedFiles: true } }) + }; + + verifyEmittedFileContents("\r\n", [file1, file2, file3], [ + `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`, + `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`, + `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n` + ], modifyFiles, configFile); + + function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { + files[0].content += `export function foo2() { return 2; }`; + emittedFiles[0].content += `function foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`; + emittedFiles[2].shouldBeWritten = false; + return files.slice(0, 2); + } + }); + + it("Elides const enums correctly in incremental compilation", () => { + const currentDirectory = "/user/someone/projects/myproject"; + const file1: File = { + path: `${currentDirectory}/file1.ts`, + content: "export const enum E1 { V = 1 }" + }; + const file2: File = { + path: `${currentDirectory}/file2.ts`, + content: `import { E1 } from "./file1"; export const enum E2 { V = E1.V }` + }; + const file3: File = { + path: `${currentDirectory}/file3.ts`, + content: `import { E2 } from "./file2"; const v: E2 = E2.V;` + }; + const strictAndEsModule = `"use strict";\nexports.__esModule = true;\n`; + verifyEmittedFileContents("\n", [file3, file2, file1], [ + `${strictAndEsModule}var v = 1 /* V */;\n`, + strictAndEsModule, + strictAndEsModule + ], modifyFiles); + + function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { + files[0].content += `function foo2() { return 2; }`; + emittedFiles[0].content += `function foo2() { return 2; }\n`; + emittedFiles[1].shouldBeWritten = false; + emittedFiles[2].shouldBeWritten = false; + return [files[0]]; + } + }); + + it("file is deleted and created as part of change", () => { + const projectLocation = "/home/username/project"; + const file: File = { + path: `${projectLocation}/app/file.ts`, + content: "var a = 10;" + }; + const fileJs = `${projectLocation}/app/file.js`; + const configFile: File = { + path: `${projectLocation}/tsconfig.json`, + content: JSON.stringify({ + include: [ + "app/**/*.ts" + ] + }) + }; + const files = [file, configFile, libFile]; + const host = createWatchedSystem(files, { currentDirectory: projectLocation, useCaseSensitiveFileNames: true }); + createWatchOfConfigFile("tsconfig.json", host); + verifyProgram(); + + file.content += "\nvar b = 10;"; + + host.reloadFS(files, { invokeFileDeleteCreateAsPartInsteadOfChange: true }); + host.runQueuedTimeoutCallbacks(); + verifyProgram(); + + function verifyProgram() { + assert.isTrue(host.fileExists(fileJs)); + assert.equal(host.readFile(fileJs), file.content + "\n"); + } + }); + }); + + describe("tsc-watch with when module emit is specified as node", () => { + it("when instead of filechanged recursive directory watcher is invoked", () => { + const configFile: File = { + path: "/a/rootFolder/project/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + module: "none", + allowJs: true, + outDir: "Static/scripts/" + }, + include: [ + "Scripts/**/*" + ], + }) + }; + const outputFolder = "/a/rootFolder/project/Static/scripts/"; + const file1: File = { + path: "/a/rootFolder/project/Scripts/TypeScript.ts", + content: "var z = 10;" + }; + const file2: File = { + path: "/a/rootFolder/project/Scripts/Javascript.js", + content: "var zz = 10;" + }; + const files = [configFile, file1, file2, libFile]; + const host = createWatchedSystem(files); + const watch = createWatchOfConfigFile(configFile.path, host); + + checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); + file1.content = "var zz30 = 100;"; + host.reloadFS(files, { invokeDirectoryWatcherInsteadOfFileChanged: true }); + host.runQueuedTimeoutCallbacks(); + + checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); + const outputFile1 = changeExtension((outputFolder + getBaseFileName(file1.path)), ".js"); + assert.isTrue(host.fileExists(outputFile1)); + assert.equal(host.readFile(outputFile1), file1.content + host.newLine); + }); + }); +} diff --git a/src/testRunner/unittests/tscWatchHelpers.ts b/src/testRunner/unittests/tscWatchHelpers.ts index 6e3fd40c495..f51ecc4e64d 100644 --- a/src/testRunner/unittests/tscWatchHelpers.ts +++ b/src/testRunner/unittests/tscWatchHelpers.ts @@ -41,45 +41,6 @@ namespace ts.tscWatch { return () => watch.getCurrentProgram().getProgram(); } - //function getEmittedLineForMultiFileOutput(file: File, host: WatchedSystem) { - // return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; - //} - - //function getEmittedLineForSingleFileOutput(filename: string, host: WatchedSystem) { - // return `TSFILE: ${filename}${host.newLine}`; - //} - - //interface FileOrFolderEmit extends File { - // output?: string; - //} - - //function getFileOrFolderEmit(file: File, getOutput?: (file: File) => string): FileOrFolderEmit { - // const result = file as FileOrFolderEmit; - // if (getOutput) { - // result.output = getOutput(file); - // } - // return result; - //} - - //function getEmittedLines(files: FileOrFolderEmit[]) { - // const seen = createMap(); - // const result: string[] = []; - // for (const { output } of files) { - // if (output && !seen.has(output)) { - // seen.set(output, true); - // result.push(output); - // } - // } - // return result; - //} - - //function checkAffectedLines(host: WatchedSystem, affectedFiles: FileOrFolderEmit[], allEmittedFiles: string[]) { - // const expectedAffectedFiles = getEmittedLines(affectedFiles); - // const expectedNonAffectedFiles = mapDefined(allEmittedFiles, line => contains(expectedAffectedFiles, line) ? undefined : line); - // checkOutputContains(host, expectedAffectedFiles); - // checkOutputDoesNotContain(host, expectedNonAffectedFiles); - //} - const elapsedRegex = /^Elapsed:: [0-9]+ms/; function checkOutputErrors( host: WatchedSystem, @@ -182,7 +143,7 @@ namespace ts.tscWatch { assert.equal(host.exitCode, expectedExitCode); } - function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { + export function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { return { file, start, @@ -194,31 +155,6 @@ namespace ts.tscWatch { }; } - //function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - // let text = getLocaleSpecificMessage(message); - - // if (arguments.length > 1) { - // text = formatStringFromArgs(text, arguments, 1); - // } - - // return getDiagnosticOfFileFrom(/*file*/ undefined, text, /*start*/ undefined, /*length*/ undefined, message); - //} - - //function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - // let text = getLocaleSpecificMessage(message); - - // if (arguments.length > 4) { - // text = formatStringFromArgs(text, arguments, 4); - // } - - // return getDiagnosticOfFileFrom(file, text, start, length, message); - //} - - //function getUnknownCompilerOption(program: Program, configFile: File, option: string) { - // const quotedOption = `"${option}"`; - // return getDiagnosticOfFile(program.getCompilerOptions().configFile!, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); - //} - export function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { let text = getLocaleSpecificMessage(message); diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 662f26e8b13..29726b12424 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -1,55 +1,4 @@ namespace ts.tscWatch { - function getEmittedLineForMultiFileOutput(file: File, host: WatchedSystem) { - return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; - } - - function getEmittedLineForSingleFileOutput(filename: string, host: WatchedSystem) { - return `TSFILE: ${filename}${host.newLine}`; - } - - interface FileOrFolderEmit extends File { - output?: string; - } - - function getFileOrFolderEmit(file: File, getOutput?: (file: File) => string): FileOrFolderEmit { - const result = file as FileOrFolderEmit; - if (getOutput) { - result.output = getOutput(file); - } - return result; - } - - function getEmittedLines(files: FileOrFolderEmit[]) { - const seen = createMap(); - const result: string[] = []; - for (const { output } of files) { - if (output && !seen.has(output)) { - seen.set(output, true); - result.push(output); - } - } - return result; - } - - function checkAffectedLines(host: WatchedSystem, affectedFiles: FileOrFolderEmit[], allEmittedFiles: string[]) { - const expectedAffectedFiles = getEmittedLines(affectedFiles); - const expectedNonAffectedFiles = mapDefined(allEmittedFiles, line => contains(expectedAffectedFiles, line) ? undefined : line); - checkOutputContains(host, expectedAffectedFiles); - checkOutputDoesNotContain(host, expectedNonAffectedFiles); - } - - function getDiagnosticOfFileFrom(file: SourceFile | undefined, text: string, start: number | undefined, length: number | undefined, message: DiagnosticMessage): Diagnostic { - return { - file, - start, - length, - - messageText: text, - category: message.category, - code: message.code, - }; - } - function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { let text = getLocaleSpecificMessage(message); @@ -1546,684 +1495,6 @@ interface Document { }); }); - describe("tsc-watch emit with outFile or out setting", () => { - function createWatchForOut(out?: string, outFile?: string) { - const host = createWatchedSystem([]); - const config: FileOrFolderEmit = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { listEmittedFiles: true } - }) - }; - - let getOutput: (file: File) => string; - if (out) { - config.content = JSON.stringify({ - compilerOptions: { listEmittedFiles: true, out } - }); - getOutput = __ => getEmittedLineForSingleFileOutput(out, host); - } - else if (outFile) { - config.content = JSON.stringify({ - compilerOptions: { listEmittedFiles: true, outFile } - }); - getOutput = __ => getEmittedLineForSingleFileOutput(outFile, host); - } - else { - getOutput = file => getEmittedLineForMultiFileOutput(file, host); - } - - const f1 = getFileOrFolderEmit({ - path: "/a/a.ts", - content: "let x = 1" - }, getOutput); - const f2 = getFileOrFolderEmit({ - path: "/a/b.ts", - content: "let y = 1" - }, getOutput); - - const files = [f1, f2, config, libFile]; - host.reloadFS(files); - createWatchOfConfigFile(config.path, host); - - const allEmittedLines = getEmittedLines(files); - checkOutputContains(host, allEmittedLines); - host.clearOutput(); - - f1.content = "let x = 11"; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkAffectedLines(host, [f1], allEmittedLines); - } - - it("projectUsesOutFile should not be returned if not set", () => { - createWatchForOut(); - }); - - it("projectUsesOutFile should be true if out is set", () => { - const outJs = "/a/out.js"; - createWatchForOut(outJs); - }); - - it("projectUsesOutFile should be true if outFile is set", () => { - const outJs = "/a/out.js"; - createWatchForOut(/*out*/ undefined, outJs); - }); - - function verifyFilesEmittedOnce(useOutFile: boolean) { - const file1: File = { - path: "/a/b/output/AnotherDependency/file1.d.ts", - content: "declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }" - }; - const file2: File = { - path: "/a/b/dependencies/file2.d.ts", - content: "declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }" - }; - const file3: File = { - path: "/a/b/project/src/main.ts", - content: "namespace Main { export function fooBar() {} }" - }; - const file4: File = { - path: "/a/b/project/src/main2.ts", - content: "namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }" - }; - const configFile: File = { - path: "/a/b/project/tsconfig.json", - content: JSON.stringify({ - compilerOptions: useOutFile ? - { outFile: "../output/common.js", target: "es5" } : - { outDir: "../output", target: "es5" }, - files: [file1.path, file2.path, file3.path, file4.path] - }) - }; - const files = [file1, file2, file3, file4]; - const allfiles = files.concat(configFile); - const host = createWatchedSystem(allfiles); - const originalWriteFile = host.writeFile.bind(host); - const mapOfFilesWritten = createMap(); - host.writeFile = (p: string, content: string) => { - const count = mapOfFilesWritten.get(p); - mapOfFilesWritten.set(p, count ? count + 1 : 1); - return originalWriteFile(p, content); - }; - createWatchOfConfigFile(configFile.path, host); - if (useOutFile) { - // Only out file - assert.equal(mapOfFilesWritten.size, 1); - } - else { - // main.js and main2.js - assert.equal(mapOfFilesWritten.size, 2); - } - mapOfFilesWritten.forEach((value, key) => { - assert.equal(value, 1, "Key: " + key); - }); - } - - it("with --outFile and multiple declaration files in the program", () => { - verifyFilesEmittedOnce(/*useOutFile*/ true); - }); - - it("without --outFile and multiple declaration files in the program", () => { - verifyFilesEmittedOnce(/*useOutFile*/ false); - }); - }); - - describe("tsc-watch emit for configured projects", () => { - const file1Consumer1Path = "/a/b/file1Consumer1.ts"; - const moduleFile1Path = "/a/b/moduleFile1.ts"; - const configFilePath = "/a/b/tsconfig.json"; - interface InitialStateParams { - /** custom config file options */ - configObj?: any; - /** list of the files that will be emitted for first compilation */ - firstCompilationEmitFiles?: string[]; - /** get the emit file for file - default is multi file emit line */ - getEmitLine?(file: File, host: WatchedSystem): string; - /** Additional files and folders to add */ - getAdditionalFileOrFolder?(): File[]; - /** initial list of files to emit if not the default list */ - firstReloadFileList?: string[]; - } - function getInitialState({ configObj = {}, firstCompilationEmitFiles, getEmitLine, getAdditionalFileOrFolder, firstReloadFileList }: InitialStateParams = {}) { - const host = createWatchedSystem([]); - const getOutputName = getEmitLine ? (file: File) => getEmitLine(file, host) : - (file: File) => getEmittedLineForMultiFileOutput(file, host); - - const moduleFile1 = getFileOrFolderEmit({ - path: moduleFile1Path, - content: "export function Foo() { };", - }, getOutputName); - - const file1Consumer1 = getFileOrFolderEmit({ - path: file1Consumer1Path, - content: `import {Foo} from "./moduleFile1"; export var y = 10;`, - }, getOutputName); - - const file1Consumer2 = getFileOrFolderEmit({ - path: "/a/b/file1Consumer2.ts", - content: `import {Foo} from "./moduleFile1"; let z = 10;`, - }, getOutputName); - - const moduleFile2 = getFileOrFolderEmit({ - path: "/a/b/moduleFile2.ts", - content: `export var Foo4 = 10;`, - }, getOutputName); - - const globalFile3 = getFileOrFolderEmit({ - path: "/a/b/globalFile3.ts", - content: `interface GlobalFoo { age: number }` - }); - - const additionalFiles = getAdditionalFileOrFolder ? - map(getAdditionalFileOrFolder(), file => getFileOrFolderEmit(file, getOutputName)) : - []; - - (configObj.compilerOptions || (configObj.compilerOptions = {})).listEmittedFiles = true; - const configFile = getFileOrFolderEmit({ - path: configFilePath, - content: JSON.stringify(configObj) - }); - - const files = [moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile, ...additionalFiles]; - let allEmittedFiles = getEmittedLines(files); - host.reloadFS(firstReloadFileList ? getFiles(firstReloadFileList) : files); - - // Initial compile - createWatchOfConfigFile(configFile.path, host); - if (firstCompilationEmitFiles) { - checkAffectedLines(host, getFiles(firstCompilationEmitFiles), allEmittedFiles); - } - else { - checkOutputContains(host, allEmittedFiles); - } - host.clearOutput(); - - return { - moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, - files, - getFile, - verifyAffectedFiles, - verifyAffectedAllFiles, - getOutputName - }; - - function getFiles(filelist: string[]) { - return map(filelist, getFile); - } - - function getFile(fileName: string) { - return find(files, file => file.path === fileName)!; - } - - function verifyAffectedAllFiles() { - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(1); - checkOutputContains(host, allEmittedFiles); - host.clearOutput(); - } - - function verifyAffectedFiles(expected: FileOrFolderEmit[], filesToReload?: FileOrFolderEmit[]) { - if (!filesToReload) { - filesToReload = files; - } - else if (filesToReload.length > files.length) { - allEmittedFiles = getEmittedLines(filesToReload); - } - host.reloadFS(filesToReload); - host.checkTimeoutQueueLengthAndRun(1); - checkAffectedLines(host, expected, allEmittedFiles); - host.clearOutput(); - } - } - - it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - verifyAffectedFiles - } = getInitialState(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` - moduleFile1.content = `export var T: number;export function Foo() { console.log('hi'); };`; - verifyAffectedFiles([moduleFile1]); - }); - - it("should be up-to-date with the reference map changes", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - verifyAffectedFiles - } = getInitialState(); - - // Change file1Consumer1 content to `export let y = Foo();` - file1Consumer1.content = `export let y = Foo();`; - verifyAffectedFiles([file1Consumer1]); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer2]); - - // Add the import statements back to file1Consumer1 - file1Consumer1.content = `import {Foo} from "./moduleFile1";let y = Foo();`; - verifyAffectedFiles([file1Consumer1]); - - // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` - moduleFile1.content = `export var T: number;export var T2: string;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer2, file1Consumer1]); - - // Multiple file edits in one go: - - // Change file1Consumer1 content to `export let y = Foo();` - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - file1Consumer1.content = `export let y = Foo();`; - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); - }); - - it("should be up-to-date with deleted files", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - files, - verifyAffectedFiles - } = getInitialState(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - - // Delete file1Consumer2 - const filesToLoad = mapDefined(files, file => file === file1Consumer2 ? undefined : file); - verifyAffectedFiles([moduleFile1, file1Consumer1], filesToLoad); - }); - - it("should be up-to-date with newly created files", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - files, - verifyAffectedFiles, - getOutputName - } = getInitialState(); - - const file1Consumer3 = getFileOrFolderEmit({ - path: "/a/b/file1Consumer3.ts", - content: `import {Foo} from "./moduleFile1"; let y = Foo();` - }, getOutputName); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer3, file1Consumer2], files.concat(file1Consumer3)); - }); - - it("should detect changes in non-root files", () => { - const { - moduleFile1, file1Consumer1, - verifyAffectedFiles - } = getInitialState({ configObj: { files: [file1Consumer1Path] }, firstCompilationEmitFiles: [file1Consumer1Path, moduleFile1Path] }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1]); - - // change file1 internal, and verify only file1 is affected - moduleFile1.content += "var T1: number;"; - verifyAffectedFiles([moduleFile1]); - }); - - it("should return all files if a global file changed shape", () => { - const { - globalFile3, verifyAffectedAllFiles - } = getInitialState(); - - globalFile3.content += "var T2: string;"; - verifyAffectedAllFiles(); - }); - - it("should always return the file itself if '--isolatedModules' is specified", () => { - const { - moduleFile1, verifyAffectedFiles - } = getInitialState({ configObj: { compilerOptions: { isolatedModules: true } } }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1]); - }); - - it("should always return the file itself if '--out' or '--outFile' is specified", () => { - const outFilePath = "/a/b/out.js"; - const { - moduleFile1, verifyAffectedFiles - } = getInitialState({ - configObj: { compilerOptions: { module: "system", outFile: outFilePath } }, - getEmitLine: (_, host) => getEmittedLineForSingleFileOutput(outFilePath, host) - }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1]); - }); - - it("should return cascaded affected file list", () => { - const file1Consumer1Consumer1: File = { - path: "/a/b/file1Consumer1Consumer1.ts", - content: `import {y} from "./file1Consumer1";` - }; - const { - moduleFile1, file1Consumer1, file1Consumer2, verifyAffectedFiles, getFile - } = getInitialState({ - getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] - }); - - const file1Consumer1Consumer1Emit = getFile(file1Consumer1Consumer1.path); - file1Consumer1.content += "export var T: number;"; - verifyAffectedFiles([file1Consumer1, file1Consumer1Consumer1Emit]); - - // Doesnt change the shape of file1Consumer1 - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); - - // Change both files before the timeout - file1Consumer1.content += "export var T2: number;"; - moduleFile1.content = `export var T2: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2, file1Consumer1Consumer1Emit]); - }); - - it("should work fine for files with circular references", () => { - // TODO: do not exit on such errors? Just continue to watch the files for update in watch mode - - const file1: File = { - path: "/a/b/file1.ts", - content: ` - /// - export var t1 = 10;` - }; - const file2: File = { - path: "/a/b/file2.ts", - content: ` - /// - export var t2 = 10;` - }; - const { - configFile, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [file1.path, file2.path], - getAdditionalFileOrFolder: () => [file1, file2], - firstReloadFileList: [libFile.path, file1.path, file2.path, configFilePath] - }); - const file1Emit = getFile(file1.path), file2Emit = getFile(file2.path); - - file1Emit.content += "export var t3 = 10;"; - verifyAffectedFiles([file1Emit, file2Emit], [file1, file2, libFile, configFile]); - - }); - - it("should detect removed code file", () => { - const referenceFile1: File = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { - configFile, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [referenceFile1.path, moduleFile1Path], - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [libFile.path, referenceFile1.path, moduleFile1Path, configFilePath] - }); - - const referenceFile1Emit = getFile(referenceFile1.path); - verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); - }); - - it("should detect non-existing code file", () => { - const referenceFile1: File = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { - configFile, - moduleFile2, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [referenceFile1.path], - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [libFile.path, referenceFile1.path, configFilePath] - }); - - const referenceFile1Emit = getFile(referenceFile1.path); - referenceFile1Emit.content += "export var yy = Foo();"; - verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); - - // Create module File2 and see both files are saved - verifyAffectedFiles([referenceFile1Emit, moduleFile2], [libFile, moduleFile2, referenceFile1Emit, configFile]); - }); - }); - - describe("tsc-watch emit file content", () => { - interface EmittedFile extends File { - shouldBeWritten: boolean; - } - function getEmittedFiles(files: FileOrFolderEmit[], contents: string[]): EmittedFile[] { - return map(contents, (content, index) => { - return { - content, - path: changeExtension(files[index].path, Extension.Js), - shouldBeWritten: true - }; - } - ); - } - function verifyEmittedFiles(host: WatchedSystem, emittedFiles: EmittedFile[]) { - for (const { path, content, shouldBeWritten } of emittedFiles) { - if (shouldBeWritten) { - assert.isTrue(host.fileExists(path), `Expected file ${path} to be present`); - assert.equal(host.readFile(path), content, `Contents of file ${path} do not match`); - } - else { - assert.isNotTrue(host.fileExists(path), `Expected file ${path} to be absent`); - } - } - } - - function verifyEmittedFileContents(newLine: string, inputFiles: File[], initialEmittedFileContents: string[], - modifyFiles: (files: FileOrFolderEmit[], emitedFiles: EmittedFile[]) => FileOrFolderEmit[], configFile?: File) { - const host = createWatchedSystem([], { newLine }); - const files = concatenate( - map(inputFiles, file => getFileOrFolderEmit(file, fileToConvert => getEmittedLineForMultiFileOutput(fileToConvert, host))), - configFile ? [libFile, configFile] : [libFile] - ); - const allEmittedFiles = getEmittedLines(files); - host.reloadFS(files); - - // Initial compile - if (configFile) { - createWatchOfConfigFile(configFile.path, host); - } - else { - // First file as the root - createWatchOfFilesAndCompilerOptions([files[0].path], host, { listEmittedFiles: true }); - } - checkOutputContains(host, allEmittedFiles); - - const emittedFiles = getEmittedFiles(files, initialEmittedFileContents); - verifyEmittedFiles(host, emittedFiles); - host.clearOutput(); - - const affectedFiles = modifyFiles(files, emittedFiles); - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(1); - checkAffectedLines(host, affectedFiles, allEmittedFiles); - - verifyEmittedFiles(host, emittedFiles); - } - - function verifyNewLine(newLine: string) { - const lines = ["var x = 1;", "var y = 2;"]; - const fileContent = lines.join(newLine); - const f = { - path: "/a/app.ts", - content: fileContent - }; - - verifyEmittedFileContents(newLine, [f], [fileContent + newLine], modifyFiles); - - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content = fileContent + newLine + "var z = 3;"; - emittedFiles[0].content = files[0].content + newLine; - return [files[0]]; - } - } - - it("handles new lines: \\n", () => { - verifyNewLine("\n"); - }); - - it("handles new lines: \\r\\n", () => { - verifyNewLine("\r\n"); - }); - - it("should emit specified file", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export function Foo() { return 10; }` - }; - - const file2 = { - path: "/a/b/f2.ts", - content: `import {Foo} from "./f1"; export let y = Foo();` - }; - - const file3 = { - path: "/a/b/f3.ts", - content: `import {y} from "./f2"; let x = y;` - }; - - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { listEmittedFiles: true } }) - }; - - verifyEmittedFileContents("\r\n", [file1, file2, file3], [ - `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`, - `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`, - `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n` - ], modifyFiles, configFile); - - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content += `export function foo2() { return 2; }`; - emittedFiles[0].content += `function foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`; - emittedFiles[2].shouldBeWritten = false; - return files.slice(0, 2); - } - }); - - it("Elides const enums correctly in incremental compilation", () => { - const currentDirectory = "/user/someone/projects/myproject"; - const file1: File = { - path: `${currentDirectory}/file1.ts`, - content: "export const enum E1 { V = 1 }" - }; - const file2: File = { - path: `${currentDirectory}/file2.ts`, - content: `import { E1 } from "./file1"; export const enum E2 { V = E1.V }` - }; - const file3: File = { - path: `${currentDirectory}/file3.ts`, - content: `import { E2 } from "./file2"; const v: E2 = E2.V;` - }; - const strictAndEsModule = `"use strict";\nexports.__esModule = true;\n`; - verifyEmittedFileContents("\n", [file3, file2, file1], [ - `${strictAndEsModule}var v = 1 /* V */;\n`, - strictAndEsModule, - strictAndEsModule - ], modifyFiles); - - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content += `function foo2() { return 2; }`; - emittedFiles[0].content += `function foo2() { return 2; }\n`; - emittedFiles[1].shouldBeWritten = false; - emittedFiles[2].shouldBeWritten = false; - return [files[0]]; - } - }); - - it("file is deleted and created as part of change", () => { - const projectLocation = "/home/username/project"; - const file: File = { - path: `${projectLocation}/app/file.ts`, - content: "var a = 10;" - }; - const fileJs = `${projectLocation}/app/file.js`; - const configFile: File = { - path: `${projectLocation}/tsconfig.json`, - content: JSON.stringify({ - include: [ - "app/**/*.ts" - ] - }) - }; - const files = [file, configFile, libFile]; - const host = createWatchedSystem(files, { currentDirectory: projectLocation, useCaseSensitiveFileNames: true }); - createWatchOfConfigFile("tsconfig.json", host); - verifyProgram(); - - file.content += "\nvar b = 10;"; - - host.reloadFS(files, { invokeFileDeleteCreateAsPartInsteadOfChange: true }); - host.runQueuedTimeoutCallbacks(); - verifyProgram(); - - function verifyProgram() { - assert.isTrue(host.fileExists(fileJs)); - assert.equal(host.readFile(fileJs), file.content + "\n"); - } - }); - }); - - describe("tsc-watch with when module emit is specified as node", () => { - it("when instead of filechanged recursive directory watcher is invoked", () => { - const configFile: File = { - path: "/a/rootFolder/project/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - module: "none", - allowJs: true, - outDir: "Static/scripts/" - }, - include: [ - "Scripts/**/*" - ], - }) - }; - const outputFolder = "/a/rootFolder/project/Static/scripts/"; - const file1: File = { - path: "/a/rootFolder/project/Scripts/TypeScript.ts", - content: "var z = 10;" - }; - const file2: File = { - path: "/a/rootFolder/project/Scripts/Javascript.js", - content: "var zz = 10;" - }; - const files = [configFile, file1, file2, libFile]; - const host = createWatchedSystem(files); - const watch = createWatchOfConfigFile(configFile.path, host); - - checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); - file1.content = "var zz30 = 100;"; - host.reloadFS(files, { invokeDirectoryWatcherInsteadOfFileChanged: true }); - host.runQueuedTimeoutCallbacks(); - - checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); - const outputFile1 = changeExtension((outputFolder + getBaseFileName(file1.path)), ".js"); - assert.isTrue(host.fileExists(outputFile1)); - assert.equal(host.readFile(outputFile1), file1.content + host.newLine); - }); - }); - describe("tsc-watch console clearing", () => { const currentDirectoryLog = "Current directory: / CaseSensitiveFileNames: false\n"; const fileWatcherAddedLog = [ From 53a6968f06a1944a6519a378c06b8c30ae015bd6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:14:10 -0800 Subject: [PATCH 226/322] More refactoring for compile on save --- src/testRunner/unittests/compileOnSave.ts | 49 +++++++++++++++++++ .../unittests/tsserverProjectSystem.ts | 48 ------------------ 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/testRunner/unittests/compileOnSave.ts b/src/testRunner/unittests/compileOnSave.ts index 07a0aa5d3ae..2352ac58c19 100644 --- a/src/testRunner/unittests/compileOnSave.ts +++ b/src/testRunner/unittests/compileOnSave.ts @@ -502,6 +502,54 @@ namespace ts.projectSystem { ]); }); }); + + describe("tsserverProjectSystem emit with outFile or out setting", () => { + function test(opts: CompilerOptions, expectedUsesOutFile: boolean) { + const f1 = { + path: "/a/a.ts", + content: "let x = 1" + }; + const f2 = { + path: "/a/b.ts", + content: "let y = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: opts, + compileOnSave: true + }) + }; + const host = createServerHost([f1, f2, config]); + const session = projectSystem.createSession(host); + session.executeCommand({ + seq: 1, + type: "request", + command: "open", + arguments: { file: f1.path } + }); + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); + const { response } = session.executeCommand({ + seq: 2, + type: "request", + command: "compileOnSaveAffectedFileList", + arguments: { file: f1.path } + }); + assert.equal((response).length, 1, "expected output for 1 project"); + assert.equal((response)[0].fileNames.length, 2, "expected output for 1 project"); + assert.equal((response)[0].projectUsesOutFile, expectedUsesOutFile, "usesOutFile"); + } + + it("projectUsesOutFile should not be returned if not set", () => { + test({}, /*expectedUsesOutFile*/ false); + }); + it("projectUsesOutFile should be true if outFile is set", () => { + test({ outFile: "/a/out.js" }, /*expectedUsesOutFile*/ true); + }); + it("projectUsesOutFile should be true if out is set", () => { + test({ out: "/a/out.js" }, /*expectedUsesOutFile*/ true); + }); + }); }); describe("compileOnSave:: EmitFile test", () => { @@ -646,4 +694,5 @@ namespace ts.projectSystem { } }); }); + } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 3b7c276cfc4..122d9459e75 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -5607,54 +5607,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem emit with outFile or out setting", () => { - function test(opts: CompilerOptions, expectedUsesOutFile: boolean) { - const f1 = { - path: "/a/a.ts", - content: "let x = 1" - }; - const f2 = { - path: "/a/b.ts", - content: "let y = 1" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: opts, - compileOnSave: true - }) - }; - const host = createServerHost([f1, f2, config]); - const session = createSession(host); - session.executeCommand({ - seq: 1, - type: "request", - command: "open", - arguments: { file: f1.path } - }); - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); - const { response } = session.executeCommand({ - seq: 2, - type: "request", - command: "compileOnSaveAffectedFileList", - arguments: { file: f1.path } - }); - assert.equal((response).length, 1, "expected output for 1 project"); - assert.equal((response)[0].fileNames.length, 2, "expected output for 1 project"); - assert.equal((response)[0].projectUsesOutFile, expectedUsesOutFile, "usesOutFile"); - } - - it("projectUsesOutFile should not be returned if not set", () => { - test({}, /*expectedUsesOutFile*/ false); - }); - it("projectUsesOutFile should be true if outFile is set", () => { - test({ outFile: "/a/out.js" }, /*expectedUsesOutFile*/ true); - }); - it("projectUsesOutFile should be true if out is set", () => { - test({ out: "/a/out.js" }, /*expectedUsesOutFile*/ true); - }); - }); - describe("tsserverProjectSystem import helpers", () => { it("should not crash in tsserver", () => { const f1 = { From 1b6db32ecd07121063d9ee4eafa2a1795c7dd070 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:22:14 -0800 Subject: [PATCH 227/322] Move error tests from tsserver project system to projectErrors --- src/testRunner/unittests/projectErrors.ts | 281 ++++++++++++++++ src/testRunner/unittests/tsserverHelpers.ts | 44 +-- .../unittests/tsserverProjectSystem.ts | 310 ------------------ 3 files changed, 303 insertions(+), 332 deletions(-) diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/projectErrors.ts index d243e9d5ea4..6eb364b569d 100644 --- a/src/testRunner/unittests/projectErrors.ts +++ b/src/testRunner/unittests/projectErrors.ts @@ -199,4 +199,285 @@ namespace ts.projectSystem { } }); }); + + describe("tsserver:: Project Errors are reported as appropriate", () => { + function createErrorLogger() { + let hasError = false; + const errorLogger: server.Logger = { + close: noop, + hasLevel: () => true, + loggingEnabled: () => true, + perftrc: noop, + info: noop, + msg: (_s, type) => { + if (type === server.Msg.Err) { + hasError = true; + } + }, + startGroup: noop, + endGroup: noop, + getLogFileName: () => undefined + }; + return { + errorLogger, + hasError: () => hasError + }; + } + + it("document is not contained in project", () => { + const file1 = { + path: "/a/b/app.ts", + content: "" + }; + const corruptedConfig = { + path: "/a/b/tsconfig.json", + content: "{" + }; + const host = createServerHost([file1, corruptedConfig]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + + const project = projectService.findProject(corruptedConfig.path)!; + checkProjectRootFiles(project, [file1.path]); + }); + + describe("when opening new file that doesnt exist on disk yet", () => { + function verifyNonExistentFile(useProjectRoot: boolean) { + const folderPath = "/user/someuser/projects/someFolder"; + const fileInRoot: File = { + path: `/src/somefile.d.ts`, + content: "class c { }" + }; + const fileInProjectRoot: File = { + path: `${folderPath}/src/somefile.d.ts`, + content: "class c { }" + }; + const host = createServerHost([libFile, fileInRoot, fileInProjectRoot]); + const { hasError, errorLogger } = createErrorLogger(); + const session = createSession(host, { canUseEvents: true, logger: errorLogger, useInferredProjectPerProjectRoot: true }); + + const projectService = session.getProjectService(); + const untitledFile = "untitled:Untitled-1"; + const refPathNotFound1 = "../../../../../../typings/@epic/Core.d.ts"; + const refPathNotFound2 = "./src/somefile.d.ts"; + const fileContent = `/// +/// `; + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { + file: untitledFile, + fileContent, + scriptKindName: "TS", + projectRootPath: useProjectRoot ? folderPath : undefined + } + }); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const infoForUntitledAtProjectRoot = projectService.getScriptInfoForPath(`${folderPath.toLowerCase()}/${untitledFile.toLowerCase()}` as Path); + const infoForUnitiledAtRoot = projectService.getScriptInfoForPath(`/${untitledFile.toLowerCase()}` as Path); + const infoForSomefileAtProjectRoot = projectService.getScriptInfoForPath(`/${folderPath.toLowerCase()}/src/somefile.d.ts` as Path); + const infoForSomefileAtRoot = projectService.getScriptInfoForPath(`${fileInRoot.path.toLowerCase()}` as Path); + if (useProjectRoot) { + assert.isDefined(infoForUntitledAtProjectRoot); + assert.isUndefined(infoForUnitiledAtRoot); + } + else { + assert.isDefined(infoForUnitiledAtRoot); + assert.isUndefined(infoForUntitledAtProjectRoot); + } + assert.isUndefined(infoForSomefileAtRoot); + assert.isUndefined(infoForSomefileAtProjectRoot); + + // Since this is not js project so no typings are queued + host.checkTimeoutQueueLength(0); + + const newTimeoutId = host.getNextTimeoutId(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [untitledFile] + } + }); + host.checkTimeoutQueueLength(1); + + // Run the last one = get error request + host.runQueuedTimeoutCallbacks(newTimeoutId); + + assert.isFalse(hasError()); + host.checkTimeoutQueueLength(0); + checkErrorMessage(session, "syntaxDiag", { file: untitledFile, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + assert.isFalse(hasError()); + const errorOffset = fileContent.indexOf(refPathNotFound1) + 1; + checkErrorMessage(session, "semanticDiag", { + file: untitledFile, + diagnostics: [ + createDiagnostic({ line: 1, offset: errorOffset }, { line: 1, offset: errorOffset + refPathNotFound1.length }, Diagnostics.File_0_not_found, [refPathNotFound1], "error"), + createDiagnostic({ line: 2, offset: errorOffset }, { line: 2, offset: errorOffset + refPathNotFound2.length }, Diagnostics.File_0_not_found, [refPathNotFound2.substr(2)], "error") + ] + }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + assert.isFalse(hasError()); + checkErrorMessage(session, "suggestionDiag", { file: untitledFile, diagnostics: [] }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + } + + it("has projectRoot", () => { + verifyNonExistentFile(/*useProjectRoot*/ true); + }); + + it("does not have projectRoot", () => { + verifyNonExistentFile(/*useProjectRoot*/ false); + }); + }); + + it("folder rename updates project structure and reports no errors", () => { + const projectDir = "/a/b/projects/myproject"; + const app: File = { + path: `${projectDir}/bar/app.ts`, + content: "class Bar implements foo.Foo { getFoo() { return ''; } get2() { return 1; } }" + }; + const foo: File = { + path: `${projectDir}/foo/foo.ts`, + content: "declare namespace foo { interface Foo { get2(): number; getFoo(): string; } }" + }; + const configFile: File = { + path: `${projectDir}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { module: "none", targer: "es5" }, exclude: ["node_modules"] }) + }; + const host = createServerHost([app, foo, configFile]); + const session = createSession(host, { canUseEvents: true, }); + const projectService = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: app.path, } + }); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.isDefined(projectService.configuredProjects.get(configFile.path)); + verifyErrorsInApp(); + + host.renameFolder(`${projectDir}/foo`, `${projectDir}/foo2`); + host.runQueuedTimeoutCallbacks(); + host.runQueuedTimeoutCallbacks(); + verifyErrorsInApp(); + + function verifyErrorsInApp() { + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [app.path] + } + }); + host.checkTimeoutQueueLengthAndRun(1); + checkErrorMessage(session, "syntaxDiag", { file: app.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + checkErrorMessage(session, "semanticDiag", { file: app.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: app.path, diagnostics: [] }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + } + }); + + it("Getting errors before opening file", () => { + const file: File = { + path: "/a/b/project/file.ts", + content: "let x: number = false;" + }; + const host = createServerHost([file, libFile]); + const { hasError, errorLogger } = createErrorLogger(); + const session = createSession(host, { canUseEvents: true, logger: errorLogger }); + + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path] + } + }); + + host.runQueuedImmediateCallbacks(); + assert.isFalse(hasError()); + checkCompleteEvent(session, 1, expectedSequenceId); + session.clearMessages(); + }); + + it("Reports errors correctly when file referenced by inferred project root, is opened right after closing the root file", () => { + const projectRoot = "/user/username/projects/myproject"; + const app: File = { + path: `${projectRoot}/src/client/app.js`, + content: "" + }; + const serverUtilities: File = { + path: `${projectRoot}/src/server/utilities.js`, + content: `function getHostName() { return "hello"; } export { getHostName };` + }; + const backendTest: File = { + path: `${projectRoot}/test/backend/index.js`, + content: `import { getHostName } from '../../src/server/utilities';export default getHostName;` + }; + const files = [libFile, app, serverUtilities, backendTest]; + const host = createServerHost(files); + const session = createSession(host, { useInferredProjectPerProjectRoot: true, canUseEvents: true }); + openFilesForSession([{ file: app, projectRootPath: projectRoot }], session); + const service = session.getProjectService(); + checkNumberOfProjects(service, { inferredProjects: 1 }); + const project = service.inferredProjects[0]; + checkProjectActualFiles(project, [libFile.path, app.path]); + openFilesForSession([{ file: backendTest, projectRootPath: projectRoot }], session); + checkNumberOfProjects(service, { inferredProjects: 1 }); + checkProjectActualFiles(project, files.map(f => f.path)); + checkErrors([backendTest.path, app.path]); + closeFilesForSession([backendTest], session); + openFilesForSession([{ file: serverUtilities.path, projectRootPath: projectRoot }], session); + checkErrors([serverUtilities.path, app.path]); + + function checkErrors(openFiles: [string, string]) { + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: protocol.CommandTypes.Geterr, + arguments: { + delay: 0, + files: openFiles + } + }); + + for (const openFile of openFiles) { + session.clearMessages(); + host.checkTimeoutQueueLength(3); + host.runQueuedTimeoutCallbacks(host.getNextTimeoutId() - 1); + + checkErrorMessage(session, "syntaxDiag", { file: openFile, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + checkErrorMessage(session, "semanticDiag", { file: openFile, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: openFile, diagnostics: [] }); + } + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + } + }); + }); } diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts index 5162f17d6ae..f5113b768fc 100644 --- a/src/testRunner/unittests/tsserverHelpers.ts +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -430,9 +430,9 @@ namespace ts.projectSystem { checkArray(`${server.ProjectKind[project.projectKind]} project, actual files`, project.getFileNames(), expectedFiles); } - //function checkProjectRootFiles(project: server.Project, expectedFiles: ReadonlyArray) { - // checkArray(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); - //} + export function checkProjectRootFiles(project: server.Project, expectedFiles: ReadonlyArray) { + checkArray(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); + } export function mapCombinedPathsInAncestor(dir: string, path2: string, mapAncestor: (ancestor: string) => boolean) { dir = normalizePath(dir); @@ -613,17 +613,17 @@ namespace ts.projectSystem { // verifyDiagnostics(actual, []); //} - //function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { - // checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); - //} + export function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { + checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); + } - //function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}, relatedInformation?: protocol.DiagnosticRelatedInformation[]): protocol.Diagnostic { - // return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, relatedInformation, source: undefined }; - //} + export function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}, relatedInformation?: protocol.DiagnosticRelatedInformation[]): protocol.Diagnostic { + return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, relatedInformation, source: undefined }; + } - //function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { - // checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); - //} + export function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { + checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); + } //function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { // checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); @@ -635,18 +635,18 @@ namespace ts.projectSystem { // } //} - //function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { - // const events = session.events; - // assert.deepEqual(events[index], expectedEvent, `Expected ${JSON.stringify(expectedEvent)} at ${index} in ${JSON.stringify(events)}`); + export function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { + const events = session.events; + assert.deepEqual(events[index], expectedEvent, `Expected ${JSON.stringify(expectedEvent)} at ${index} in ${JSON.stringify(events)}`); - // const outputs = session.host.getOutput(); - // assert.equal(outputs[index], server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, session.host.newLine)); + const outputs = session.host.getOutput(); + assert.equal(outputs[index], server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, session.host.newLine)); - // if (isMostRecent) { - // assert.strictEqual(events.length, index + 1, JSON.stringify(events)); - // assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs)); - // } - //} + if (isMostRecent) { + assert.strictEqual(events.length, index + 1, JSON.stringify(events)); + assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs)); + } + } //function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { // return { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 122d9459e75..3ccb7b2ffa0 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -41,10 +41,6 @@ namespace ts.projectSystem { } } - function checkProjectRootFiles(project: server.Project, expectedFiles: ReadonlyArray) { - checkArray(`${server.ProjectKind[project.projectKind]} project, rootFileNames`, project.getRootFiles(), expectedFiles); - } - function getNodeModuleDirectories(dir: string) { return getRootsToWatchWithAncestorDirectory(dir, nodeModules); } @@ -134,18 +130,6 @@ namespace ts.projectSystem { verifyDiagnostics(actual, []); } - function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { - checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); - } - - function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}, relatedInformation?: protocol.DiagnosticRelatedInformation[]): protocol.Diagnostic { - return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, relatedInformation, source: undefined }; - } - - function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { - checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); - } - function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); } @@ -156,19 +140,6 @@ namespace ts.projectSystem { } } - function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { - const events = session.events; - assert.deepEqual(events[index], expectedEvent, `Expected ${JSON.stringify(expectedEvent)} at ${index} in ${JSON.stringify(events)}`); - - const outputs = session.host.getOutput(); - assert.equal(outputs[index], server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, session.host.newLine)); - - if (isMostRecent) { - assert.strictEqual(events.length, index + 1, JSON.stringify(events)); - assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs)); - } - } - describe("tsserverProjectSystem general functionality", () => { const commonFile1: File = { path: "/a/b/commonFile1.ts", @@ -3377,287 +3348,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem Proper errors", () => { - function createErrorLogger() { - let hasError = false; - const errorLogger: server.Logger = { - close: noop, - hasLevel: () => true, - loggingEnabled: () => true, - perftrc: noop, - info: noop, - msg: (_s, type) => { - if (type === server.Msg.Err) { - hasError = true; - } - }, - startGroup: noop, - endGroup: noop, - getLogFileName: () => undefined - }; - return { - errorLogger, - hasError: () => hasError - }; - } - - it("document is not contained in project", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const corruptedConfig = { - path: "/a/b/tsconfig.json", - content: "{" - }; - const host = createServerHost([file1, corruptedConfig]); - const projectService = createProjectService(host); - - projectService.openClientFile(file1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - - const project = projectService.findProject(corruptedConfig.path)!; - checkProjectRootFiles(project, [file1.path]); - }); - - describe("when opening new file that doesnt exist on disk yet", () => { - function verifyNonExistentFile(useProjectRoot: boolean) { - const folderPath = "/user/someuser/projects/someFolder"; - const fileInRoot: File = { - path: `/src/somefile.d.ts`, - content: "class c { }" - }; - const fileInProjectRoot: File = { - path: `${folderPath}/src/somefile.d.ts`, - content: "class c { }" - }; - const host = createServerHost([libFile, fileInRoot, fileInProjectRoot]); - const { hasError, errorLogger } = createErrorLogger(); - const session = createSession(host, { canUseEvents: true, logger: errorLogger, useInferredProjectPerProjectRoot: true }); - - const projectService = session.getProjectService(); - const untitledFile = "untitled:Untitled-1"; - const refPathNotFound1 = "../../../../../../typings/@epic/Core.d.ts"; - const refPathNotFound2 = "./src/somefile.d.ts"; - const fileContent = `/// -/// `; - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { - file: untitledFile, - fileContent, - scriptKindName: "TS", - projectRootPath: useProjectRoot ? folderPath : undefined - } - }); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const infoForUntitledAtProjectRoot = projectService.getScriptInfoForPath(`${folderPath.toLowerCase()}/${untitledFile.toLowerCase()}` as Path); - const infoForUnitiledAtRoot = projectService.getScriptInfoForPath(`/${untitledFile.toLowerCase()}` as Path); - const infoForSomefileAtProjectRoot = projectService.getScriptInfoForPath(`/${folderPath.toLowerCase()}/src/somefile.d.ts` as Path); - const infoForSomefileAtRoot = projectService.getScriptInfoForPath(`${fileInRoot.path.toLowerCase()}` as Path); - if (useProjectRoot) { - assert.isDefined(infoForUntitledAtProjectRoot); - assert.isUndefined(infoForUnitiledAtRoot); - } - else { - assert.isDefined(infoForUnitiledAtRoot); - assert.isUndefined(infoForUntitledAtProjectRoot); - } - assert.isUndefined(infoForSomefileAtRoot); - assert.isUndefined(infoForSomefileAtProjectRoot); - - // Since this is not js project so no typings are queued - host.checkTimeoutQueueLength(0); - - const newTimeoutId = host.getNextTimeoutId(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [untitledFile] - } - }); - host.checkTimeoutQueueLength(1); - - // Run the last one = get error request - host.runQueuedTimeoutCallbacks(newTimeoutId); - - assert.isFalse(hasError()); - host.checkTimeoutQueueLength(0); - checkErrorMessage(session, "syntaxDiag", { file: untitledFile, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - assert.isFalse(hasError()); - const errorOffset = fileContent.indexOf(refPathNotFound1) + 1; - checkErrorMessage(session, "semanticDiag", { - file: untitledFile, - diagnostics: [ - createDiagnostic({ line: 1, offset: errorOffset }, { line: 1, offset: errorOffset + refPathNotFound1.length }, Diagnostics.File_0_not_found, [refPathNotFound1], "error"), - createDiagnostic({ line: 2, offset: errorOffset }, { line: 2, offset: errorOffset + refPathNotFound2.length }, Diagnostics.File_0_not_found, [refPathNotFound2.substr(2)], "error") - ] - }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - assert.isFalse(hasError()); - checkErrorMessage(session, "suggestionDiag", { file: untitledFile, diagnostics: [] }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - } - - it("has projectRoot", () => { - verifyNonExistentFile(/*useProjectRoot*/ true); - }); - - it("does not have projectRoot", () => { - verifyNonExistentFile(/*useProjectRoot*/ false); - }); - }); - - it("folder rename updates project structure and reports no errors", () => { - const projectDir = "/a/b/projects/myproject"; - const app: File = { - path: `${projectDir}/bar/app.ts`, - content: "class Bar implements foo.Foo { getFoo() { return ''; } get2() { return 1; } }" - }; - const foo: File = { - path: `${projectDir}/foo/foo.ts`, - content: "declare namespace foo { interface Foo { get2(): number; getFoo(): string; } }" - }; - const configFile: File = { - path: `${projectDir}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { module: "none", targer: "es5" }, exclude: ["node_modules"] }) - }; - const host = createServerHost([app, foo, configFile]); - const session = createSession(host, { canUseEvents: true, }); - const projectService = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: app.path, } - }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.isDefined(projectService.configuredProjects.get(configFile.path)); - verifyErrorsInApp(); - - host.renameFolder(`${projectDir}/foo`, `${projectDir}/foo2`); - host.runQueuedTimeoutCallbacks(); - host.runQueuedTimeoutCallbacks(); - verifyErrorsInApp(); - - function verifyErrorsInApp() { - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [app.path] - } - }); - host.checkTimeoutQueueLengthAndRun(1); - checkErrorMessage(session, "syntaxDiag", { file: app.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - checkErrorMessage(session, "semanticDiag", { file: app.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - checkErrorMessage(session, "suggestionDiag", { file: app.path, diagnostics: [] }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - } - }); - - it("Getting errors before opening file", () => { - const file: File = { - path: "/a/b/project/file.ts", - content: "let x: number = false;" - }; - const host = createServerHost([file, libFile]); - const { hasError, errorLogger } = createErrorLogger(); - const session = createSession(host, { canUseEvents: true, logger: errorLogger }); - - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path] - } - }); - - host.runQueuedImmediateCallbacks(); - assert.isFalse(hasError()); - checkCompleteEvent(session, 1, expectedSequenceId); - session.clearMessages(); - }); - - it("Reports errors correctly when file referenced by inferred project root, is opened right after closing the root file", () => { - const projectRoot = "/user/username/projects/myproject"; - const app: File = { - path: `${projectRoot}/src/client/app.js`, - content: "" - }; - const serverUtilities: File = { - path: `${projectRoot}/src/server/utilities.js`, - content: `function getHostName() { return "hello"; } export { getHostName };` - }; - const backendTest: File = { - path: `${projectRoot}/test/backend/index.js`, - content: `import { getHostName } from '../../src/server/utilities';export default getHostName;` - }; - const files = [libFile, app, serverUtilities, backendTest]; - const host = createServerHost(files); - const session = createSession(host, { useInferredProjectPerProjectRoot: true, canUseEvents: true }); - openFilesForSession([{ file: app, projectRootPath: projectRoot }], session); - const service = session.getProjectService(); - checkNumberOfProjects(service, { inferredProjects: 1 }); - const project = service.inferredProjects[0]; - checkProjectActualFiles(project, [libFile.path, app.path]); - openFilesForSession([{ file: backendTest, projectRootPath: projectRoot }], session); - checkNumberOfProjects(service, { inferredProjects: 1 }); - checkProjectActualFiles(project, files.map(f => f.path)); - checkErrors([backendTest.path, app.path]); - closeFilesForSession([backendTest], session); - openFilesForSession([{ file: serverUtilities.path, projectRootPath: projectRoot }], session); - checkErrors([serverUtilities.path, app.path]); - - function checkErrors(openFiles: [string, string]) { - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: protocol.CommandTypes.Geterr, - arguments: { - delay: 0, - files: openFiles - } - }); - - for (const openFile of openFiles) { - session.clearMessages(); - host.checkTimeoutQueueLength(3); - host.runQueuedTimeoutCallbacks(host.getNextTimeoutId() - 1); - - checkErrorMessage(session, "syntaxDiag", { file: openFile, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - checkErrorMessage(session, "semanticDiag", { file: openFile, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - checkErrorMessage(session, "suggestionDiag", { file: openFile, diagnostics: [] }); - } - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - } - }); - }); - describe("tsserverProjectSystem autoDiscovery", () => { it("does not depend on extension", () => { const file1 = { From 37a080bca98d5ca724366c319b5f8503e27b652a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:25:19 -0800 Subject: [PATCH 228/322] tsserver's typingInstaller test into typingsInstaller unittest --- .../unittests/tsserverProjectSystem.ts | 78 ------------------- src/testRunner/unittests/typingsInstaller.ts | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 3ccb7b2ffa0..69de01cf969 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -7329,84 +7329,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem typingsInstaller on inferred Project", () => { - it("when projectRootPath is provided", () => { - const projects = "/users/username/projects"; - const projectRootPath = `${projects}/san2`; - const file: File = { - path: `${projectRootPath}/x.js`, - content: "const aaaaaaav = 1;" - }; - - const currentDirectory = `${projects}/anotherProject`; - const packageJsonInCurrentDirectory: File = { - path: `${currentDirectory}/package.json`, - content: JSON.stringify({ - devDependencies: { - pkgcurrentdirectory: "" - }, - }) - }; - const packageJsonOfPkgcurrentdirectory: File = { - path: `${currentDirectory}/node_modules/pkgcurrentdirectory/package.json`, - content: JSON.stringify({ - name: "pkgcurrentdirectory", - main: "index.js", - typings: "index.d.ts" - }) - }; - const indexOfPkgcurrentdirectory: File = { - path: `${currentDirectory}/node_modules/pkgcurrentdirectory/index.d.ts`, - content: "export function foo() { }" - }; - - const typingsCache = `/users/username/Library/Caches/typescript/2.7`; - const typingsCachePackageJson: File = { - path: `${typingsCache}/package.json`, - content: JSON.stringify({ - devDependencies: { - }, - }) - }; - const typingsCachePackageLockJson: File = { - path: `${typingsCache}/package-lock.json`, - content: JSON.stringify({ - dependencies: { - }, - }) - }; - - const files = [file, packageJsonInCurrentDirectory, packageJsonOfPkgcurrentdirectory, indexOfPkgcurrentdirectory, typingsCachePackageJson, typingsCachePackageLockJson]; - const host = createServerHost(files, { currentDirectory }); - - const typesRegistry = createTypesRegistry("pkgcurrentdirectory"); - const typingsInstaller = new TestTypingsInstaller(typingsCache, /*throttleLimit*/ 5, host, typesRegistry); - - const projectService = createProjectService(host, { typingsInstaller }); - - projectService.setCompilerOptionsForInferredProjects({ - module: ModuleKind.CommonJS, - target: ScriptTarget.ES2016, - jsx: JsxEmit.Preserve, - experimentalDecorators: true, - allowJs: true, - allowSyntheticDefaultImports: true, - allowNonTsExtensions: true - }); - - projectService.openClientFile(file.path, file.content, ScriptKind.JS, projectRootPath); - - const project = projectService.inferredProjects[0]; - assert.isDefined(project); - - // Ensure that we use result from types cache when getting ls - assert.isDefined(project.getLanguageService()); - - // Verify that the pkgcurrentdirectory from the current directory isnt picked up - checkProjectActualFiles(project, [file.path]); - }); - }); - describe("tsserverProjectSystem with symLinks", () => { it("rename in common file renames all project", () => { const projects = "/users/username/projects"; diff --git a/src/testRunner/unittests/typingsInstaller.ts b/src/testRunner/unittests/typingsInstaller.ts index 2b18af6a71f..f0cd9549e6c 100644 --- a/src/testRunner/unittests/typingsInstaller.ts +++ b/src/testRunner/unittests/typingsInstaller.ts @@ -1774,4 +1774,82 @@ namespace ts.projectSystem { `, ["foo"], [fooAA, fooAB, fooAC]); }); }); + + describe("typingsInstaller:: tsserver:: with inferred Project", () => { + it("when projectRootPath is provided", () => { + const projects = "/users/username/projects"; + const projectRootPath = `${projects}/san2`; + const file: File = { + path: `${projectRootPath}/x.js`, + content: "const aaaaaaav = 1;" + }; + + const currentDirectory = `${projects}/anotherProject`; + const packageJsonInCurrentDirectory: File = { + path: `${currentDirectory}/package.json`, + content: JSON.stringify({ + devDependencies: { + pkgcurrentdirectory: "" + }, + }) + }; + const packageJsonOfPkgcurrentdirectory: File = { + path: `${currentDirectory}/node_modules/pkgcurrentdirectory/package.json`, + content: JSON.stringify({ + name: "pkgcurrentdirectory", + main: "index.js", + typings: "index.d.ts" + }) + }; + const indexOfPkgcurrentdirectory: File = { + path: `${currentDirectory}/node_modules/pkgcurrentdirectory/index.d.ts`, + content: "export function foo() { }" + }; + + const typingsCache = `/users/username/Library/Caches/typescript/2.7`; + const typingsCachePackageJson: File = { + path: `${typingsCache}/package.json`, + content: JSON.stringify({ + devDependencies: { + }, + }) + }; + const typingsCachePackageLockJson: File = { + path: `${typingsCache}/package-lock.json`, + content: JSON.stringify({ + dependencies: { + }, + }) + }; + + const files = [file, packageJsonInCurrentDirectory, packageJsonOfPkgcurrentdirectory, indexOfPkgcurrentdirectory, typingsCachePackageJson, typingsCachePackageLockJson]; + const host = createServerHost(files, { currentDirectory }); + + const typesRegistry = createTypesRegistry("pkgcurrentdirectory"); + const typingsInstaller = new TestTypingsInstaller(typingsCache, /*throttleLimit*/ 5, host, typesRegistry); + + const projectService = createProjectService(host, { typingsInstaller }); + + projectService.setCompilerOptionsForInferredProjects({ + module: ModuleKind.CommonJS, + target: ScriptTarget.ES2016, + jsx: JsxEmit.Preserve, + experimentalDecorators: true, + allowJs: true, + allowSyntheticDefaultImports: true, + allowNonTsExtensions: true + }); + + projectService.openClientFile(file.path, file.content, ScriptKind.JS, projectRootPath); + + const project = projectService.inferredProjects[0]; + assert.isDefined(project); + + // Ensure that we use result from types cache when getting ls + assert.isDefined(project.getLanguageService()); + + // Verify that the pkgcurrentdirectory from the current directory isnt picked up + checkProjectActualFiles(project, [file.path]); + }); + }); } From 03d66dd2ef066b29e43c6ebce0cdf733e37cc5d4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:27:23 -0800 Subject: [PATCH 229/322] Emit error tsserver tests into projectErrors --- src/testRunner/unittests/projectErrors.ts | 83 +++++++++++++++++++ .../unittests/tsserverProjectSystem.ts | 83 ------------------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/projectErrors.ts index 6eb364b569d..15bbab2a551 100644 --- a/src/testRunner/unittests/projectErrors.ts +++ b/src/testRunner/unittests/projectErrors.ts @@ -480,4 +480,87 @@ namespace ts.projectSystem { } }); }); + + describe("tsserver:: Project Errors dont include overwrite emit error", () => { + it("for inferred project", () => { + const f1 = { + path: "/a/b/f1.js", + content: "function test1() { }" + }; + const host = createServerHost([f1, libFile]); + const session = createSession(host); + openFilesForSession([f1], session); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const projectName = projectService.inferredProjects[0].getProjectName(); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 2, + arguments: { projectFileName: projectName } + }).response as ReadonlyArray; + assert.isTrue(diags.length === 0); + + session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsForInferredProjects, + seq: 3, + arguments: { options: { module: ModuleKind.CommonJS } } + }); + const diagsAfterUpdate = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 4, + arguments: { projectFileName: projectName } + }).response as ReadonlyArray; + assert.isTrue(diagsAfterUpdate.length === 0); + }); + + it("for external project", () => { + const f1 = { + path: "/a/b/f1.js", + content: "function test1() { }" + }; + const host = createServerHost([f1, libFile]); + const session = createSession(host); + const projectService = session.getProjectService(); + const projectFileName = "/a/b/project.csproj"; + const externalFiles = toExternalFiles([f1.path]); + projectService.openExternalProject({ + projectFileName, + rootFiles: externalFiles, + options: {} + }); + + checkNumberOfProjects(projectService, { externalProjects: 1 }); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 2, + arguments: { projectFileName } + }).response as ReadonlyArray; + assert.isTrue(diags.length === 0); + + session.executeCommand({ + type: "request", + command: server.CommandNames.OpenExternalProject, + seq: 3, + arguments: { + projectFileName, + rootFiles: externalFiles, + options: { module: ModuleKind.CommonJS } + } + }); + const diagsAfterUpdate = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 4, + arguments: { projectFileName } + }).response as ReadonlyArray; + assert.isTrue(diagsAfterUpdate.length === 0); + }); + }); } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 69de01cf969..214ddabdb85 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -5214,89 +5214,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem No overwrite emit error", () => { - it("for inferred project", () => { - const f1 = { - path: "/a/b/f1.js", - content: "function test1() { }" - }; - const host = createServerHost([f1, libFile]); - const session = createSession(host); - openFilesForSession([f1], session); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const projectName = projectService.inferredProjects[0].getProjectName(); - - const diags = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName: projectName } - }).response as ReadonlyArray; - assert.isTrue(diags.length === 0); - - session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsForInferredProjects, - seq: 3, - arguments: { options: { module: ModuleKind.CommonJS } } - }); - const diagsAfterUpdate = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 4, - arguments: { projectFileName: projectName } - }).response as ReadonlyArray; - assert.isTrue(diagsAfterUpdate.length === 0); - }); - - it("for external project", () => { - const f1 = { - path: "/a/b/f1.js", - content: "function test1() { }" - }; - const host = createServerHost([f1, libFile]); - const session = createSession(host); - const projectService = session.getProjectService(); - const projectFileName = "/a/b/project.csproj"; - const externalFiles = toExternalFiles([f1.path]); - projectService.openExternalProject({ - projectFileName, - rootFiles: externalFiles, - options: {} - }); - - checkNumberOfProjects(projectService, { externalProjects: 1 }); - - const diags = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName } - }).response as ReadonlyArray; - assert.isTrue(diags.length === 0); - - session.executeCommand({ - type: "request", - command: server.CommandNames.OpenExternalProject, - seq: 3, - arguments: { - projectFileName, - rootFiles: externalFiles, - options: { module: ModuleKind.CommonJS } - } - }); - const diagsAfterUpdate = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 4, - arguments: { projectFileName } - }).response as ReadonlyArray; - assert.isTrue(diagsAfterUpdate.length === 0); - }); - }); - describe("tsserverProjectSystem import helpers", () => { it("should not crash in tsserver", () => { const f1 = { From 39ec69e26e972757a626f61ac2fce156f7b6e4fa Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:34:16 -0800 Subject: [PATCH 230/322] Separate out tests for project loading events into their own unittest file --- src/testRunner/tsconfig.json | 1 + src/testRunner/unittests/tsserverHelpers.ts | 140 ++++----- .../unittests/tsserverProjectLoadingEvents.ts | 193 +++++++++++++ .../unittests/tsserverProjectSystem.ts | 268 ------------------ 4 files changed, 266 insertions(+), 336 deletions(-) create mode 100644 src/testRunner/unittests/tsserverProjectLoadingEvents.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index a95bc106fb1..3b8308af890 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -88,6 +88,7 @@ "unittests/tsconfigParsing.ts", "unittests/tscWatchEmit.ts", "unittests/tscWatchMode.ts", + "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", "unittests/typingsInstaller.ts", "unittests/versionCache.ts", diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts index f5113b768fc..18e6f5c6194 100644 --- a/src/testRunner/unittests/tsserverHelpers.ts +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -15,13 +15,13 @@ namespace ts.projectSystem { export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; - //const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; - //function mapOutputToJson(s: string) { - // return convertToObject( - // parseJsonText("json.json", s.replace(outputEventRegex, "")), - // [] - // ); - //} + const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; + export function mapOutputToJson(s: string) { + return convertToObject( + parseJsonText("json.json", s.replace(outputEventRegex, "")), + [] + ); + } export const customTypesMap = { path: "/typesMap.json", @@ -330,39 +330,39 @@ namespace ts.projectSystem { return new TestSession({ ...sessionOptions, ...opts }); } - //function createSessionWithEventTracking(host: server.ServerHost, eventName: T["eventName"], ...eventNames: T["eventName"][]) { - // const events: T[] = []; - // const session = createSession(host, { - // eventHandler: e => { - // if (e.eventName === eventName || eventNames.some(eventName => e.eventName === eventName)) { - // events.push(e as T); - // } - // } - // }); + export function createSessionWithEventTracking(host: server.ServerHost, eventName: T["eventName"], ...eventNames: T["eventName"][]) { + const events: T[] = []; + const session = createSession(host, { + eventHandler: e => { + if (e.eventName === eventName || eventNames.some(eventName => e.eventName === eventName)) { + events.push(e as T); + } + } + }); - // return { session, events }; - //} + return { session, events }; + } - //function createSessionWithDefaultEventHandler(host: TestServerHost, eventNames: T["event"] | T["event"][], opts: Partial = {}) { - // const session = createSession(host, { canUseEvents: true, ...opts }); + export function createSessionWithDefaultEventHandler(host: TestServerHost, eventNames: T["event"] | T["event"][], opts: Partial = {}) { + const session = createSession(host, { canUseEvents: true, ...opts }); - // return { - // session, - // getEvents, - // clearEvents - // }; + return { + session, + getEvents, + clearEvents + }; - // function getEvents() { - // return mapDefined(host.getOutput(), s => { - // const e = mapOutputToJson(s); - // return (isArray(eventNames) ? eventNames.some(eventName => e.event === eventName) : e.event === eventNames) ? e as T : undefined; - // }); - // } + function getEvents() { + return mapDefined(host.getOutput(), s => { + const e = mapOutputToJson(s); + return (isArray(eventNames) ? eventNames.some(eventName => e.event === eventName) : e.event === eventNames) ? e as T : undefined; + }); + } - // function clearEvents() { - // session.clearMessages(); - // } - //} + function clearEvents() { + session.clearMessages(); + } + } export interface CreateProjectServiceParameters { cancellationToken?: HostCancellationToken; @@ -467,23 +467,25 @@ namespace ts.projectSystem { // checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); //} - //function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { - // const start = str.indexOf(substring); - // Debug.assert(start !== -1); - // return protocolToLocation(str)(start); - //} - //function protocolToLocation(text: string): (pos: number) => protocol.Location { - // const lineStarts = computeLineStarts(text); - // return pos => { - // const x = computeLineAndCharacterOfPosition(lineStarts, pos); - // return { line: x.line + 1, offset: x.character + 1 }; - // }; - //} - //function protocolTextSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): protocol.TextSpan { - // const span = textSpanFromSubstring(str, substring, options); - // const toLocation = protocolToLocation(str); - // return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; - //} + export function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { + const start = str.indexOf(substring); + Debug.assert(start !== -1); + return protocolToLocation(str)(start); + } + + function protocolToLocation(text: string): (pos: number) => protocol.Location { + const lineStarts = computeLineStarts(text); + return pos => { + const x = computeLineAndCharacterOfPosition(lineStarts, pos); + return { line: x.line + 1, offset: x.character + 1 }; + }; + } + + export function protocolTextSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): protocol.TextSpan { + const span = textSpanFromSubstring(str, substring, options); + const toLocation = protocolToLocation(str); + return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; + } //function protocolRenameSpanFromSubstring( // str: string, // substring: string, @@ -492,11 +494,12 @@ namespace ts.projectSystem { //): protocol.RenameTextSpan { // return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; //} - //function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { - // const start = nthIndexOf(str, substring, options ? options.index : 0); - // Debug.assert(start !== -1); - // return createTextSpan(start, substring.length); - //} + + export function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { + const start = nthIndexOf(str, substring, options ? options.index : 0); + Debug.assert(start !== -1); + return createTextSpan(start, substring.length); + } //function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { // return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; //} @@ -509,18 +512,19 @@ namespace ts.projectSystem { //function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { // return documentSpanFromSubstring(file, substring, options); //} - //interface SpanFromSubstringOptions { - // readonly index: number; - //} - //function nthIndexOf(str: string, substr: string, n: number): number { - // let index = -1; - // for (; n >= 0; n--) { - // index = str.indexOf(substr, index + 1); - // if (index === -1) return -1; - // } - // return index; - //} + export interface SpanFromSubstringOptions { + readonly index: number; + } + + function nthIndexOf(str: string, substr: string, n: number): number { + let index = -1; + for (; n >= 0; n--) { + index = str.indexOf(substr, index + 1); + if (index === -1) return -1; + } + return index; + } /** * Test server cancellation token used to mock host token cancellation requests. diff --git a/src/testRunner/unittests/tsserverProjectLoadingEvents.ts b/src/testRunner/unittests/tsserverProjectLoadingEvents.ts new file mode 100644 index 00000000000..0ff256bd692 --- /dev/null +++ b/src/testRunner/unittests/tsserverProjectLoadingEvents.ts @@ -0,0 +1,193 @@ +namespace ts.projectSystem { + describe("tsserverProjectLoadingEvents:: ProjectLoadingStart and ProjectLoadingFinish events", () => { + const projectRoot = "/user/username/projects"; + const aTs: File = { + path: `${projectRoot}/a/a.ts`, + content: "export class A { }" + }; + const configA: File = { + path: `${projectRoot}/a/tsconfig.json`, + content: "{}" + }; + const bTsPath = `${projectRoot}/b/b.ts`; + const configBPath = `${projectRoot}/b/tsconfig.json`; + const files = [libFile, aTs, configA]; + + function verifyProjectLoadingStartAndFinish(createSession: (host: TestServerHost) => { + session: TestSession; + getNumberOfEvents: () => number; + clearEvents: () => void; + verifyProjectLoadEvents: (expected: [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]) => void; + }) { + function createSessionToVerifyEvent(files: ReadonlyArray) { + const host = createServerHost(files); + const originalReadFile = host.readFile; + const { session, getNumberOfEvents, clearEvents, verifyProjectLoadEvents } = createSession(host); + host.readFile = file => { + if (file === configA.path || file === configBPath) { + assert.equal(getNumberOfEvents(), 1, "Event for loading is sent before reading config file"); + } + return originalReadFile.call(host, file); + }; + const service = session.getProjectService(); + return { host, session, verifyEvent, verifyEventWithOpenTs, service, getNumberOfEvents }; + + function verifyEvent(project: server.Project, reason: string) { + verifyProjectLoadEvents([ + { eventName: server.ProjectLoadingStartEvent, data: { project, reason } }, + { eventName: server.ProjectLoadingFinishEvent, data: { project } } + ]); + clearEvents(); + } + + function verifyEventWithOpenTs(file: File, configPath: string, configuredProjects: number) { + openFilesForSession([file], session); + checkNumberOfProjects(service, { configuredProjects }); + const project = service.configuredProjects.get(configPath)!; + assert.isDefined(project); + verifyEvent(project, `Creating possible configured project for ${file.path} to open`); + } + } + + it("when project is created by open file", () => { + const bTs: File = { + path: bTsPath, + content: "export class B {}" + }; + const configB: File = { + path: configBPath, + content: "{}" + }; + const { verifyEventWithOpenTs } = createSessionToVerifyEvent(files.concat(bTs, configB)); + verifyEventWithOpenTs(aTs, configA.path, 1); + verifyEventWithOpenTs(bTs, configB.path, 2); + }); + + it("when change is detected in the config file", () => { + const { host, verifyEvent, verifyEventWithOpenTs, service } = createSessionToVerifyEvent(files); + verifyEventWithOpenTs(aTs, configA.path, 1); + + host.writeFile(configA.path, configA.content); + host.checkTimeoutQueueLengthAndRun(2); + const project = service.configuredProjects.get(configA.path)!; + verifyEvent(project, `Change in config file detected`); + }); + + it("when opening original location project", () => { + const aDTs: File = { + path: `${projectRoot}/a/a.d.ts`, + content: `export declare class A { +} +//# sourceMappingURL=a.d.ts.map +` + }; + const aDTsMap: File = { + path: `${projectRoot}/a/a.d.ts.map`, + content: `{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"}` + }; + const bTs: File = { + path: bTsPath, + content: `import {A} from "../a/a"; new A();` + }; + const configB: File = { + path: configBPath, + content: JSON.stringify({ + references: [{ path: "../a" }] + }) + }; + + const { service, session, verifyEventWithOpenTs, verifyEvent } = createSessionToVerifyEvent(files.concat(aDTs, aDTsMap, bTs, configB)); + verifyEventWithOpenTs(bTs, configB.path, 1); + + session.executeCommandSeq({ + command: protocol.CommandTypes.References, + arguments: { + file: bTs.path, + ...protocolLocationFromSubstring(bTs.content, "A()") + } + }); + + checkNumberOfProjects(service, { configuredProjects: 2 }); + const project = service.configuredProjects.get(configA.path)!; + assert.isDefined(project); + verifyEvent(project, `Creating project for original file: ${aTs.path} for location: ${aDTs.path}`); + }); + + describe("with external projects and config files ", () => { + const projectFileName = `${projectRoot}/a/project.csproj`; + + function createSession(lazyConfiguredProjectsFromExternalProject: boolean) { + const { session, service, verifyEvent: verifyEventWorker, getNumberOfEvents } = createSessionToVerifyEvent(files); + service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([aTs.path, configA.path]), + options: {} + }); + checkNumberOfProjects(service, { configuredProjects: 1 }); + return { session, service, verifyEvent, getNumberOfEvents }; + + function verifyEvent() { + const projectA = service.configuredProjects.get(configA.path)!; + assert.isDefined(projectA); + verifyEventWorker(projectA, `Creating configured project in external project: ${projectFileName}`); + } + } + + it("when lazyConfiguredProjectsFromExternalProject is false", () => { + const { verifyEvent } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ false); + verifyEvent(); + }); + + it("when lazyConfiguredProjectsFromExternalProject is true and file is opened", () => { + const { verifyEvent, getNumberOfEvents, session } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); + assert.equal(getNumberOfEvents(), 0); + + openFilesForSession([aTs], session); + verifyEvent(); + }); + + it("when lazyConfiguredProjectsFromExternalProject is disabled", () => { + const { verifyEvent, getNumberOfEvents, service } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); + assert.equal(getNumberOfEvents(), 0); + + service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: false } }); + verifyEvent(); + }); + }); + } + + describe("when using event handler", () => { + verifyProjectLoadingStartAndFinish(host => { + const { session, events } = createSessionWithEventTracking(host, server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent); + return { + session, + getNumberOfEvents: () => events.length, + clearEvents: () => events.length = 0, + verifyProjectLoadEvents: expected => assert.deepEqual(events, expected) + }; + }); + }); + + describe("when using default event handler", () => { + verifyProjectLoadingStartAndFinish(host => { + const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler(host, [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]); + return { + session, + getNumberOfEvents: () => getEvents().length, + clearEvents, + verifyProjectLoadEvents + }; + + function verifyProjectLoadEvents(expected: [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]) { + const actual = getEvents().map(e => ({ eventName: e.event, data: e.body })); + const mappedExpected = expected.map(e => { + const { project, ...rest } = e.data; + return { eventName: e.eventName, data: { projectName: project.getProjectName(), ...rest } }; + }); + assert.deepEqual(actual, mappedExpected); + } + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 214ddabdb85..74522bcca8d 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -1,46 +1,4 @@ namespace ts.projectSystem { - const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; - function mapOutputToJson(s: string) { - return convertToObject( - parseJsonText("json.json", s.replace(outputEventRegex, "")), - [] - ); - } - - function createSessionWithEventTracking(host: server.ServerHost, eventName: T["eventName"], ...eventNames: T["eventName"][]) { - const events: T[] = []; - const session = createSession(host, { - eventHandler: e => { - if (e.eventName === eventName || eventNames.some(eventName => e.eventName === eventName)) { - events.push(e as T); - } - } - }); - - return { session, events }; - } - - function createSessionWithDefaultEventHandler(host: TestServerHost, eventNames: T["event"] | T["event"][], opts: Partial = {}) { - const session = createSession(host, { canUseEvents: true, ...opts }); - - return { - session, - getEvents, - clearEvents - }; - - function getEvents() { - return mapDefined(host.getOutput(), s => { - const e = mapOutputToJson(s); - return (isArray(eventNames) ? eventNames.some(eventName => e.event === eventName) : e.event === eventNames) ? e as T : undefined; - }); - } - - function clearEvents() { - session.clearMessages(); - } - } - function getNodeModuleDirectories(dir: string) { return getRootsToWatchWithAncestorDirectory(dir, nodeModules); } @@ -57,23 +15,6 @@ namespace ts.projectSystem { checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles); } - function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { - const start = str.indexOf(substring); - Debug.assert(start !== -1); - return protocolToLocation(str)(start); - } - function protocolToLocation(text: string): (pos: number) => protocol.Location { - const lineStarts = computeLineStarts(text); - return pos => { - const x = computeLineAndCharacterOfPosition(lineStarts, pos); - return { line: x.line + 1, offset: x.character + 1 }; - }; - } - function protocolTextSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): protocol.TextSpan { - const span = textSpanFromSubstring(str, substring, options); - const toLocation = protocolToLocation(str); - return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; - } function protocolRenameSpanFromSubstring( str: string, substring: string, @@ -82,11 +23,6 @@ namespace ts.projectSystem { ): protocol.RenameTextSpan { return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; } - function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { - const start = nthIndexOf(str, substring, options ? options.index : 0); - Debug.assert(start !== -1); - return createTextSpan(start, substring.length); - } function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; } @@ -99,18 +35,6 @@ namespace ts.projectSystem { function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { return documentSpanFromSubstring(file, substring, options); } - interface SpanFromSubstringOptions { - readonly index: number; - } - - function nthIndexOf(str: string, substr: string, n: number): number { - let index = -1; - for (; n >= 0; n--) { - index = str.indexOf(substr, index + 1); - if (index === -1) return -1; - } - return index; - } interface ErrorInformation { diagnosticMessage: DiagnosticMessage; @@ -7843,198 +7767,6 @@ new C();` }); }); - describe("tsserverProjectSystem ProjectLoadingStart and ProjectLoadingFinish events", () => { - const projectRoot = "/user/username/projects"; - const aTs: File = { - path: `${projectRoot}/a/a.ts`, - content: "export class A { }" - }; - const configA: File = { - path: `${projectRoot}/a/tsconfig.json`, - content: "{}" - }; - const bTsPath = `${projectRoot}/b/b.ts`; - const configBPath = `${projectRoot}/b/tsconfig.json`; - const files = [libFile, aTs, configA]; - - function verifyProjectLoadingStartAndFinish(createSession: (host: TestServerHost) => { - session: TestSession; - getNumberOfEvents: () => number; - clearEvents: () => void; - verifyProjectLoadEvents: (expected: [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]) => void; - }) { - function createSessionToVerifyEvent(files: ReadonlyArray) { - const host = createServerHost(files); - const originalReadFile = host.readFile; - const { session, getNumberOfEvents, clearEvents, verifyProjectLoadEvents } = createSession(host); - host.readFile = file => { - if (file === configA.path || file === configBPath) { - assert.equal(getNumberOfEvents(), 1, "Event for loading is sent before reading config file"); - } - return originalReadFile.call(host, file); - }; - const service = session.getProjectService(); - return { host, session, verifyEvent, verifyEventWithOpenTs, service, getNumberOfEvents }; - - function verifyEvent(project: server.Project, reason: string) { - verifyProjectLoadEvents([ - { eventName: server.ProjectLoadingStartEvent, data: { project, reason } }, - { eventName: server.ProjectLoadingFinishEvent, data: { project } } - ]); - clearEvents(); - } - - function verifyEventWithOpenTs(file: File, configPath: string, configuredProjects: number) { - openFilesForSession([file], session); - checkNumberOfProjects(service, { configuredProjects }); - const project = service.configuredProjects.get(configPath)!; - assert.isDefined(project); - verifyEvent(project, `Creating possible configured project for ${file.path} to open`); - } - } - - it("when project is created by open file", () => { - const bTs: File = { - path: bTsPath, - content: "export class B {}" - }; - const configB: File = { - path: configBPath, - content: "{}" - }; - const { verifyEventWithOpenTs } = createSessionToVerifyEvent(files.concat(bTs, configB)); - verifyEventWithOpenTs(aTs, configA.path, 1); - verifyEventWithOpenTs(bTs, configB.path, 2); - }); - - it("when change is detected in the config file", () => { - const { host, verifyEvent, verifyEventWithOpenTs, service } = createSessionToVerifyEvent(files); - verifyEventWithOpenTs(aTs, configA.path, 1); - - host.writeFile(configA.path, configA.content); - host.checkTimeoutQueueLengthAndRun(2); - const project = service.configuredProjects.get(configA.path)!; - verifyEvent(project, `Change in config file detected`); - }); - - it("when opening original location project", () => { - const aDTs: File = { - path: `${projectRoot}/a/a.d.ts`, - content: `export declare class A { -} -//# sourceMappingURL=a.d.ts.map -` - }; - const aDTsMap: File = { - path: `${projectRoot}/a/a.d.ts.map`, - content: `{"version":3,"file":"a.d.ts","sourceRoot":"","sources":["./a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;CAAI"}` - }; - const bTs: File = { - path: bTsPath, - content: `import {A} from "../a/a"; new A();` - }; - const configB: File = { - path: configBPath, - content: JSON.stringify({ - references: [{ path: "../a" }] - }) - }; - - const { service, session, verifyEventWithOpenTs, verifyEvent } = createSessionToVerifyEvent(files.concat(aDTs, aDTsMap, bTs, configB)); - verifyEventWithOpenTs(bTs, configB.path, 1); - - session.executeCommandSeq({ - command: protocol.CommandTypes.References, - arguments: { - file: bTs.path, - ...protocolLocationFromSubstring(bTs.content, "A()") - } - }); - - checkNumberOfProjects(service, { configuredProjects: 2 }); - const project = service.configuredProjects.get(configA.path)!; - assert.isDefined(project); - verifyEvent(project, `Creating project for original file: ${aTs.path} for location: ${aDTs.path}`); - }); - - describe("with external projects and config files ", () => { - const projectFileName = `${projectRoot}/a/project.csproj`; - - function createSession(lazyConfiguredProjectsFromExternalProject: boolean) { - const { session, service, verifyEvent: verifyEventWorker, getNumberOfEvents } = createSessionToVerifyEvent(files); - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); - service.openExternalProject({ - projectFileName, - rootFiles: toExternalFiles([aTs.path, configA.path]), - options: {} - }); - checkNumberOfProjects(service, { configuredProjects: 1 }); - return { session, service, verifyEvent, getNumberOfEvents }; - - function verifyEvent() { - const projectA = service.configuredProjects.get(configA.path)!; - assert.isDefined(projectA); - verifyEventWorker(projectA, `Creating configured project in external project: ${projectFileName}`); - } - } - - it("when lazyConfiguredProjectsFromExternalProject is false", () => { - const { verifyEvent } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ false); - verifyEvent(); - }); - - it("when lazyConfiguredProjectsFromExternalProject is true and file is opened", () => { - const { verifyEvent, getNumberOfEvents, session } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); - assert.equal(getNumberOfEvents(), 0); - - openFilesForSession([aTs], session); - verifyEvent(); - }); - - it("when lazyConfiguredProjectsFromExternalProject is disabled", () => { - const { verifyEvent, getNumberOfEvents, service } = createSession(/*lazyConfiguredProjectsFromExternalProject*/ true); - assert.equal(getNumberOfEvents(), 0); - - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: false } }); - verifyEvent(); - }); - }); - } - - describe("when using event handler", () => { - verifyProjectLoadingStartAndFinish(host => { - const { session, events } = createSessionWithEventTracking(host, server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent); - return { - session, - getNumberOfEvents: () => events.length, - clearEvents: () => events.length = 0, - verifyProjectLoadEvents: expected => assert.deepEqual(events, expected) - }; - }); - }); - - describe("when using default event handler", () => { - verifyProjectLoadingStartAndFinish(host => { - const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler(host, [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]); - return { - session, - getNumberOfEvents: () => getEvents().length, - clearEvents, - verifyProjectLoadEvents - }; - - function verifyProjectLoadEvents(expected: [server.ProjectLoadingStartEvent, server.ProjectLoadingFinishEvent]) { - const actual = getEvents().map(e => ({ eventName: e.event, data: e.body })); - const mappedExpected = expected.map(e => { - const { project, ...rest } = e.data; - return { eventName: e.eventName, data: { projectName: project.getProjectName(), ...rest } }; - }); - assert.deepEqual(actual, mappedExpected); - } - }); - }); - }); - describe("tsserverProjectSystem syntax operations", () => { function navBarFull(session: TestSession, file: File) { return JSON.stringify(session.executeCommandSeq({ From 04e190abb7a5bd899c32116c3b383334a26609b3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:43:07 -0800 Subject: [PATCH 231/322] ProjectUpdatedInBackground in a separate unittest --- src/testRunner/tsconfig.json | 1 + .../unittests/tsserverProjectSystem.ts | 590 ----------------- ...tsserverProjectUpdatedInBackgroundEvent.ts | 591 ++++++++++++++++++ 3 files changed, 592 insertions(+), 590 deletions(-) create mode 100644 src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 3b8308af890..6c18df789f6 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -90,6 +90,7 @@ "unittests/tscWatchMode.ts", "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", + "unittests/tsserverProjectUpdatedInBackgroundEvent.ts", "unittests/typingsInstaller.ts", "unittests/versionCache.ts", "unittests/watchEnvironment.ts", diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 74522bcca8d..c098eede598 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -6580,596 +6580,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem ProjectsChangedInBackground", () => { - function verifyFiles(caption: string, actual: ReadonlyArray, expected: ReadonlyArray) { - assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`); - const seen = createMap(); - forEach(actual, f => { - assert.isFalse(seen.has(f), `${caption}: Found duplicate ${f}. Actual: ${actual} Expected: ${expected}`); - seen.set(f, true); - assert.isTrue(contains(expected, f), `${caption}: Expected not to contain ${f}. Actual: ${actual} Expected: ${expected}`); - }); - } - - function createVerifyInitialOpen(session: TestSession, verifyProjectsUpdatedInBackgroundEventHandler: (events: server.ProjectsUpdatedInBackgroundEvent[]) => void) { - return (file: File) => { - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { - file: file.path - } - }); - verifyProjectsUpdatedInBackgroundEventHandler([]); - }; - } - - interface ProjectsUpdatedInBackgroundEventVerifier { - session: TestSession; - verifyProjectsUpdatedInBackgroundEventHandler(events: server.ProjectsUpdatedInBackgroundEvent[]): void; - verifyInitialOpen(file: File): void; - } - - function verifyProjectsUpdatedInBackgroundEvent(createSession: (host: TestServerHost) => ProjectsUpdatedInBackgroundEventVerifier) { - it("when adding new file", () => { - const commonFile1: File = { - path: "/a/b/file1.ts", - content: "export var x = 10;" - }; - const commonFile2: File = { - path: "/a/b/file2.ts", - content: "export var y = 10;" - }; - const commonFile3: File = { - path: "/a/b/file3.ts", - content: "export var z = 10;" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const openFiles = [commonFile1.path]; - const host = createServerHost([commonFile1, libFile, configFile]); - const { verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); - verifyInitialOpen(commonFile1); - - host.reloadFS([commonFile1, libFile, configFile, commonFile2]); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - - host.reloadFS([commonFile1, commonFile2, libFile, configFile, commonFile3]); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - }); - - describe("with --out or --outFile setting", () => { - function verifyEventWithOutSettings(compilerOptions: CompilerOptions = {}) { - const config: File = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions - }) - }; - - const f1: File = { - path: "/a/a.ts", - content: "export let x = 1" - }; - const f2: File = { - path: "/a/b.ts", - content: "export let y = 1" - }; - - const openFiles = [f1.path]; - const files = [f1, config, libFile]; - const host = createServerHost(files); - const { verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); - verifyInitialOpen(f1); - - files.push(f2); - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - - f2.content = "export let x = 11"; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - } - - it("when both options are not set", () => { - verifyEventWithOutSettings(); - }); - - it("when --out is set", () => { - const outJs = "/a/out.js"; - verifyEventWithOutSettings({ out: outJs }); - }); - - it("when --outFile is set", () => { - const outJs = "/a/out.js"; - verifyEventWithOutSettings({ outFile: outJs }); - }); - }); - - describe("with modules and configured project", () => { - const file1Consumer1Path = "/a/b/file1Consumer1.ts"; - const moduleFile1Path = "/a/b/moduleFile1.ts"; - const configFilePath = "/a/b/tsconfig.json"; - interface InitialStateParams { - /** custom config file options */ - configObj?: any; - /** Additional files and folders to add */ - getAdditionalFileOrFolder?(): File[]; - /** initial list of files to reload in fs and first file in this list being the file to open */ - firstReloadFileList?: string[]; - } - function getInitialState({ configObj = {}, getAdditionalFileOrFolder, firstReloadFileList }: InitialStateParams = {}) { - const moduleFile1: File = { - path: moduleFile1Path, - content: "export function Foo() { };", - }; - - const file1Consumer1: File = { - path: file1Consumer1Path, - content: `import {Foo} from "./moduleFile1"; export var y = 10;`, - }; - - const file1Consumer2: File = { - path: "/a/b/file1Consumer2.ts", - content: `import {Foo} from "./moduleFile1"; let z = 10;`, - }; - - const moduleFile2: File = { - path: "/a/b/moduleFile2.ts", - content: `export var Foo4 = 10;`, - }; - - const globalFile3: File = { - path: "/a/b/globalFile3.ts", - content: `interface GlobalFoo { age: number }` - }; - - const additionalFiles = getAdditionalFileOrFolder ? getAdditionalFileOrFolder() : []; - const configFile = { - path: configFilePath, - content: JSON.stringify(configObj || { compilerOptions: {} }) - }; - - const files: File[] = [file1Consumer1, moduleFile1, file1Consumer2, moduleFile2, ...additionalFiles, globalFile3, libFile, configFile]; - - const filesToReload = firstReloadFileList && getFiles(firstReloadFileList) || files; - const host = createServerHost([filesToReload[0], configFile]); - - // Initial project creation - const { session, verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); - const openFiles = [filesToReload[0].path]; - verifyInitialOpen(filesToReload[0]); - - // Since this is first event, it will have all the files - verifyProjectsUpdatedInBackgroundEvent(filesToReload); - - return { - moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, - files, - updateContentOfOpenFile, - verifyNoProjectsUpdatedInBackgroundEvent, - verifyProjectsUpdatedInBackgroundEvent - }; - - function getFiles(filelist: string[]) { - return map(filelist, getFile); - } - - function getFile(fileName: string) { - return find(files, file => file.path === fileName)!; - } - - function verifyNoProjectsUpdatedInBackgroundEvent(filesToReload?: File[]) { - host.reloadFS(filesToReload || files); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([]); - } - - function verifyProjectsUpdatedInBackgroundEvent(filesToReload?: File[]) { - host.reloadFS(filesToReload || files); - host.runQueuedTimeoutCallbacks(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - } - - function updateContentOfOpenFile(file: File, newContent: string) { - session.executeCommandSeq({ - command: server.CommandNames.Change, - arguments: { - file: file.path, - insertString: newContent, - endLine: 1, - endOffset: file.content.length, - line: 1, - offset: 1 - } - }); - file.content = newContent; - } - } - - it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` - moduleFile1.content = `export var T: number;export function Foo() { console.log('hi'); };`; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should be up-to-date with the reference map changes", () => { - const { moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyProjectsUpdatedInBackgroundEvent, verifyNoProjectsUpdatedInBackgroundEvent } = getInitialState(); - - // Change file1Consumer1 content to `export let y = Foo();` - updateContentOfOpenFile(file1Consumer1, "export let y = Foo();"); - verifyNoProjectsUpdatedInBackgroundEvent(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - - // Add the import statements back to file1Consumer1 - updateContentOfOpenFile(file1Consumer1, `import {Foo} from "./moduleFile1";let y = Foo();`); - verifyNoProjectsUpdatedInBackgroundEvent(); - - // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` - moduleFile1.content = `export var T: number;export var T2: string;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - - // Multiple file edits in one go: - - // Change file1Consumer1 content to `export let y = Foo();` - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - updateContentOfOpenFile(file1Consumer1, `export let y = Foo();`); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should be up-to-date with deleted files", () => { - const { moduleFile1, file1Consumer2, files, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); - - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - - // Delete file1Consumer2 - const filesToLoad = filter(files, file => file !== file1Consumer2); - verifyProjectsUpdatedInBackgroundEvent(filesToLoad); - }); - - it("should be up-to-date with newly created files", () => { - const { moduleFile1, files, verifyProjectsUpdatedInBackgroundEvent, } = getInitialState(); - - const file1Consumer3: File = { - path: "/a/b/file1Consumer3.ts", - content: `import {Foo} from "./moduleFile1"; let y = Foo();` - }; - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(files.concat(file1Consumer3)); - }); - - it("should detect changes in non-root files", () => { - const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - configObj: { files: [file1Consumer1Path] }, - }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - - // change file1 internal, and verify only file1 is affected - moduleFile1.content += "var T1: number;"; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should return all files if a global file changed shape", () => { - const { globalFile3, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); - - globalFile3.content += "var T2: string;"; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should always return the file itself if '--isolatedModules' is specified", () => { - const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - configObj: { compilerOptions: { isolatedModules: true } } - }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should always return the file itself if '--out' or '--outFile' is specified", () => { - const outFilePath = "/a/b/out.js"; - const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - configObj: { compilerOptions: { module: "system", outFile: outFilePath } } - }); - - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should return cascaded affected file list", () => { - const file1Consumer1Consumer1: File = { - path: "/a/b/file1Consumer1Consumer1.ts", - content: `import {y} from "./file1Consumer1";` - }; - const { moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] - }); - - updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T: number;"); - verifyNoProjectsUpdatedInBackgroundEvent(); - - // Doesnt change the shape of file1Consumer1 - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - - // Change both files before the timeout - updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T2: number;"); - moduleFile1.content = `export var T2: number;export function Foo() { };`; - verifyProjectsUpdatedInBackgroundEvent(); - }); - - it("should work fine for files with circular references", () => { - const file1: File = { - path: "/a/b/file1.ts", - content: ` - /// - export var t1 = 10;` - }; - const file2: File = { - path: "/a/b/file2.ts", - content: ` - /// - export var t2 = 10;` - }; - const { configFile, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - getAdditionalFileOrFolder: () => [file1, file2], - firstReloadFileList: [file1.path, libFile.path, file2.path, configFilePath] - }); - - file2.content += "export var t3 = 10;"; - verifyProjectsUpdatedInBackgroundEvent([file1, file2, libFile, configFile]); - }); - - it("should detect removed code file", () => { - const referenceFile1: File = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { configFile, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [referenceFile1.path, libFile.path, moduleFile1Path, configFilePath] - }); - - verifyProjectsUpdatedInBackgroundEvent([libFile, referenceFile1, configFile]); - }); - - it("should detect non-existing code file", () => { - const referenceFile1: File = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { configFile, moduleFile2, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [referenceFile1.path, libFile.path, configFilePath] - }); - - updateContentOfOpenFile(referenceFile1, referenceFile1.content + "export var yy = Foo();"); - verifyNoProjectsUpdatedInBackgroundEvent([libFile, referenceFile1, configFile]); - - // Create module File2 and see both files are saved - verifyProjectsUpdatedInBackgroundEvent([libFile, moduleFile2, referenceFile1, configFile]); - }); - }); - - describe("resolution when resolution cache size", () => { - function verifyWithMaxCacheLimit(limitHit: boolean, useSlashRootAsSomeNotRootFolderInUserDirectory: boolean) { - const rootFolder = useSlashRootAsSomeNotRootFolderInUserDirectory ? "/user/username/rootfolder/otherfolder/" : "/"; - const file1: File = { - path: rootFolder + "a/b/project/file1.ts", - content: 'import a from "file2"' - }; - const file2: File = { - path: rootFolder + "a/b/node_modules/file2.d.ts", - content: "export class a { }" - }; - const file3: File = { - path: rootFolder + "a/b/project/file3.ts", - content: "export class c { }" - }; - const configFile: File = { - path: rootFolder + "a/b/project/tsconfig.json", - content: JSON.stringify({ compilerOptions: { typeRoots: [] } }) - }; - - const projectFiles = [file1, file3, libFile, configFile]; - const openFiles = [file1.path]; - const watchedRecursiveDirectories = useSlashRootAsSomeNotRootFolderInUserDirectory ? - // Folders of node_modules lookup not in changedRoot - ["a/b/project", "a/b/project/node_modules", "a/b/node_modules", "a/node_modules", "node_modules"].map(v => rootFolder + v) : - // Folder of tsconfig - ["/a/b/project", "/a/b/project/node_modules"]; - const host = createServerHost(projectFiles); - const { session, verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); - const projectService = session.getProjectService(); - verifyInitialOpen(file1); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const project = projectService.configuredProjects.get(configFile.path)!; - verifyProject(); - if (limitHit) { - (project as ResolutionCacheHost).maxNumberOfFilesToIterateForInvalidation = 1; - } - - file3.content += "export class d {}"; - host.reloadFS(projectFiles); - host.checkTimeoutQueueLengthAndRun(2); - - // Since this is first event - verifyProject(); - verifyProjectsUpdatedInBackgroundEventHandler([{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }]); - - projectFiles.push(file2); - host.reloadFS(projectFiles); - host.runQueuedTimeoutCallbacks(); - if (useSlashRootAsSomeNotRootFolderInUserDirectory) { - watchedRecursiveDirectories.length = 3; - } - else { - // file2 addition wont be detected - projectFiles.pop(); - assert.isTrue(host.fileExists(file2.path)); - } - verifyProject(); - - verifyProjectsUpdatedInBackgroundEventHandler(useSlashRootAsSomeNotRootFolderInUserDirectory ? [{ - eventName: server.ProjectsUpdatedInBackgroundEvent, - data: { - openFiles - } - }] : []); - - function verifyProject() { - checkProjectActualFiles(project, map(projectFiles, file => file.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); - } - } - - it("limit not hit and project is not at root level", () => { - verifyWithMaxCacheLimit(/*limitHit*/ false, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ true); - }); - - it("limit hit and project is not at root level", () => { - verifyWithMaxCacheLimit(/*limitHit*/ true, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ true); - }); - - it("limit not hit and project is at root level", () => { - verifyWithMaxCacheLimit(/*limitHit*/ false, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ false); - }); - - it("limit hit and project is at root level", () => { - verifyWithMaxCacheLimit(/*limitHit*/ true, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ false); - }); - }); - } - - describe("when event handler is set in the session", () => { - verifyProjectsUpdatedInBackgroundEvent(createSessionWithProjectChangedEventHandler); - - function createSessionWithProjectChangedEventHandler(host: TestServerHost): ProjectsUpdatedInBackgroundEventVerifier { - const { session, events: projectChangedEvents } = createSessionWithEventTracking(host, server.ProjectsUpdatedInBackgroundEvent); - return { - session, - verifyProjectsUpdatedInBackgroundEventHandler, - verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) - }; - - function eventToString(event: server.ProjectsUpdatedInBackgroundEvent) { - return JSON.stringify(event && { eventName: event.eventName, data: event.data }); - } - - function eventsToString(events: ReadonlyArray) { - return "[" + map(events, eventToString).join(",") + "]"; - } - - function verifyProjectsUpdatedInBackgroundEventHandler(expectedEvents: ReadonlyArray) { - assert.equal(projectChangedEvents.length, expectedEvents.length, `Incorrect number of events Actual: ${eventsToString(projectChangedEvents)} Expected: ${eventsToString(expectedEvents)}`); - forEach(projectChangedEvents, (actualEvent, i) => { - const expectedEvent = expectedEvents[i]; - assert.strictEqual(actualEvent.eventName, expectedEvent.eventName); - verifyFiles("openFiles", actualEvent.data.openFiles, expectedEvent.data.openFiles); - }); - - // Verified the events, reset them - projectChangedEvents.length = 0; - } - } - }); - - describe("when event handler is not set but session is created with canUseEvents = true", () => { - describe("without noGetErrOnBackgroundUpdate, diagnostics for open files are queued", () => { - verifyProjectsUpdatedInBackgroundEvent(createSessionThatUsesEvents); - }); - - describe("with noGetErrOnBackgroundUpdate, diagnostics for open file are not queued", () => { - verifyProjectsUpdatedInBackgroundEvent(host => createSessionThatUsesEvents(host, /*noGetErrOnBackgroundUpdate*/ true)); - }); - - - function createSessionThatUsesEvents(host: TestServerHost, noGetErrOnBackgroundUpdate?: boolean): ProjectsUpdatedInBackgroundEventVerifier { - const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler(host, server.ProjectsUpdatedInBackgroundEvent, { noGetErrOnBackgroundUpdate }); - - return { - session, - verifyProjectsUpdatedInBackgroundEventHandler, - verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) - }; - - function verifyProjectsUpdatedInBackgroundEventHandler(expected: ReadonlyArray) { - const expectedEvents: protocol.ProjectsUpdatedInBackgroundEventBody[] = map(expected, e => { - return { - openFiles: e.data.openFiles - }; - }); - const events = getEvents(); - assert.equal(events.length, expectedEvents.length, `Incorrect number of events Actual: ${map(events, e => e.body)} Expected: ${expectedEvents}`); - forEach(events, (actualEvent, i) => { - const expectedEvent = expectedEvents[i]; - verifyFiles("openFiles", actualEvent.body.openFiles, expectedEvent.openFiles); - }); - - // Verified the events, reset them - clearEvents(); - - if (events.length) { - host.checkTimeoutQueueLength(noGetErrOnBackgroundUpdate ? 0 : 1); // Error checking queued only if not noGetErrOnBackgroundUpdate - } - } - } - }); - }); - describe("tsserverProjectSystem with symLinks", () => { it("rename in common file renames all project", () => { const projects = "/users/username/projects"; diff --git a/src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts b/src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts new file mode 100644 index 00000000000..3e8382fff58 --- /dev/null +++ b/src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts @@ -0,0 +1,591 @@ +namespace ts.projectSystem { + describe("tsserverProjectUpdatedInBackgroundEvent:: ProjectsUpdatedInBackground", () => { + function verifyFiles(caption: string, actual: ReadonlyArray, expected: ReadonlyArray) { + assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`); + const seen = createMap(); + forEach(actual, f => { + assert.isFalse(seen.has(f), `${caption}: Found duplicate ${f}. Actual: ${actual} Expected: ${expected}`); + seen.set(f, true); + assert.isTrue(contains(expected, f), `${caption}: Expected not to contain ${f}. Actual: ${actual} Expected: ${expected}`); + }); + } + + function createVerifyInitialOpen(session: TestSession, verifyProjectsUpdatedInBackgroundEventHandler: (events: server.ProjectsUpdatedInBackgroundEvent[]) => void) { + return (file: File) => { + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { + file: file.path + } + }); + verifyProjectsUpdatedInBackgroundEventHandler([]); + }; + } + + interface ProjectsUpdatedInBackgroundEventVerifier { + session: TestSession; + verifyProjectsUpdatedInBackgroundEventHandler(events: server.ProjectsUpdatedInBackgroundEvent[]): void; + verifyInitialOpen(file: File): void; + } + + function verifyProjectsUpdatedInBackgroundEvent(createSession: (host: TestServerHost) => ProjectsUpdatedInBackgroundEventVerifier) { + it("when adding new file", () => { + const commonFile1: File = { + path: "/a/b/file1.ts", + content: "export var x = 10;" + }; + const commonFile2: File = { + path: "/a/b/file2.ts", + content: "export var y = 10;" + }; + const commonFile3: File = { + path: "/a/b/file3.ts", + content: "export var z = 10;" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const openFiles = [commonFile1.path]; + const host = createServerHost([commonFile1, libFile, configFile]); + const { verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); + verifyInitialOpen(commonFile1); + + host.reloadFS([commonFile1, libFile, configFile, commonFile2]); + host.runQueuedTimeoutCallbacks(); + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + + host.reloadFS([commonFile1, commonFile2, libFile, configFile, commonFile3]); + host.runQueuedTimeoutCallbacks(); + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + }); + + describe("with --out or --outFile setting", () => { + function verifyEventWithOutSettings(compilerOptions: CompilerOptions = {}) { + const config: File = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions + }) + }; + + const f1: File = { + path: "/a/a.ts", + content: "export let x = 1" + }; + const f2: File = { + path: "/a/b.ts", + content: "export let y = 1" + }; + + const openFiles = [f1.path]; + const files = [f1, config, libFile]; + const host = createServerHost(files); + const { verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); + verifyInitialOpen(f1); + + files.push(f2); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + + f2.content = "export let x = 11"; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + } + + it("when both options are not set", () => { + verifyEventWithOutSettings(); + }); + + it("when --out is set", () => { + const outJs = "/a/out.js"; + verifyEventWithOutSettings({ out: outJs }); + }); + + it("when --outFile is set", () => { + const outJs = "/a/out.js"; + verifyEventWithOutSettings({ outFile: outJs }); + }); + }); + + describe("with modules and configured project", () => { + const file1Consumer1Path = "/a/b/file1Consumer1.ts"; + const moduleFile1Path = "/a/b/moduleFile1.ts"; + const configFilePath = "/a/b/tsconfig.json"; + interface InitialStateParams { + /** custom config file options */ + configObj?: any; + /** Additional files and folders to add */ + getAdditionalFileOrFolder?(): File[]; + /** initial list of files to reload in fs and first file in this list being the file to open */ + firstReloadFileList?: string[]; + } + function getInitialState({ configObj = {}, getAdditionalFileOrFolder, firstReloadFileList }: InitialStateParams = {}) { + const moduleFile1: File = { + path: moduleFile1Path, + content: "export function Foo() { };", + }; + + const file1Consumer1: File = { + path: file1Consumer1Path, + content: `import {Foo} from "./moduleFile1"; export var y = 10;`, + }; + + const file1Consumer2: File = { + path: "/a/b/file1Consumer2.ts", + content: `import {Foo} from "./moduleFile1"; let z = 10;`, + }; + + const moduleFile2: File = { + path: "/a/b/moduleFile2.ts", + content: `export var Foo4 = 10;`, + }; + + const globalFile3: File = { + path: "/a/b/globalFile3.ts", + content: `interface GlobalFoo { age: number }` + }; + + const additionalFiles = getAdditionalFileOrFolder ? getAdditionalFileOrFolder() : []; + const configFile = { + path: configFilePath, + content: JSON.stringify(configObj || { compilerOptions: {} }) + }; + + const files: File[] = [file1Consumer1, moduleFile1, file1Consumer2, moduleFile2, ...additionalFiles, globalFile3, libFile, configFile]; + + const filesToReload = firstReloadFileList && getFiles(firstReloadFileList) || files; + const host = createServerHost([filesToReload[0], configFile]); + + // Initial project creation + const { session, verifyProjectsUpdatedInBackgroundEventHandler, verifyInitialOpen } = createSession(host); + const openFiles = [filesToReload[0].path]; + verifyInitialOpen(filesToReload[0]); + + // Since this is first event, it will have all the files + verifyProjectsUpdatedInBackgroundEvent(filesToReload); + + return { + moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, + files, + updateContentOfOpenFile, + verifyNoProjectsUpdatedInBackgroundEvent, + verifyProjectsUpdatedInBackgroundEvent + }; + + function getFiles(filelist: string[]) { + return map(filelist, getFile); + } + + function getFile(fileName: string) { + return find(files, file => file.path === fileName)!; + } + + function verifyNoProjectsUpdatedInBackgroundEvent(filesToReload?: File[]) { + host.reloadFS(filesToReload || files); + host.runQueuedTimeoutCallbacks(); + verifyProjectsUpdatedInBackgroundEventHandler([]); + } + + function verifyProjectsUpdatedInBackgroundEvent(filesToReload?: File[]) { + host.reloadFS(filesToReload || files); + host.runQueuedTimeoutCallbacks(); + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + } + + function updateContentOfOpenFile(file: File, newContent: string) { + session.executeCommandSeq({ + command: server.CommandNames.Change, + arguments: { + file: file.path, + insertString: newContent, + endLine: 1, + endOffset: file.content.length, + line: 1, + offset: 1 + } + }); + file.content = newContent; + } + } + + it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { + const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` + moduleFile1.content = `export var T: number;export function Foo() { console.log('hi'); };`; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should be up-to-date with the reference map changes", () => { + const { moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyProjectsUpdatedInBackgroundEvent, verifyNoProjectsUpdatedInBackgroundEvent } = getInitialState(); + + // Change file1Consumer1 content to `export let y = Foo();` + updateContentOfOpenFile(file1Consumer1, "export let y = Foo();"); + verifyNoProjectsUpdatedInBackgroundEvent(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + + // Add the import statements back to file1Consumer1 + updateContentOfOpenFile(file1Consumer1, `import {Foo} from "./moduleFile1";let y = Foo();`); + verifyNoProjectsUpdatedInBackgroundEvent(); + + // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` + moduleFile1.content = `export var T: number;export var T2: string;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + + // Multiple file edits in one go: + + // Change file1Consumer1 content to `export let y = Foo();` + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + updateContentOfOpenFile(file1Consumer1, `export let y = Foo();`); + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should be up-to-date with deleted files", () => { + const { moduleFile1, file1Consumer2, files, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + moduleFile1.content = `export var T: number;export function Foo() { };`; + + // Delete file1Consumer2 + const filesToLoad = filter(files, file => file !== file1Consumer2); + verifyProjectsUpdatedInBackgroundEvent(filesToLoad); + }); + + it("should be up-to-date with newly created files", () => { + const { moduleFile1, files, verifyProjectsUpdatedInBackgroundEvent, } = getInitialState(); + + const file1Consumer3: File = { + path: "/a/b/file1Consumer3.ts", + content: `import {Foo} from "./moduleFile1"; let y = Foo();` + }; + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(files.concat(file1Consumer3)); + }); + + it("should detect changes in non-root files", () => { + const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + configObj: { files: [file1Consumer1Path] }, + }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + + // change file1 internal, and verify only file1 is affected + moduleFile1.content += "var T1: number;"; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should return all files if a global file changed shape", () => { + const { globalFile3, verifyProjectsUpdatedInBackgroundEvent } = getInitialState(); + + globalFile3.content += "var T2: string;"; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should always return the file itself if '--isolatedModules' is specified", () => { + const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + configObj: { compilerOptions: { isolatedModules: true } } + }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should always return the file itself if '--out' or '--outFile' is specified", () => { + const outFilePath = "/a/b/out.js"; + const { moduleFile1, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + configObj: { compilerOptions: { module: "system", outFile: outFilePath } } + }); + + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should return cascaded affected file list", () => { + const file1Consumer1Consumer1: File = { + path: "/a/b/file1Consumer1Consumer1.ts", + content: `import {y} from "./file1Consumer1";` + }; + const { moduleFile1, file1Consumer1, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] + }); + + updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T: number;"); + verifyNoProjectsUpdatedInBackgroundEvent(); + + // Doesnt change the shape of file1Consumer1 + moduleFile1.content = `export var T: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + + // Change both files before the timeout + updateContentOfOpenFile(file1Consumer1, file1Consumer1.content + "export var T2: number;"); + moduleFile1.content = `export var T2: number;export function Foo() { };`; + verifyProjectsUpdatedInBackgroundEvent(); + }); + + it("should work fine for files with circular references", () => { + const file1: File = { + path: "/a/b/file1.ts", + content: ` + /// + export var t1 = 10;` + }; + const file2: File = { + path: "/a/b/file2.ts", + content: ` + /// + export var t2 = 10;` + }; + const { configFile, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + getAdditionalFileOrFolder: () => [file1, file2], + firstReloadFileList: [file1.path, libFile.path, file2.path, configFilePath] + }); + + file2.content += "export var t3 = 10;"; + verifyProjectsUpdatedInBackgroundEvent([file1, file2, libFile, configFile]); + }); + + it("should detect removed code file", () => { + const referenceFile1: File = { + path: "/a/b/referenceFile1.ts", + content: ` + /// + export var x = Foo();` + }; + const { configFile, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + getAdditionalFileOrFolder: () => [referenceFile1], + firstReloadFileList: [referenceFile1.path, libFile.path, moduleFile1Path, configFilePath] + }); + + verifyProjectsUpdatedInBackgroundEvent([libFile, referenceFile1, configFile]); + }); + + it("should detect non-existing code file", () => { + const referenceFile1: File = { + path: "/a/b/referenceFile1.ts", + content: ` + /// + export var x = Foo();` + }; + const { configFile, moduleFile2, updateContentOfOpenFile, verifyNoProjectsUpdatedInBackgroundEvent, verifyProjectsUpdatedInBackgroundEvent } = getInitialState({ + getAdditionalFileOrFolder: () => [referenceFile1], + firstReloadFileList: [referenceFile1.path, libFile.path, configFilePath] + }); + + updateContentOfOpenFile(referenceFile1, referenceFile1.content + "export var yy = Foo();"); + verifyNoProjectsUpdatedInBackgroundEvent([libFile, referenceFile1, configFile]); + + // Create module File2 and see both files are saved + verifyProjectsUpdatedInBackgroundEvent([libFile, moduleFile2, referenceFile1, configFile]); + }); + }); + + describe("resolution when resolution cache size", () => { + function verifyWithMaxCacheLimit(limitHit: boolean, useSlashRootAsSomeNotRootFolderInUserDirectory: boolean) { + const rootFolder = useSlashRootAsSomeNotRootFolderInUserDirectory ? "/user/username/rootfolder/otherfolder/" : "/"; + const file1: File = { + path: rootFolder + "a/b/project/file1.ts", + content: 'import a from "file2"' + }; + const file2: File = { + path: rootFolder + "a/b/node_modules/file2.d.ts", + content: "export class a { }" + }; + const file3: File = { + path: rootFolder + "a/b/project/file3.ts", + content: "export class c { }" + }; + const configFile: File = { + path: rootFolder + "a/b/project/tsconfig.json", + content: JSON.stringify({ compilerOptions: { typeRoots: [] } }) + }; + + const projectFiles = [file1, file3, libFile, configFile]; + const openFiles = [file1.path]; + const watchedRecursiveDirectories = useSlashRootAsSomeNotRootFolderInUserDirectory ? + // Folders of node_modules lookup not in changedRoot + ["a/b/project", "a/b/project/node_modules", "a/b/node_modules", "a/node_modules", "node_modules"].map(v => rootFolder + v) : + // Folder of tsconfig + ["/a/b/project", "/a/b/project/node_modules"]; + const host = createServerHost(projectFiles); + const { session, verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); + const projectService = session.getProjectService(); + verifyInitialOpen(file1); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path)!; + verifyProject(); + if (limitHit) { + (project as ResolutionCacheHost).maxNumberOfFilesToIterateForInvalidation = 1; + } + + file3.content += "export class d {}"; + host.reloadFS(projectFiles); + host.checkTimeoutQueueLengthAndRun(2); + + // Since this is first event + verifyProject(); + verifyProjectsUpdatedInBackgroundEventHandler([{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }]); + + projectFiles.push(file2); + host.reloadFS(projectFiles); + host.runQueuedTimeoutCallbacks(); + if (useSlashRootAsSomeNotRootFolderInUserDirectory) { + watchedRecursiveDirectories.length = 3; + } + else { + // file2 addition wont be detected + projectFiles.pop(); + assert.isTrue(host.fileExists(file2.path)); + } + verifyProject(); + + verifyProjectsUpdatedInBackgroundEventHandler(useSlashRootAsSomeNotRootFolderInUserDirectory ? [{ + eventName: server.ProjectsUpdatedInBackgroundEvent, + data: { + openFiles + } + }] : []); + + function verifyProject() { + checkProjectActualFiles(project, map(projectFiles, file => file.path)); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + } + } + + it("limit not hit and project is not at root level", () => { + verifyWithMaxCacheLimit(/*limitHit*/ false, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ true); + }); + + it("limit hit and project is not at root level", () => { + verifyWithMaxCacheLimit(/*limitHit*/ true, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ true); + }); + + it("limit not hit and project is at root level", () => { + verifyWithMaxCacheLimit(/*limitHit*/ false, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ false); + }); + + it("limit hit and project is at root level", () => { + verifyWithMaxCacheLimit(/*limitHit*/ true, /*useSlashRootAsSomeNotRootFolderInUserDirectory*/ false); + }); + }); + } + + describe("when event handler is set in the session", () => { + verifyProjectsUpdatedInBackgroundEvent(createSessionWithProjectChangedEventHandler); + + function createSessionWithProjectChangedEventHandler(host: TestServerHost): ProjectsUpdatedInBackgroundEventVerifier { + const { session, events: projectChangedEvents } = createSessionWithEventTracking(host, server.ProjectsUpdatedInBackgroundEvent); + return { + session, + verifyProjectsUpdatedInBackgroundEventHandler, + verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) + }; + + function eventToString(event: server.ProjectsUpdatedInBackgroundEvent) { + return JSON.stringify(event && { eventName: event.eventName, data: event.data }); + } + + function eventsToString(events: ReadonlyArray) { + return "[" + map(events, eventToString).join(",") + "]"; + } + + function verifyProjectsUpdatedInBackgroundEventHandler(expectedEvents: ReadonlyArray) { + assert.equal(projectChangedEvents.length, expectedEvents.length, `Incorrect number of events Actual: ${eventsToString(projectChangedEvents)} Expected: ${eventsToString(expectedEvents)}`); + forEach(projectChangedEvents, (actualEvent, i) => { + const expectedEvent = expectedEvents[i]; + assert.strictEqual(actualEvent.eventName, expectedEvent.eventName); + verifyFiles("openFiles", actualEvent.data.openFiles, expectedEvent.data.openFiles); + }); + + // Verified the events, reset them + projectChangedEvents.length = 0; + } + } + }); + + describe("when event handler is not set but session is created with canUseEvents = true", () => { + describe("without noGetErrOnBackgroundUpdate, diagnostics for open files are queued", () => { + verifyProjectsUpdatedInBackgroundEvent(createSessionThatUsesEvents); + }); + + describe("with noGetErrOnBackgroundUpdate, diagnostics for open file are not queued", () => { + verifyProjectsUpdatedInBackgroundEvent(host => createSessionThatUsesEvents(host, /*noGetErrOnBackgroundUpdate*/ true)); + }); + + + function createSessionThatUsesEvents(host: TestServerHost, noGetErrOnBackgroundUpdate?: boolean): ProjectsUpdatedInBackgroundEventVerifier { + const { session, getEvents, clearEvents } = createSessionWithDefaultEventHandler(host, server.ProjectsUpdatedInBackgroundEvent, { noGetErrOnBackgroundUpdate }); + + return { + session, + verifyProjectsUpdatedInBackgroundEventHandler, + verifyInitialOpen: createVerifyInitialOpen(session, verifyProjectsUpdatedInBackgroundEventHandler) + }; + + function verifyProjectsUpdatedInBackgroundEventHandler(expected: ReadonlyArray) { + const expectedEvents: protocol.ProjectsUpdatedInBackgroundEventBody[] = map(expected, e => { + return { + openFiles: e.data.openFiles + }; + }); + const events = getEvents(); + assert.equal(events.length, expectedEvents.length, `Incorrect number of events Actual: ${map(events, e => e.body)} Expected: ${expectedEvents}`); + forEach(events, (actualEvent, i) => { + const expectedEvent = expectedEvents[i]; + verifyFiles("openFiles", actualEvent.body.openFiles, expectedEvent.openFiles); + }); + + // Verified the events, reset them + clearEvents(); + + if (events.length) { + host.checkTimeoutQueueLength(noGetErrOnBackgroundUpdate ? 0 : 1); // Error checking queued only if not noGetErrOnBackgroundUpdate + } + } + } + }); + }); +} From f6ac9495962c803b718b88fe87a27fa385bf19f4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 12:47:08 -0800 Subject: [PATCH 232/322] Separate out LargeFileReferencedEvent test --- src/testRunner/tsconfig.json | 1 + .../tsserverLargeFileReferencedEvent.ts | 76 +++++++++++++++++++ .../unittests/tsserverProjectSystem.ts | 75 ------------------ 3 files changed, 77 insertions(+), 75 deletions(-) create mode 100644 src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 6c18df789f6..ba46706ee16 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -88,6 +88,7 @@ "unittests/tsconfigParsing.ts", "unittests/tscWatchEmit.ts", "unittests/tscWatchMode.ts", + "unittests/tsserverLargeFileReferencedEvent.ts", "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", "unittests/tsserverProjectUpdatedInBackgroundEvent.ts", diff --git a/src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts b/src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts new file mode 100644 index 00000000000..f33f32dfe58 --- /dev/null +++ b/src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts @@ -0,0 +1,76 @@ +namespace ts.projectSystem { + describe("tsserverLargeFileReferencedEvent:: LargeFileReferencedEvent with large file", () => { + const projectRoot = "/user/username/projects/project"; + + function getLargeFile(useLargeTsFile: boolean) { + return `src/large.${useLargeTsFile ? "ts" : "js"}`; + } + + function createSessionWithEventHandler(files: File[], useLargeTsFile: boolean) { + const largeFile: File = { + path: `${projectRoot}/${getLargeFile(useLargeTsFile)}`, + content: "export var x = 10;", + fileSize: server.maxFileSize + 1 + }; + files.push(largeFile); + const host = createServerHost(files); + const { session, events: largeFileReferencedEvents } = createSessionWithEventTracking(host, server.LargeFileReferencedEvent); + + return { session, verifyLargeFile }; + + function verifyLargeFile(project: server.Project) { + checkProjectActualFiles(project, files.map(f => f.path)); + + // large file for non ts file should be empty and for ts file should have content + const service = session.getProjectService(); + const info = service.getScriptInfo(largeFile.path)!; + assert.equal(info.cacheSourceFile!.sourceFile.text, useLargeTsFile ? largeFile.content : ""); + + assert.deepEqual(largeFileReferencedEvents, useLargeTsFile ? emptyArray : [{ + eventName: server.LargeFileReferencedEvent, + data: { file: largeFile.path, fileSize: largeFile.fileSize, maxFileSize: server.maxFileSize } + }]); + } + } + + function verifyLargeFile(useLargeTsFile: boolean) { + it("when large file is included by tsconfig", () => { + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: "export var y = 10;" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({ files: ["src/file.ts", getLargeFile(useLargeTsFile)], compilerOptions: { target: 1, allowJs: true } }) + }; + const files = [file, libFile, tsconfig]; + const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); + const service = session.getProjectService(); + openFilesForSession([file], session); + checkNumberOfProjects(service, { configuredProjects: 1 }); + verifyLargeFile(service.configuredProjects.get(tsconfig.path)!); + }); + + it("when large file is included by module resolution", () => { + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: `export var y = 10;import {x} from "./large"` + }; + const files = [file, libFile]; + const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); + const service = session.getProjectService(); + openFilesForSession([file], session); + checkNumberOfProjects(service, { inferredProjects: 1 }); + verifyLargeFile(service.inferredProjects[0]); + }); + } + + describe("large file is ts file", () => { + verifyLargeFile(/*useLargeTsFile*/ true); + }); + + describe("large file is js file", () => { + verifyLargeFile(/*useLargeTsFile*/ false); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index c098eede598..0c6382f13c4 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -7102,81 +7102,6 @@ new C();` }); }); - describe("tsserverProjectSystem with large file", () => { - const projectRoot = "/user/username/projects/project"; - - function getLargeFile(useLargeTsFile: boolean) { - return `src/large.${useLargeTsFile ? "ts" : "js"}`; - } - - function createSessionWithEventHandler(files: File[], useLargeTsFile: boolean) { - const largeFile: File = { - path: `${projectRoot}/${getLargeFile(useLargeTsFile)}`, - content: "export var x = 10;", - fileSize: server.maxFileSize + 1 - }; - files.push(largeFile); - const host = createServerHost(files); - const { session, events: largeFileReferencedEvents } = createSessionWithEventTracking(host, server.LargeFileReferencedEvent); - - return { session, verifyLargeFile }; - - function verifyLargeFile(project: server.Project) { - checkProjectActualFiles(project, files.map(f => f.path)); - - // large file for non ts file should be empty and for ts file should have content - const service = session.getProjectService(); - const info = service.getScriptInfo(largeFile.path)!; - assert.equal(info.cacheSourceFile!.sourceFile.text, useLargeTsFile ? largeFile.content : ""); - - assert.deepEqual(largeFileReferencedEvents, useLargeTsFile ? emptyArray : [{ - eventName: server.LargeFileReferencedEvent, - data: { file: largeFile.path, fileSize: largeFile.fileSize, maxFileSize: server.maxFileSize } - }]); - } - } - - function verifyLargeFile(useLargeTsFile: boolean) { - it("when large file is included by tsconfig", () => { - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: "export var y = 10;" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ files: ["src/file.ts", getLargeFile(useLargeTsFile)], compilerOptions: { target: 1, allowJs: true } }) - }; - const files = [file, libFile, tsconfig]; - const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); - const service = session.getProjectService(); - openFilesForSession([file], session); - checkNumberOfProjects(service, { configuredProjects: 1 }); - verifyLargeFile(service.configuredProjects.get(tsconfig.path)!); - }); - - it("when large file is included by module resolution", () => { - const file: File = { - path: `${projectRoot}/src/file.ts`, - content: `export var y = 10;import {x} from "./large"` - }; - const files = [file, libFile]; - const { session, verifyLargeFile } = createSessionWithEventHandler(files, useLargeTsFile); - const service = session.getProjectService(); - openFilesForSession([file], session); - checkNumberOfProjects(service, { inferredProjects: 1 }); - verifyLargeFile(service.inferredProjects[0]); - }); - } - - describe("large file is ts file", () => { - verifyLargeFile(/*useLargeTsFile*/ true); - }); - - describe("large file is js file", () => { - verifyLargeFile(/*useLargeTsFile*/ false); - }); - }); - describe("tsserverProjectSystem syntax operations", () => { function navBarFull(session: TestSession, file: File) { return JSON.stringify(session.executeCommandSeq({ From 96c73701c16b0d859b8b7983701468548d1b6bbe Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 13:03:13 -0800 Subject: [PATCH 233/322] More refactoring for resloutionCache and project errors --- src/testRunner/unittests/projectErrors.ts | 283 +++++++ src/testRunner/unittests/resolutionCache.ts | 401 ++++++++++ src/testRunner/unittests/tsserverHelpers.ts | 44 +- .../unittests/tsserverProjectSystem.ts | 712 ------------------ 4 files changed, 706 insertions(+), 734 deletions(-) diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/projectErrors.ts index 15bbab2a551..9ff7278e78c 100644 --- a/src/testRunner/unittests/projectErrors.ts +++ b/src/testRunner/unittests/projectErrors.ts @@ -563,4 +563,287 @@ namespace ts.projectSystem { assert.isTrue(diagsAfterUpdate.length === 0); }); }); + + describe("tsserver:: Project Errors for Configure file diagnostics events", () => { + function getUnknownCompilerOptionDiagnostic(configFile: File, prop: string): ConfigFileDiagnostic { + const d = Diagnostics.Unknown_compiler_option_0; + const start = configFile.content.indexOf(prop) - 1; // start at "prop" + return { + fileName: configFile.path, + start, + length: prop.length + 2, + messageText: formatStringFromArgs(d.message, [prop]), + category: d.category, + code: d.code, + reportsUnnecessary: undefined + }; + } + + function getFileNotFoundDiagnostic(configFile: File, relativeFileName: string): ConfigFileDiagnostic { + const findString = `{"path":"./${relativeFileName}"}`; + const d = Diagnostics.File_0_not_found; + const start = configFile.content.indexOf(findString); + return { + fileName: configFile.path, + start, + length: findString.length, + messageText: formatStringFromArgs(d.message, [`${getDirectoryPath(configFile.path)}/${relativeFileName}`]), + category: d.category, + code: d.code, + reportsUnnecessary: undefined + }; + } + + it("are generated when the config file has errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "foo": "bar", + "allowJS": true + } + }` + }; + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ + getUnknownCompilerOptionDiagnostic(configFile, "foo"), + getUnknownCompilerOptionDiagnostic(configFile, "allowJS") + ]); + }); + + it("are generated when the config file doesn't have errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {} + }` + }; + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); + }); + + it("are generated when the config file changes", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {} + }` + }; + + const files = [file, libFile, configFile]; + const serverEventManager = new TestServerEventManager(files); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); + + configFile.content = `{ + "compilerOptions": { + "haha": 123 + } + }`; + serverEventManager.host.reloadFS(files); + serverEventManager.host.runQueuedTimeoutCallbacks(); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, [ + getUnknownCompilerOptionDiagnostic(configFile, "haha") + ]); + + configFile.content = `{ + "compilerOptions": {} + }`; + serverEventManager.host.reloadFS(files); + serverEventManager.host.runQueuedTimeoutCallbacks(); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, emptyArray); + }); + + it("are not generated when the config file does not include file opened and config file has errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const file2: File = { + path: "/a/b/test.ts", + content: "let x = 10" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "foo": "bar", + "allowJS": true + }, + "files": ["app.ts"] + }` + }; + const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); + openFilesForSession([file2], serverEventManager.session); + serverEventManager.hasZeroEvent("configFileDiag"); + }); + + it("are not generated when the config file has errors but suppressDiagnosticEvents is true", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "foo": "bar", + "allowJS": true + } + }` + }; + const serverEventManager = new TestServerEventManager([file, libFile, configFile], /*suppressDiagnosticEvents*/ true); + openFilesForSession([file], serverEventManager.session); + serverEventManager.hasZeroEvent("configFileDiag"); + }); + + it("are not generated when the config file does not include file opened and doesnt contain any errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const file2: File = { + path: "/a/b/test.ts", + content: "let x = 10" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["app.ts"] + }` + }; + + const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); + openFilesForSession([file2], serverEventManager.session); + serverEventManager.hasZeroEvent("configFileDiag"); + }); + + it("contains the project reference errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const noSuchTsconfig = "no-such-tsconfig.json"; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["app.ts"], + "references": [{"path":"./${noSuchTsconfig}"}] + }` + }; + + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ + getFileNotFoundDiagnostic(configFile, noSuchTsconfig) + ]); + }); + }); + + describe("tsserver:: Project Errors reports Options Diagnostic locations correctly with changes in configFile contents", () => { + it("when options change", () => { + const file = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const configFileContentBeforeComment = `{`; + const configFileContentComment = ` + // comment`; + const configFileContentAfterComment = ` + "compilerOptions": { + "allowJs": true, + "declaration": true + } + }`; + const configFileContentWithComment = configFileContentBeforeComment + configFileContentComment + configFileContentAfterComment; + const configFileContentWithoutCommentLine = configFileContentBeforeComment + configFileContentAfterComment; + + const configFile = { + path: "/a/b/tsconfig.json", + content: configFileContentWithComment + }; + const host = createServerHost([file, libFile, configFile]); + const session = createSession(host); + openFilesForSession([file], session); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const projectName = configuredProjectAt(projectService, 0).getProjectName(); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.SemanticDiagnosticsSync, + seq: 2, + arguments: { file: configFile.path, projectFileName: projectName, includeLinePosition: true } + }).response as ReadonlyArray; + assert.isTrue(diags.length === 2); + + configFile.content = configFileContentWithoutCommentLine; + host.reloadFS([file, configFile]); + + const diagsAfterEdit = session.executeCommand({ + type: "request", + command: server.CommandNames.SemanticDiagnosticsSync, + seq: 2, + arguments: { file: configFile.path, projectFileName: projectName, includeLinePosition: true } + }).response as ReadonlyArray; + assert.isTrue(diagsAfterEdit.length === 2); + + verifyDiagnostic(diags[0], diagsAfterEdit[0]); + verifyDiagnostic(diags[1], diagsAfterEdit[1]); + + function verifyDiagnostic(beforeEditDiag: server.protocol.DiagnosticWithLinePosition, afterEditDiag: server.protocol.DiagnosticWithLinePosition) { + assert.equal(beforeEditDiag.message, afterEditDiag.message); + assert.equal(beforeEditDiag.code, afterEditDiag.code); + assert.equal(beforeEditDiag.category, afterEditDiag.category); + assert.equal(beforeEditDiag.startLocation.line, afterEditDiag.startLocation.line + 1); + assert.equal(beforeEditDiag.startLocation.offset, afterEditDiag.startLocation.offset); + assert.equal(beforeEditDiag.endLocation.line, afterEditDiag.endLocation.line + 1); + assert.equal(beforeEditDiag.endLocation.offset, afterEditDiag.endLocation.offset); + } + }); + }); + + describe("tsserver:: Project Errors with config file change", () => { + it("Updates diagnostics when '--noUnusedLabels' changes", () => { + const aTs: File = { path: "/a.ts", content: "label: while (1) {}" }; + const options = (allowUnusedLabels: boolean) => `{ "compilerOptions": { "allowUnusedLabels": ${allowUnusedLabels} } }`; + const tsconfig: File = { path: "/tsconfig.json", content: options(/*allowUnusedLabels*/ true) }; + + const host = createServerHost([aTs, tsconfig]); + const session = createSession(host); + openFilesForSession([aTs], session); + + host.modifyFile(tsconfig.path, options(/*allowUnusedLabels*/ false)); + host.runQueuedTimeoutCallbacks(); + + const response = executeSessionRequest(session, protocol.CommandTypes.SemanticDiagnosticsSync, { file: aTs.path }) as protocol.Diagnostic[] | undefined; + assert.deepEqual(response, [ + { + start: { line: 1, offset: 1 }, + end: { line: 1, offset: 1 + "label".length }, + text: "Unused label.", + category: "error", + code: Diagnostics.Unused_label.code, + relatedInformation: undefined, + reportsUnnecessary: true, + source: undefined, + }, + ]); + }); + }); } diff --git a/src/testRunner/unittests/resolutionCache.ts b/src/testRunner/unittests/resolutionCache.ts index fbc792481fc..ab6c6830618 100644 --- a/src/testRunner/unittests/resolutionCache.ts +++ b/src/testRunner/unittests/resolutionCache.ts @@ -978,4 +978,405 @@ export const x = 10;` }); }); }); + + describe("resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { + it("should restore the states for inferred projects", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const host = createServerHost([moduleFile, file1]); + const session = createSession(host); + + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + + const moduleFileOldPath = moduleFile.path; + const moduleFileNewPath = "/a/b/moduleFile1.ts"; + moduleFile.path = moduleFileNewPath; + host.reloadFS([moduleFile, file1]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + assert.equal(diags.length, 1); + + moduleFile.path = moduleFileOldPath; + host.reloadFS([moduleFile, file1]); + host.runQueuedTimeoutCallbacks(); + + // Make a change to trigger the program rebuild + const changeRequest = makeSessionRequest( + server.CommandNames.Change, + { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } + ); + session.executeCommand(changeRequest); + host.runQueuedTimeoutCallbacks(); + + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("should restore the states for configured projects", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([moduleFile, file1, configFile]); + const session = createSession(host); + + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + + const moduleFileOldPath = moduleFile.path; + const moduleFileNewPath = "/a/b/moduleFile1.ts"; + moduleFile.path = moduleFileNewPath; + host.reloadFS([moduleFile, file1, configFile]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + + moduleFile.path = moduleFileOldPath; + host.reloadFS([moduleFile, file1, configFile]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("should property handle missing config files", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: "{}" + }; + const projectName = "project1"; + const host = createServerHost([f1]); + const projectService = createProjectService(host); + projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); + + // should have one external project since config file is missing + projectService.checkNumberOfProjects({ externalProjects: 1 }); + + host.reloadFS([f1, config]); + projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + }); + + it("types should load from config file path if config exists", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { types: ["node"], typeRoots: [] } }) + }; + const node = { + path: "/a/b/node_modules/@types/node/index.d.ts", + content: "declare var process: any" + }; + const cwd = { + path: "/a/c" + }; + const host = createServerHost([f1, config, node, cwd], { currentDirectory: cwd.path }); + const projectService = createProjectService(host); + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, node.path, config.path]); + }); + }); + + describe("resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { + it("should remove the `module not found` error", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const host = createServerHost([file1]); + const session = createSession(host); + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + + host.reloadFS([file1, moduleFile]); + host.runQueuedTimeoutCallbacks(); + + // Make a change to trigger the program rebuild + const changeRequest = makeSessionRequest( + server.CommandNames.Change, + { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } + ); + session.executeCommand(changeRequest); + + // Recheck + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("npm install @types works", () => { + const folderPath = "/a/b/projects/temp"; + const file1: File = { + path: `${folderPath}/a.ts`, + content: 'import f = require("pad"); f;' + }; + const files = [file1, libFile]; + const host = createServerHost(files); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { + file: file1.path, + fileContent: file1.content, + scriptKindName: "TS", + projectRootPath: folderPath + } + }); + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file1.path] + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + const startOffset = file1.content.indexOf('"') + 1; + checkErrorMessage(session, "semanticDiag", { + file: file1.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + '"pad"'.length }, Diagnostics.Cannot_find_module_0, ["pad"]) + ], + }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: file1.path, diagnostics: [] }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + + const padIndex: File = { + path: `${folderPath}/node_modules/@types/pad/index.d.ts`, + content: "export = pad;declare function pad(length: number, text: string, char ?: string): string;" + }; + files.push(padIndex); + host.reloadFS(files, { ignoreWatchInvokedWithTriggerAsFileCreate: true }); + host.runQueuedTimeoutCallbacks(); + checkProjectUpdatedInBackgroundEvent(session, [file1.path]); + session.clearMessages(); + + host.runQueuedTimeoutCallbacks(); + checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] }); + }); + + it("suggestion diagnostics", () => { + const file: File = { + path: "/a.js", + content: "function f(p) {}", + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + host.checkTimeoutQueueLengthAndRun(2); + + checkProjectUpdatedInBackgroundEvent(session, [file.path]); + session.clearMessages(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "suggestionDiag", { + file: file.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecessary*/ true), + ], + }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + }); + + it("disable suggestion diagnostics", () => { + const file: File = { + path: "/a.js", + content: 'require("b")', + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + session.executeCommandSeq({ + command: server.CommandNames.Configure, + arguments: { + preferences: { disableSuggestions: true } + }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + host.checkTimeoutQueueLengthAndRun(2); + + checkProjectUpdatedInBackgroundEvent(session, [file.path]); + session.clearMessages(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); + // No suggestion event, we're done. + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + }); + + it("suppressed diagnostic events", () => { + const file: File = { + path: "/a.ts", + content: "1 = 2;", + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true, suppressDiagnosticEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + session.clearMessages(); + + let expectedSequenceId = session.getNextSeq(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + checkCompleteEvent(session, 1, expectedSequenceId); + + session.clearMessages(); + + expectedSequenceId = session.getNextSeq(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + file: file.path, + } + }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + checkCompleteEvent(session, 1, expectedSequenceId); + + session.clearMessages(); + }); + }); } diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts index 18e6f5c6194..b6154f46b71 100644 --- a/src/testRunner/unittests/tsserverHelpers.ts +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -599,23 +599,23 @@ namespace ts.projectSystem { } } - //interface ErrorInformation { - // diagnosticMessage: DiagnosticMessage; - // errorTextArguments?: string[]; - //} + export interface ErrorInformation { + diagnosticMessage: DiagnosticMessage; + errorTextArguments?: string[]; + } - //function getProtocolDiagnosticMessage({ diagnosticMessage, errorTextArguments = [] }: ErrorInformation) { - // return formatStringFromArgs(diagnosticMessage.message, errorTextArguments); - //} + function getProtocolDiagnosticMessage({ diagnosticMessage, errorTextArguments = [] }: ErrorInformation) { + return formatStringFromArgs(diagnosticMessage.message, errorTextArguments); + } - //function verifyDiagnostics(actual: server.protocol.Diagnostic[], expected: ErrorInformation[]) { - // const expectedErrors = expected.map(getProtocolDiagnosticMessage); - // assert.deepEqual(actual.map(diag => flattenDiagnosticMessageText(diag.text, "\n")), expectedErrors); - //} + export function verifyDiagnostics(actual: ReadonlyArray, expected: ReadonlyArray) { + const expectedErrors = expected.map(getProtocolDiagnosticMessage); + assert.deepEqual(actual.map(diag => flattenDiagnosticMessageText(diag.text, "\n")), expectedErrors); + } - //function verifyNoDiagnostics(actual: server.protocol.Diagnostic[]) { - // verifyDiagnostics(actual, []); - //} + export function verifyNoDiagnostics(actual: server.protocol.Diagnostic[]) { + verifyDiagnostics(actual, []); + } export function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); @@ -629,15 +629,15 @@ namespace ts.projectSystem { checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); } - //function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { - // checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); - //} + export function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { + checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); + } - //function checkNoDiagnosticEvents(session: TestSession) { - // for (const event of session.events) { - // assert.isFalse(event.event.endsWith("Diag"), JSON.stringify(event)); - // } - //} + export function checkNoDiagnosticEvents(session: TestSession) { + for (const event of session.events) { + assert.isFalse(event.event.endsWith("Diag"), JSON.stringify(event)); + } + } export function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { const events = session.events; diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 0c6382f13c4..624b11d8d99 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -36,34 +36,6 @@ namespace ts.projectSystem { return documentSpanFromSubstring(file, substring, options); } - interface ErrorInformation { - diagnosticMessage: DiagnosticMessage; - errorTextArguments?: string[]; - } - - function getProtocolDiagnosticMessage({ diagnosticMessage, errorTextArguments = [] }: ErrorInformation) { - return formatStringFromArgs(diagnosticMessage.message, errorTextArguments); - } - - function verifyDiagnostics(actual: server.protocol.Diagnostic[], expected: ErrorInformation[]) { - const expectedErrors = expected.map(getProtocolDiagnosticMessage); - assert.deepEqual(actual.map(diag => flattenDiagnosticMessageText(diag.text, "\n")), expectedErrors); - } - - function verifyNoDiagnostics(actual: server.protocol.Diagnostic[]) { - verifyDiagnostics(actual, []); - } - - function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { - checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); - } - - function checkNoDiagnosticEvents(session: TestSession) { - for (const event of session.events) { - assert.isFalse(event.event.endsWith("Diag"), JSON.stringify(event)); - } - } - describe("tsserverProjectSystem general functionality", () => { const commonFile1: File = { path: "/a/b/commonFile1.ts", @@ -3860,597 +3832,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem rename a module file and rename back", () => { - it("should restore the states for inferred projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const host = createServerHost([moduleFile, file1]); - const session = createSession(host); - - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - assert.equal(diags.length, 1); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1]); - host.runQueuedTimeoutCallbacks(); - - // Make a change to trigger the program rebuild - const changeRequest = makeSessionRequest( - server.CommandNames.Change, - { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } - ); - session.executeCommand(changeRequest); - host.runQueuedTimeoutCallbacks(); - - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("should restore the states for configured projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createServerHost([moduleFile, file1, configFile]); - const session = createSession(host); - - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1, configFile]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1, configFile]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("should property handle missing config files", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: "{}" - }; - const projectName = "project1"; - const host = createServerHost([f1]); - const projectService = createProjectService(host); - projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); - - // should have one external project since config file is missing - projectService.checkNumberOfProjects({ externalProjects: 1 }); - - host.reloadFS([f1, config]); - projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - }); - - it("types should load from config file path if config exists", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { types: ["node"], typeRoots: [] } }) - }; - const node = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: "declare var process: any" - }; - const cwd = { - path: "/a/c" - }; - const host = createServerHost([f1, config, node, cwd], { currentDirectory: cwd.path }); - const projectService = createProjectService(host); - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, node.path, config.path]); - }); - }); - - describe("tsserverProjectSystem add the missing module file for inferred project", () => { - it("should remove the `module not found` error", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const host = createServerHost([file1]); - const session = createSession(host); - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - - host.reloadFS([file1, moduleFile]); - host.runQueuedTimeoutCallbacks(); - - // Make a change to trigger the program rebuild - const changeRequest = makeSessionRequest( - server.CommandNames.Change, - { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } - ); - session.executeCommand(changeRequest); - - // Recheck - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("npm install @types works", () => { - const folderPath = "/a/b/projects/temp"; - const file1: File = { - path: `${folderPath}/a.ts`, - content: 'import f = require("pad"); f;' - }; - const files = [file1, libFile]; - const host = createServerHost(files); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { - file: file1.path, - fileContent: file1.content, - scriptKindName: "TS", - projectRootPath: folderPath - } - }); - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file1.path] - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - const startOffset = file1.content.indexOf('"') + 1; - checkErrorMessage(session, "semanticDiag", { - file: file1.path, - diagnostics: [ - createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + '"pad"'.length }, Diagnostics.Cannot_find_module_0, ["pad"]) - ], - }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - checkErrorMessage(session, "suggestionDiag", { file: file1.path, diagnostics: [] }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - - const padIndex: File = { - path: `${folderPath}/node_modules/@types/pad/index.d.ts`, - content: "export = pad;declare function pad(length: number, text: string, char ?: string): string;" - }; - files.push(padIndex); - host.reloadFS(files, { ignoreWatchInvokedWithTriggerAsFileCreate: true }); - host.runQueuedTimeoutCallbacks(); - checkProjectUpdatedInBackgroundEvent(session, [file1.path]); - session.clearMessages(); - - host.runQueuedTimeoutCallbacks(); - checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] }); - }); - - it("suggestion diagnostics", () => { - const file: File = { - path: "/a.js", - content: "function f(p) {}", - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - host.checkTimeoutQueueLengthAndRun(2); - - checkProjectUpdatedInBackgroundEvent(session, [file.path]); - session.clearMessages(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - - checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "suggestionDiag", { - file: file.path, - diagnostics: [ - createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecessary*/ true), - ], - }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - }); - - it("disable suggestion diagnostics", () => { - const file: File = { - path: "/a.js", - content: 'require("b")', - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - session.executeCommandSeq({ - command: server.CommandNames.Configure, - arguments: { - preferences: { disableSuggestions: true } - }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - host.checkTimeoutQueueLengthAndRun(2); - - checkProjectUpdatedInBackgroundEvent(session, [file.path]); - session.clearMessages(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - - checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); - // No suggestion event, we're done. - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - }); - - it("suppressed diagnostic events", () => { - const file: File = { - path: "/a.ts", - content: "1 = 2;", - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true, suppressDiagnosticEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - session.clearMessages(); - - let expectedSequenceId = session.getNextSeq(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - checkCompleteEvent(session, 1, expectedSequenceId); - - session.clearMessages(); - - expectedSequenceId = session.getNextSeq(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - file: file.path, - } - }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - checkCompleteEvent(session, 1, expectedSequenceId); - - session.clearMessages(); - }); - }); - - describe("tsserverProjectSystem Configure file diagnostics events", () => { - function getUnknownCompilerOptionDiagnostic(configFile: File, prop: string): ConfigFileDiagnostic { - const d = Diagnostics.Unknown_compiler_option_0; - const start = configFile.content.indexOf(prop) - 1; // start at "prop" - return { - fileName: configFile.path, - start, - length: prop.length + 2, - messageText: formatStringFromArgs(d.message, [prop]), - category: d.category, - code: d.code, - reportsUnnecessary: undefined - }; - } - - function getFileNotFoundDiagnostic(configFile: File, relativeFileName: string): ConfigFileDiagnostic { - const findString = `{"path":"./${relativeFileName}"}`; - const d = Diagnostics.File_0_not_found; - const start = configFile.content.indexOf(findString); - return { - fileName: configFile.path, - start, - length: findString.length, - messageText: formatStringFromArgs(d.message, [`${getDirectoryPath(configFile.path)}/${relativeFileName}`]), - category: d.category, - code: d.code, - reportsUnnecessary: undefined - }; - } - - it("are generated when the config file has errors", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "foo": "bar", - "allowJS": true - } - }` - }; - const serverEventManager = new TestServerEventManager([file, libFile, configFile]); - openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ - getUnknownCompilerOptionDiagnostic(configFile, "foo"), - getUnknownCompilerOptionDiagnostic(configFile, "allowJS") - ]); - }); - - it("are generated when the config file doesn't have errors", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {} - }` - }; - const serverEventManager = new TestServerEventManager([file, libFile, configFile]); - openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); - }); - - it("are generated when the config file changes", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {} - }` - }; - - const files = [file, libFile, configFile]; - const serverEventManager = new TestServerEventManager(files); - openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); - - configFile.content = `{ - "compilerOptions": { - "haha": 123 - } - }`; - serverEventManager.host.reloadFS(files); - serverEventManager.host.runQueuedTimeoutCallbacks(); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, [ - getUnknownCompilerOptionDiagnostic(configFile, "haha") - ]); - - configFile.content = `{ - "compilerOptions": {} - }`; - serverEventManager.host.reloadFS(files); - serverEventManager.host.runQueuedTimeoutCallbacks(); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, emptyArray); - }); - - it("are not generated when the config file does not include file opened and config file has errors", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const file2: File = { - path: "/a/b/test.ts", - content: "let x = 10" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "foo": "bar", - "allowJS": true - }, - "files": ["app.ts"] - }` - }; - const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); - openFilesForSession([file2], serverEventManager.session); - serverEventManager.hasZeroEvent("configFileDiag"); - }); - - it("are not generated when the config file has errors but suppressDiagnosticEvents is true", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "foo": "bar", - "allowJS": true - } - }` - }; - const serverEventManager = new TestServerEventManager([file, libFile, configFile], /*suppressDiagnosticEvents*/ true); - openFilesForSession([file], serverEventManager.session); - serverEventManager.hasZeroEvent("configFileDiag"); - }); - - it("are not generated when the config file does not include file opened and doesnt contain any errors", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const file2: File = { - path: "/a/b/test.ts", - content: "let x = 10" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "files": ["app.ts"] - }` - }; - - const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); - openFilesForSession([file2], serverEventManager.session); - serverEventManager.hasZeroEvent("configFileDiag"); - }); - - it("contains the project reference errors", () => { - const file: File = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const noSuchTsconfig = "no-such-tsconfig.json"; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: `{ - "files": ["app.ts"], - "references": [{"path":"./${noSuchTsconfig}"}] - }` - }; - - const serverEventManager = new TestServerEventManager([file, libFile, configFile]); - openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ - getFileNotFoundDiagnostic(configFile, noSuchTsconfig) - ]); - }); - }); - describe("tsserverProjectSystem skipLibCheck", () => { it("should be turned on for js-only inferred projects", () => { const file1 = { @@ -5698,70 +5079,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem Options Diagnostic locations reported correctly with changes in configFile contents", () => { - it("when options change", () => { - const file = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFileContentBeforeComment = `{`; - const configFileContentComment = ` - // comment`; - const configFileContentAfterComment = ` - "compilerOptions": { - "allowJs": true, - "declaration": true - } - }`; - const configFileContentWithComment = configFileContentBeforeComment + configFileContentComment + configFileContentAfterComment; - const configFileContentWithoutCommentLine = configFileContentBeforeComment + configFileContentAfterComment; - - const configFile = { - path: "/a/b/tsconfig.json", - content: configFileContentWithComment - }; - const host = createServerHost([file, libFile, configFile]); - const session = createSession(host); - openFilesForSession([file], session); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const projectName = configuredProjectAt(projectService, 0).getProjectName(); - - const diags = session.executeCommand({ - type: "request", - command: server.CommandNames.SemanticDiagnosticsSync, - seq: 2, - arguments: { file: configFile.path, projectFileName: projectName, includeLinePosition: true } - }).response as ReadonlyArray; - assert.isTrue(diags.length === 2); - - configFile.content = configFileContentWithoutCommentLine; - host.reloadFS([file, configFile]); - - const diagsAfterEdit = session.executeCommand({ - type: "request", - command: server.CommandNames.SemanticDiagnosticsSync, - seq: 2, - arguments: { file: configFile.path, projectFileName: projectName, includeLinePosition: true } - }).response as ReadonlyArray; - assert.isTrue(diagsAfterEdit.length === 2); - - verifyDiagnostic(diags[0], diagsAfterEdit[0]); - verifyDiagnostic(diags[1], diagsAfterEdit[1]); - - function verifyDiagnostic(beforeEditDiag: server.protocol.DiagnosticWithLinePosition, afterEditDiag: server.protocol.DiagnosticWithLinePosition) { - assert.equal(beforeEditDiag.message, afterEditDiag.message); - assert.equal(beforeEditDiag.code, afterEditDiag.code); - assert.equal(beforeEditDiag.category, afterEditDiag.category); - assert.equal(beforeEditDiag.startLocation.line, afterEditDiag.startLocation.line + 1); - assert.equal(beforeEditDiag.startLocation.offset, afterEditDiag.startLocation.offset); - assert.equal(beforeEditDiag.endLocation.line, afterEditDiag.endLocation.line + 1); - assert.equal(beforeEditDiag.endLocation.offset, afterEditDiag.endLocation.offset); - } - }); - }); - describe("tsserverProjectSystem refactors", () => { it("use formatting options", () => { const file = { @@ -8735,35 +8052,6 @@ fn5(); }); }); - describe("tsserverProjectSystem config file change", () => { - it("Updates diagnostics when '--noUnusedLabels' changes", () => { - const aTs: File = { path: "/a.ts", content: "label: while (1) {}" }; - const options = (allowUnusedLabels: boolean) => `{ "compilerOptions": { "allowUnusedLabels": ${allowUnusedLabels} } }`; - const tsconfig: File = { path: "/tsconfig.json", content: options(/*allowUnusedLabels*/ true) }; - - const host = createServerHost([aTs, tsconfig]); - const session = createSession(host); - openFilesForSession([aTs], session); - - host.modifyFile(tsconfig.path, options(/*allowUnusedLabels*/ false)); - host.runQueuedTimeoutCallbacks(); - - const response = executeSessionRequest(session, protocol.CommandTypes.SemanticDiagnosticsSync, { file: aTs.path }) as protocol.Diagnostic[] | undefined; - assert.deepEqual(response, [ - { - start: { line: 1, offset: 1 }, - end: { line: 1, offset: 1 + "label".length }, - text: "Unused label.", - category: "error", - code: Diagnostics.Unused_label.code, - relatedInformation: undefined, - reportsUnnecessary: true, - source: undefined, - }, - ]); - }); - }); - describe("tsserverProjectSystem with metadata in response", () => { const metadata = "Extra Info"; function verifyOutput(host: TestServerHost, expectedResponse: protocol.Response) { From 160c73f9420bcc9dfa556d2aef70850ec809f19a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 13:12:14 -0800 Subject: [PATCH 234/322] Separate out caching file system test --- src/testRunner/tsconfig.json | 1 + .../tsserverCachingFileSystemInformation.ts | 704 +++++++++++++++++ src/testRunner/unittests/tsserverHelpers.ts | 10 +- .../unittests/tsserverProjectSystem.ts | 707 ------------------ 4 files changed, 708 insertions(+), 714 deletions(-) create mode 100644 src/testRunner/unittests/tsserverCachingFileSystemInformation.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index ba46706ee16..daad5a29b6a 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -88,6 +88,7 @@ "unittests/tsconfigParsing.ts", "unittests/tscWatchEmit.ts", "unittests/tscWatchMode.ts", + "unittests/tsserverCachingFileSystemInformation.ts", "unittests/tsserverLargeFileReferencedEvent.ts", "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", diff --git a/src/testRunner/unittests/tsserverCachingFileSystemInformation.ts b/src/testRunner/unittests/tsserverCachingFileSystemInformation.ts new file mode 100644 index 00000000000..65e1ec564d3 --- /dev/null +++ b/src/testRunner/unittests/tsserverCachingFileSystemInformation.ts @@ -0,0 +1,704 @@ +namespace ts.projectSystem { + function getNumberOfWatchesInvokedForRecursiveWatches(recursiveWatchedDirs: string[], file: string) { + return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); + } + + describe("tsserverCachingFileSystemInformation:: tsserverProjectSystem CachingFileSystemInformation", () => { + enum CalledMapsWithSingleArg { + fileExists = "fileExists", + directoryExists = "directoryExists", + getDirectories = "getDirectories", + readFile = "readFile" + } + enum CalledMapsWithFiveArgs { + readDirectory = "readDirectory" + } + type CalledMaps = CalledMapsWithSingleArg | CalledMapsWithFiveArgs; + function createCallsTrackingHost(host: TestServerHost) { + const calledMaps: Record> & Record, ReadonlyArray, ReadonlyArray, number]>> = { + fileExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.fileExists), + directoryExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.directoryExists), + getDirectories: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.getDirectories), + readFile: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.readFile), + readDirectory: setCallsTrackingWithFiveArgFn(CalledMapsWithFiveArgs.readDirectory) + }; + + return { + verifyNoCall, + verifyCalledOnEachEntryNTimes, + verifyCalledOnEachEntry, + verifyNoHostCalls, + verifyNoHostCallsExceptFileExistsOnce, + verifyCalledOn, + clear + }; + + function setCallsTrackingWithSingleArgFn(prop: CalledMapsWithSingleArg) { + const calledMap = createMultiMap(); + const cb = (host)[prop].bind(host); + (host)[prop] = (f: string) => { + calledMap.add(f, /*value*/ true); + return cb(f); + }; + return calledMap; + } + + function setCallsTrackingWithFiveArgFn(prop: CalledMapsWithFiveArgs) { + const calledMap = createMultiMap<[U, V, W, X]>(); + const cb = (host)[prop].bind(host); + (host)[prop] = (f: string, arg1?: U, arg2?: V, arg3?: W, arg4?: X) => { + calledMap.add(f, [arg1!, arg2!, arg3!, arg4!]); // TODO: GH#18217 + return cb(f, arg1, arg2, arg3, arg4); + }; + return calledMap; + } + + function verifyCalledOn(callback: CalledMaps, name: string) { + const calledMap = calledMaps[callback]; + const result = calledMap.get(name); + assert.isTrue(result && !!result.length, `${callback} should be called with name: ${name}: ${arrayFrom(calledMap.keys())}`); + } + + function verifyNoCall(callback: CalledMaps) { + const calledMap = calledMaps[callback]; + assert.equal(calledMap.size, 0, `${callback} shouldn't be called: ${arrayFrom(calledMap.keys())}`); + } + + function verifyCalledOnEachEntry(callback: CalledMaps, expectedKeys: Map) { + TestFSWithWatch.checkMultiMapKeyCount(callback, calledMaps[callback], expectedKeys); + } + + function verifyCalledOnEachEntryNTimes(callback: CalledMaps, expectedKeys: ReadonlyArray, nTimes: number) { + TestFSWithWatch.checkMultiMapKeyCount(callback, calledMaps[callback], expectedKeys, nTimes); + } + + function verifyNoHostCalls() { + iterateOnCalledMaps(key => verifyNoCall(key)); + } + + function verifyNoHostCallsExceptFileExistsOnce(expectedKeys: ReadonlyArray) { + verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, expectedKeys, 1); + verifyNoCall(CalledMapsWithSingleArg.directoryExists); + verifyNoCall(CalledMapsWithSingleArg.getDirectories); + verifyNoCall(CalledMapsWithSingleArg.readFile); + verifyNoCall(CalledMapsWithFiveArgs.readDirectory); + } + + function clear() { + iterateOnCalledMaps(key => calledMaps[key].clear()); + } + + function iterateOnCalledMaps(cb: (key: CalledMaps) => void) { + for (const key in CalledMapsWithSingleArg) { + cb(key as CalledMapsWithSingleArg); + } + for (const key in CalledMapsWithFiveArgs) { + cb(key as CalledMapsWithFiveArgs); + } + } + } + + it("works using legacy resolution logic", () => { + let rootContent = `import {x} from "f1"`; + const root: File = { + path: "/c/d/f0.ts", + content: rootContent + }; + + const imported: File = { + path: "/c/f1.ts", + content: `foo()` + }; + + const host = createServerHost([root, imported]); + const projectService = createProjectService(host); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); + projectService.openClientFile(root.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const project = projectService.inferredProjects[0]; + const rootScriptInfo = project.getRootScriptInfos()[0]; + assert.equal(rootScriptInfo.fileName, root.path); + + // ensure that imported file was found + verifyImportedDiagnostics(); + + const callsTrackingHost = createCallsTrackingHost(host); + + // trigger synchronization to make sure that import will be fetched from the cache + // ensure file has correct number of errors after edit + editContent(`import {x} from "f1"; + var x: string = 1;`); + verifyImportedDiagnostics(); + callsTrackingHost.verifyNoHostCalls(); + + // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + editContent(`import {x} from "f2"`); + try { + // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + verifyImportedDiagnostics(); + assert.isTrue(false, `should not find file '${imported.path}'`); + } + catch (e) { + assert.isTrue(e.message.indexOf(`Could not find file: '${imported.path}'.`) === 0); + } + const f2Lookups = getLocationsForModuleLookup("f2"); + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f2Lookups, 1); + const f2DirLookups = getLocationsForDirectoryLookup(); + callsTrackingHost.verifyCalledOnEachEntry(CalledMapsWithSingleArg.directoryExists, f2DirLookups); + callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); + callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.readFile); + callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); + + editContent(`import {x} from "f1"`); + verifyImportedDiagnostics(); + const f1Lookups = f2Lookups.map(s => s.replace("f2", "f1")); + f1Lookups.length = f1Lookups.indexOf(imported.path) + 1; + const f1DirLookups = ["/c/d", "/c", ...mapCombinedPathsInAncestor(getDirectoryPath(root.path), nodeModulesAtTypes, returnTrue)]; + vertifyF1Lookups(); + + // setting compiler options discards module resolution cache + callsTrackingHost.clear(); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true, target: ScriptTarget.ES5 }); + verifyImportedDiagnostics(); + vertifyF1Lookups(); + + function vertifyF1Lookups() { + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f1Lookups, 1); + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.directoryExists, f1DirLookups, 1); + callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); + callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.readFile); + callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); + } + + function editContent(newContent: string) { + callsTrackingHost.clear(); + rootScriptInfo.editContent(0, rootContent.length, newContent); + rootContent = newContent; + } + + function verifyImportedDiagnostics() { + const diags = project.getLanguageService().getSemanticDiagnostics(imported.path); + assert.equal(diags.length, 1); + const diag = diags[0]; + assert.equal(diag.code, Diagnostics.Cannot_find_name_0.code); + assert.equal(flattenDiagnosticMessageText(diag.messageText, "\n"), "Cannot find name 'foo'."); + } + + function getLocationsForModuleLookup(module: string) { + const locations: string[] = []; + forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { + locations.push( + combinePaths(ancestor, `${module}.ts`), + combinePaths(ancestor, `${module}.tsx`), + combinePaths(ancestor, `${module}.d.ts`) + ); + }); + forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { + locations.push( + combinePaths(ancestor, `${module}.js`), + combinePaths(ancestor, `${module}.jsx`) + ); + }); + return locations; + } + + function getLocationsForDirectoryLookup() { + const result = createMap(); + forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { + // To resolve modules + result.set(ancestor, 2); + // for type roots + result.set(combinePaths(ancestor, nodeModules), 1); + result.set(combinePaths(ancestor, nodeModulesAtTypes), 1); + }); + return result; + } + }); + + it("loads missing files from disk", () => { + const root: File = { + path: "/c/foo.ts", + content: `import {y} from "bar"` + }; + + const imported: File = { + path: "/c/bar.d.ts", + content: `export var y = 1` + }; + + const host = createServerHost([root]); + const projectService = createProjectService(host); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); + const callsTrackingHost = createCallsTrackingHost(host); + projectService.openClientFile(root.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const project = projectService.inferredProjects[0]; + const rootScriptInfo = project.getRootScriptInfos()[0]; + assert.equal(rootScriptInfo.fileName, root.path); + + let diags = project.getLanguageService().getSemanticDiagnostics(root.path); + assert.equal(diags.length, 1); + const diag = diags[0]; + assert.equal(diag.code, Diagnostics.Cannot_find_module_0.code); + assert.equal(flattenDiagnosticMessageText(diag.messageText, "\n"), "Cannot find module 'bar'."); + callsTrackingHost.verifyCalledOn(CalledMapsWithSingleArg.fileExists, imported.path); + + + callsTrackingHost.clear(); + host.reloadFS([root, imported]); + host.runQueuedTimeoutCallbacks(); + diags = project.getLanguageService().getSemanticDiagnostics(root.path); + assert.equal(diags.length, 0); + callsTrackingHost.verifyCalledOn(CalledMapsWithSingleArg.fileExists, imported.path); + }); + + it("when calling goto definition of module", () => { + const clientFile: File = { + path: "/a/b/controllers/vessels/client.ts", + content: ` + import { Vessel } from '~/models/vessel'; + const v = new Vessel(); + ` + }; + const anotherModuleFile: File = { + path: "/a/b/utils/db.ts", + content: "export class Bookshelf { }" + }; + const moduleFile: File = { + path: "/a/b/models/vessel.ts", + content: ` + import { Bookshelf } from '~/utils/db'; + export class Vessel extends Bookshelf {} + ` + }; + const tsconfigFile: File = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + target: "es6", + module: "es6", + baseUrl: "./", // all paths are relative to the baseUrl + paths: { + "~/*": ["*"] // resolve any `~/foo/bar` to `/foo/bar` + } + }, + exclude: [ + "api", + "build", + "node_modules", + "public", + "seeds", + "sql_updates", + "tests.build" + ] + }) + }; + const projectFiles = [clientFile, anotherModuleFile, moduleFile, tsconfigFile]; + const host = createServerHost(projectFiles); + const session = createSession(host); + const projectService = session.getProjectService(); + const { configFileName } = projectService.openClientFile(clientFile.path); + + assert.isDefined(configFileName, `should find config`); + checkNumberOfConfiguredProjects(projectService, 1); + + const project = projectService.configuredProjects.get(tsconfigFile.path)!; + checkProjectActualFiles(project, map(projectFiles, f => f.path)); + + const callsTrackingHost = createCallsTrackingHost(host); + + // Get definitions shouldnt make host requests + const getDefinitionRequest = makeSessionRequest(protocol.CommandTypes.Definition, { + file: clientFile.path, + position: clientFile.content.indexOf("/vessel") + 1, + line: undefined!, // TODO: GH#18217 + offset: undefined! // TODO: GH#18217 + }); + const response = session.executeCommand(getDefinitionRequest).response as server.protocol.FileSpan[]; + assert.equal(response[0].file, moduleFile.path, "Should go to definition of vessel: response: " + JSON.stringify(response)); + callsTrackingHost.verifyNoHostCalls(); + + // Open the file should call only file exists on module directory and use cached value for parental directory + const { configFileName: config2 } = projectService.openClientFile(moduleFile.path); + assert.equal(config2, configFileName); + callsTrackingHost.verifyNoHostCallsExceptFileExistsOnce(["/a/b/models/tsconfig.json", "/a/b/models/jsconfig.json"]); + + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(tsconfigFile.path), project); + }); + + describe("WatchDirectories for config file with", () => { + function verifyWatchDirectoriesCaseSensitivity(useCaseSensitiveFileNames: boolean) { + const frontendDir = "/Users/someuser/work/applications/frontend"; + const toCanonical: (s: string) => Path = useCaseSensitiveFileNames ? s => s as Path : s => s.toLowerCase() as Path; + const canonicalFrontendDir = toCanonical(frontendDir); + const file1: File = { + path: `${frontendDir}/src/app/utils/Analytic.ts`, + content: "export class SomeClass { };" + }; + const file2: File = { + path: `${frontendDir}/src/app/redux/configureStore.ts`, + content: "export class configureStore { }" + }; + const file3: File = { + path: `${frontendDir}/src/app/utils/Cookie.ts`, + content: "export class Cookie { }" + }; + const es2016LibFile: File = { + path: "/a/lib/lib.es2016.full.d.ts", + content: libFile.content + }; + const typeRoots = ["types", "node_modules/@types"]; + const types = ["node", "jest"]; + const tsconfigFile: File = { + path: `${frontendDir}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { + strict: true, + strictNullChecks: true, + target: "es2016", + module: "commonjs", + moduleResolution: "node", + sourceMap: true, + noEmitOnError: true, + experimentalDecorators: true, + emitDecoratorMetadata: true, + types, + noUnusedLocals: true, + outDir: "./compiled", + typeRoots, + baseUrl: ".", + paths: { + "*": [ + "types/*" + ] + } + }, + include: [ + "src/**/*" + ], + exclude: [ + "node_modules", + "compiled" + ] + }) + }; + const projectFiles = [file1, file2, es2016LibFile, tsconfigFile]; + const host = createServerHost(projectFiles, { useCaseSensitiveFileNames }); + const projectService = createProjectService(host); + const canonicalConfigPath = toCanonical(tsconfigFile.path); + const { configFileName } = projectService.openClientFile(file1.path); + assert.equal(configFileName, tsconfigFile.path as server.NormalizedPath, `should find config`); // tslint:disable-line no-unnecessary-type-assertion (TODO: GH#18217) + checkNumberOfConfiguredProjects(projectService, 1); + const watchingRecursiveDirectories = [`${canonicalFrontendDir}/src`, `${canonicalFrontendDir}/types`, `${canonicalFrontendDir}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(canonicalFrontendDir))); + + const project = projectService.configuredProjects.get(canonicalConfigPath)!; + verifyProjectAndWatchedDirectories(); + + const callsTrackingHost = createCallsTrackingHost(host); + + // Create file cookie.ts + projectFiles.push(file3); + host.reloadFS(projectFiles); + host.runQueuedTimeoutCallbacks(); + + const canonicalFile3Path = useCaseSensitiveFileNames ? file3.path : file3.path.toLocaleLowerCase(); + const numberOfTimesWatchInvoked = getNumberOfWatchesInvokedForRecursiveWatches(watchingRecursiveDirectories, canonicalFile3Path); + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, [canonicalFile3Path], numberOfTimesWatchInvoked); + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.directoryExists, [canonicalFile3Path], numberOfTimesWatchInvoked); + callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); + callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.readFile, [file3.path], 1); + callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); + + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(canonicalConfigPath), project); + verifyProjectAndWatchedDirectories(); + + callsTrackingHost.clear(); + + const { configFileName: configFile2 } = projectService.openClientFile(file3.path); + assert.equal(configFile2, configFileName); + + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(canonicalConfigPath), project); + verifyProjectAndWatchedDirectories(); + callsTrackingHost.verifyNoHostCalls(); + + function getFilePathIfNotOpen(f: File) { + const path = toCanonical(f.path); + const info = projectService.getScriptInfoForPath(toCanonical(f.path)); + return info && info.isScriptOpen() ? undefined : path; + } + + function verifyProjectAndWatchedDirectories() { + checkProjectActualFiles(project, map(projectFiles, f => f.path)); + checkWatchedFiles(host, mapDefined(projectFiles, getFilePathIfNotOpen)); + checkWatchedDirectories(host, watchingRecursiveDirectories, /*recursive*/ true); + checkWatchedDirectories(host, [], /*recursive*/ false); + } + } + + it("case insensitive file system", () => { + verifyWatchDirectoriesCaseSensitivity(/*useCaseSensitiveFileNames*/ false); + }); + + it("case sensitive file system", () => { + verifyWatchDirectoriesCaseSensitivity(/*useCaseSensitiveFileNames*/ true); + }); + }); + + describe("Subfolder invalidations correctly include parent folder failed lookup locations", () => { + function runFailedLookupTest(resolution: "Node" | "Classic") { + const projectLocation = "/proj"; + const file1: File = { + path: `${projectLocation}/foo/boo/app.ts`, + content: `import * as debug from "debug"` + }; + const file2: File = { + path: `${projectLocation}/foo/boo/moo/app.ts`, + content: `import * as debug from "debug"` + }; + const tsconfig: File = { + path: `${projectLocation}/tsconfig.json`, + content: JSON.stringify({ + files: ["foo/boo/app.ts", "foo/boo/moo/app.ts"], + moduleResolution: resolution + }) + }; + + const files = [file1, file2, tsconfig, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(file1.path); + + const project = service.configuredProjects.get(tsconfig.path)!; + checkProjectActualFiles(project, files.map(f => f.path)); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file1.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file2.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); + + const debugTypesFile: File = { + path: `${projectLocation}/node_modules/debug/index.d.ts`, + content: "export {}" + }; + files.push(debugTypesFile); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkProjectActualFiles(project, files.map(f => f.path)); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file1.path).map(diag => diag.messageText), []); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file2.path).map(diag => diag.messageText), []); + } + + it("Includes the parent folder FLLs in node module resolution mode", () => { + runFailedLookupTest("Node"); + }); + it("Includes the parent folder FLLs in classic module resolution mode", () => { + runFailedLookupTest("Classic"); + }); + }); + + describe("Verify npm install in directory with tsconfig file works when", () => { + function verifyNpmInstall(timeoutDuringPartialInstallation: boolean) { + const root = "/user/username/rootfolder/otherfolder"; + const getRootedFileOrFolder = (fileOrFolder: File) => { + fileOrFolder.path = root + fileOrFolder.path; + return fileOrFolder; + }; + const app: File = getRootedFileOrFolder({ + path: "/a/b/app.ts", + content: "import _ from 'lodash';" + }); + const tsconfigJson: File = getRootedFileOrFolder({ + path: "/a/b/tsconfig.json", + content: '{ "compilerOptions": { } }' + }); + const packageJson: File = getRootedFileOrFolder({ + path: "/a/b/package.json", + content: ` +{ + "name": "test", + "version": "1.0.0", + "description": "", + "main": "index.js", + "dependencies": { + "lodash", + "rxjs" + }, + "devDependencies": { + "@types/lodash", + "typescript" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} +` + }); + const appFolder = getDirectoryPath(app.path); + const projectFiles = [app, libFile, tsconfigJson]; + const typeRootDirectories = getTypeRootsFromLocation(getDirectoryPath(tsconfigJson.path)); + const otherFiles = [packageJson]; + const host = createServerHost(projectFiles.concat(otherFiles)); + const projectService = createProjectService(host); + const { configFileName } = projectService.openClientFile(app.path); + assert.equal(configFileName, tsconfigJson.path as server.NormalizedPath, `should find config`); // TODO: GH#18217 + const recursiveWatchedDirectories: string[] = [`${appFolder}`, `${appFolder}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(appFolder))); + verifyProject(); + + let npmInstallComplete = false; + + // Simulate npm install + const filesAndFoldersToAdd: File[] = [ + { path: "/a/b/node_modules" }, + { path: "/a/b/node_modules/.staging/@types" }, + { path: "/a/b/node_modules/.staging/lodash-b0733faa" }, + { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61" }, + { path: "/a/b/node_modules/.staging/typescript-8493ea5d" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/package.json", content: "{\n \"name\": \"symbol-observable\",\n \"version\": \"1.0.4\",\n \"description\": \"Symbol.observable ponyfill\",\n \"license\": \"MIT\",\n \"repository\": \"blesh/symbol-observable\",\n \"author\": {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"engines\": {\n \"node\": \">=0.10.0\"\n },\n \"scripts\": {\n \"test\": \"npm run build && mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js && check-es3-syntax -p lib/ --kill\",\n \"build\": \"babel es --out-dir lib\",\n \"prepublish\": \"npm test\"\n },\n \"files\": [\n \"" }, + { path: "/a/b/node_modules/.staging/lodash-b0733faa/package.json", content: "{\n \"name\": \"lodash\",\n \"version\": \"4.17.4\",\n \"description\": \"Lodash modular utilities.\",\n \"keywords\": \"modules, stdlib, util\",\n \"homepage\": \"https://lodash.com/\",\n \"repository\": \"lodash/lodash\",\n \"icon\": \"https://lodash.com/icon.svg\",\n \"license\": \"MIT\",\n \"main\": \"lodash.js\",\n \"author\": \"John-David Dalton (http://allyoucanleet.com/)\",\n \"contributors\": [\n \"John-David Dalton (http://allyoucanleet.com/)\",\n \"Mathias Bynens \",\n \"contributors\": [\n {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n {\n \"name\": \"Paul Taylor\",\n \"email\": \"paul.e.taylor@me.com\"\n },\n {\n \"name\": \"Jeff Cross\",\n \"email\": \"crossj@google.com\"\n },\n {\n \"name\": \"Matthew Podwysocki\",\n \"email\": \"matthewp@microsoft.com\"\n },\n {\n \"name\": \"OJ Kwon\",\n \"email\": \"kwon.ohjoong@gmail.com\"\n },\n {\n \"name\": \"Andre Staltz\",\n \"email\": \"andre@staltz.com\"\n }\n ],\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/ReactiveX/RxJS/issues\"\n },\n \"homepage\": \"https://github.com/ReactiveX/RxJS\",\n \"devDependencies\": {\n \"babel-polyfill\": \"^6.23.0\",\n \"benchmark\": \"^2.1.0\",\n \"benchpress\": \"2.0.0-beta.1\",\n \"chai\": \"^3.5.0\",\n \"color\": \"^0.11.1\",\n \"colors\": \"1.1.2\",\n \"commitizen\": \"^2.8.6\",\n \"coveralls\": \"^2.11.13\",\n \"cz-conventional-changelog\": \"^1.2.0\",\n \"danger\": \"^1.1.0\",\n \"doctoc\": \"^1.0.0\",\n \"escape-string-regexp\": \"^1.0.5 \",\n \"esdoc\": \"^0.4.7\",\n \"eslint\": \"^3.8.0\",\n \"fs-extra\": \"^2.1.2\",\n \"get-folder-size\": \"^1.0.0\",\n \"glob\": \"^7.0.3\",\n \"gm\": \"^1.22.0\",\n \"google-closure-compiler-js\": \"^20170218.0.0\",\n \"gzip-size\": \"^3.0.0\",\n \"http-server\": \"^0.9.0\",\n \"husky\": \"^0.13.3\",\n \"lint-staged\": \"3.2.5\",\n \"lodash\": \"^4.15.0\",\n \"madge\": \"^1.4.3\",\n \"markdown-doctest\": \"^0.9.1\",\n \"minimist\": \"^1.2.0\",\n \"mkdirp\": \"^0.5.1\",\n \"mocha\": \"^3.0.2\",\n \"mocha-in-sauce\": \"0.0.1\",\n \"npm-run-all\": \"^4.0.2\",\n \"npm-scripts-info\": \"^0.3.4\",\n \"nyc\": \"^10.2.0\",\n \"opn-cli\": \"^3.1.0\",\n \"platform\": \"^1.3.1\",\n \"promise\": \"^7.1.1\",\n \"protractor\": \"^3.1.1\",\n \"rollup\": \"0.36.3\",\n \"rollup-plugin-inject\": \"^2.0.0\",\n \"rollup-plugin-node-resolve\": \"^2.0.0\",\n \"rx\": \"latest\",\n \"rxjs\": \"latest\",\n \"shx\": \"^0.2.2\",\n \"sinon\": \"^2.1.0\",\n \"sinon-chai\": \"^2.9.0\",\n \"source-map-support\": \"^0.4.0\",\n \"tslib\": \"^1.5.0\",\n \"tslint\": \"^4.4.2\",\n \"typescript\": \"~2.0.6\",\n \"typings\": \"^2.0.0\",\n \"validate-commit-msg\": \"^2.14.0\",\n \"watch\": \"^1.0.1\",\n \"webpack\": \"^1.13.1\",\n \"xmlhttprequest\": \"1.8.0\"\n },\n \"engines\": {\n \"npm\": \">=2.0.0\"\n },\n \"typings\": \"Rx.d.ts\",\n \"dependencies\": {\n \"symbol-observable\": \"^1.0.1\"\n }\n}" }, + { path: "/a/b/node_modules/.staging/typescript-8493ea5d/package.json", content: "{\n \"name\": \"typescript\",\n \"author\": \"Microsoft Corp.\",\n \"homepage\": \"http://typescriptlang.org/\",\n \"version\": \"2.4.2\",\n \"license\": \"Apache-2.0\",\n \"description\": \"TypeScript is a language for application scale JavaScript development\",\n \"keywords\": [\n \"TypeScript\",\n \"Microsoft\",\n \"compiler\",\n \"language\",\n \"javascript\"\n ],\n \"bugs\": {\n \"url\": \"https://github.com/Microsoft/TypeScript/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/Microsoft/TypeScript.git\"\n },\n \"main\": \"./lib/typescript.js\",\n \"typings\": \"./lib/typescript.d.ts\",\n \"bin\": {\n \"tsc\": \"./bin/tsc\",\n \"tsserver\": \"./bin/tsserver\"\n },\n \"engines\": {\n \"node\": \">=4.2.0\"\n },\n \"devDependencies\": {\n \"@types/browserify\": \"latest\",\n \"@types/chai\": \"latest\",\n \"@types/convert-source-map\": \"latest\",\n \"@types/del\": \"latest\",\n \"@types/glob\": \"latest\",\n \"@types/gulp\": \"latest\",\n \"@types/gulp-concat\": \"latest\",\n \"@types/gulp-help\": \"latest\",\n \"@types/gulp-newer\": \"latest\",\n \"@types/gulp-sourcemaps\": \"latest\",\n \"@types/merge2\": \"latest\",\n \"@types/minimatch\": \"latest\",\n \"@types/minimist\": \"latest\",\n \"@types/mkdirp\": \"latest\",\n \"@types/mocha\": \"latest\",\n \"@types/node\": \"latest\",\n \"@types/q\": \"latest\",\n \"@types/run-sequence\": \"latest\",\n \"@types/through2\": \"latest\",\n \"browserify\": \"latest\",\n \"chai\": \"latest\",\n \"convert-source-map\": \"latest\",\n \"del\": \"latest\",\n \"gulp\": \"latest\",\n \"gulp-clone\": \"latest\",\n \"gulp-concat\": \"latest\",\n \"gulp-help\": \"latest\",\n \"gulp-insert\": \"latest\",\n \"gulp-newer\": \"latest\",\n \"gulp-sourcemaps\": \"latest\",\n \"gulp-typescript\": \"latest\",\n \"into-stream\": \"latest\",\n \"istanbul\": \"latest\",\n \"jake\": \"latest\",\n \"merge2\": \"latest\",\n \"minimist\": \"latest\",\n \"mkdirp\": \"latest\",\n \"mocha\": \"latest\",\n \"mocha-fivemat-progress-reporter\": \"latest\",\n \"q\": \"latest\",\n \"run-sequence\": \"latest\",\n \"sorcery\": \"latest\",\n \"through2\": \"latest\",\n \"travis-fold\": \"latest\",\n \"ts-node\": \"latest\",\n \"tslint\": \"latest\",\n \"typescript\": \"^2.4\"\n },\n \"scripts\": {\n \"pretest\": \"jake tests\",\n \"test\": \"jake runtests-parallel\",\n \"build\": \"npm run build:compiler && npm run build:tests\",\n \"build:compiler\": \"jake local\",\n \"build:tests\": \"jake tests\",\n \"start\": \"node lib/tsc\",\n \"clean\": \"jake clean\",\n \"gulp\": \"gulp\",\n \"jake\": \"jake\",\n \"lint\": \"jake lint\",\n \"setup-hooks\": \"node scripts/link-hooks.js\"\n },\n \"browser\": {\n \"buffer\": false,\n \"fs\": false,\n \"os\": false,\n \"path\": false\n }\n}" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/index.js", content: "module.exports = require('./lib/index');\n" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/index.d.ts", content: "declare const observableSymbol: symbol;\nexport default observableSymbol;\n" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/lib" }, + { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/lib/index.js", content: "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;" }, + ].map(getRootedFileOrFolder); + verifyAfterPartialOrCompleteNpmInstall(2); + + filesAndFoldersToAdd.push(...[ + { path: "/a/b/node_modules/.staging/typescript-8493ea5d/lib" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/add/operator" }, + { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7/package.json", content: "{\n \"name\": \"@types/lodash\",\n \"version\": \"4.14.74\",\n \"description\": \"TypeScript definitions for Lo-Dash\",\n \"license\": \"MIT\",\n \"contributors\": [\n {\n \"name\": \"Brian Zengel\",\n \"url\": \"https://github.com/bczengel\"\n },\n {\n \"name\": \"Ilya Mochalov\",\n \"url\": \"https://github.com/chrootsu\"\n },\n {\n \"name\": \"Stepan Mikhaylyuk\",\n \"url\": \"https://github.com/stepancar\"\n },\n {\n \"name\": \"Eric L Anderson\",\n \"url\": \"https://github.com/ericanderson\"\n },\n {\n \"name\": \"AJ Richardson\",\n \"url\": \"https://github.com/aj-r\"\n },\n {\n \"name\": \"Junyoung Clare Jang\",\n \"url\": \"https://github.com/ailrun\"\n }\n ],\n \"main\": \"\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://www.github.com/DefinitelyTyped/DefinitelyTyped.git\"\n },\n \"scripts\": {},\n \"dependencies\": {},\n \"typesPublisherContentHash\": \"12af578ffaf8d86d2df37e591857906a86b983fa9258414326544a0fe6af0de8\",\n \"typeScriptVersion\": \"2.2\"\n}" }, + { path: "/a/b/node_modules/.staging/lodash-b0733faa/index.js", content: "module.exports = require('./lodash');" }, + { path: "/a/b/node_modules/.staging/typescript-8493ea5d/package.json.3017591594" } + ].map(getRootedFileOrFolder)); + // Since we added/removed in .staging no timeout + verifyAfterPartialOrCompleteNpmInstall(0); + + // Remove file "/a/b/node_modules/.staging/typescript-8493ea5d/package.json.3017591594" + filesAndFoldersToAdd.length--; + verifyAfterPartialOrCompleteNpmInstall(0); + + filesAndFoldersToAdd.push(...[ + { path: "/a/b/node_modules/.staging/rxjs-22375c61/bundles" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/operator" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/add/observable/dom" }, + { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7/index.d.ts", content: "\n// Stub for lodash\nexport = _;\nexport as namespace _;\ndeclare var _: _.LoDashStatic;\ndeclare namespace _ {\n interface LoDashStatic {\n someProp: string;\n }\n class SomeClass {\n someMethod(): void;\n }\n}" } + ].map(getRootedFileOrFolder)); + verifyAfterPartialOrCompleteNpmInstall(0); + + filesAndFoldersToAdd.push(...[ + { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/scheduler" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/util" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/symbol" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/testing" }, + { path: "/a/b/node_modules/.staging/rxjs-22375c61/package.json.2252192041", content: "{\n \"_args\": [\n [\n {\n \"raw\": \"rxjs@^5.4.2\",\n \"scope\": null,\n \"escapedName\": \"rxjs\",\n \"name\": \"rxjs\",\n \"rawSpec\": \"^5.4.2\",\n \"spec\": \">=5.4.2 <6.0.0\",\n \"type\": \"range\"\n },\n \"C:\\\\Users\\\\shkamat\\\\Desktop\\\\app\"\n ]\n ],\n \"_from\": \"rxjs@>=5.4.2 <6.0.0\",\n \"_id\": \"rxjs@5.4.3\",\n \"_inCache\": true,\n \"_location\": \"/rxjs\",\n \"_nodeVersion\": \"7.7.2\",\n \"_npmOperationalInternal\": {\n \"host\": \"s3://npm-registry-packages\",\n \"tmp\": \"tmp/rxjs-5.4.3.tgz_1502407898166_0.6800217325799167\"\n },\n \"_npmUser\": {\n \"name\": \"blesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"_npmVersion\": \"5.3.0\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"raw\": \"rxjs@^5.4.2\",\n \"scope\": null,\n \"escapedName\": \"rxjs\",\n \"name\": \"rxjs\",\n \"rawSpec\": \"^5.4.2\",\n \"spec\": \">=5.4.2 <6.0.0\",\n \"type\": \"range\"\n },\n \"_requiredBy\": [\n \"/\"\n ],\n \"_resolved\": \"https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz\",\n \"_shasum\": \"0758cddee6033d68e0fd53676f0f3596ce3d483f\",\n \"_shrinkwrap\": null,\n \"_spec\": \"rxjs@^5.4.2\",\n \"_where\": \"C:\\\\Users\\\\shkamat\\\\Desktop\\\\app\",\n \"author\": {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/ReactiveX/RxJS/issues\"\n },\n \"config\": {\n \"commitizen\": {\n \"path\": \"cz-conventional-changelog\"\n }\n },\n \"contributors\": [\n {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n {\n \"name\": \"Paul Taylor\",\n \"email\": \"paul.e.taylor@me.com\"\n },\n {\n \"name\": \"Jeff Cross\",\n \"email\": \"crossj@google.com\"\n },\n {\n \"name\": \"Matthew Podwysocki\",\n \"email\": \"matthewp@microsoft.com\"\n },\n {\n \"name\": \"OJ Kwon\",\n \"email\": \"kwon.ohjoong@gmail.com\"\n },\n {\n \"name\": \"Andre Staltz\",\n \"email\": \"andre@staltz.com\"\n }\n ],\n \"dependencies\": {\n \"symbol-observable\": \"^1.0.1\"\n },\n \"description\": \"Reactive Extensions for modern JavaScript\",\n \"devDependencies\": {\n \"babel-polyfill\": \"^6.23.0\",\n \"benchmark\": \"^2.1.0\",\n \"benchpress\": \"2.0.0-beta.1\",\n \"chai\": \"^3.5.0\",\n \"color\": \"^0.11.1\",\n \"colors\": \"1.1.2\",\n \"commitizen\": \"^2.8.6\",\n \"coveralls\": \"^2.11.13\",\n \"cz-conventional-changelog\": \"^1.2.0\",\n \"danger\": \"^1.1.0\",\n \"doctoc\": \"^1.0.0\",\n \"escape-string-regexp\": \"^1.0.5 \",\n \"esdoc\": \"^0.4.7\",\n \"eslint\": \"^3.8.0\",\n \"fs-extra\": \"^2.1.2\",\n \"get-folder-size\": \"^1.0.0\",\n \"glob\": \"^7.0.3\",\n \"gm\": \"^1.22.0\",\n \"google-closure-compiler-js\": \"^20170218.0.0\",\n \"gzip-size\": \"^3.0.0\",\n \"http-server\": \"^0.9.0\",\n \"husky\": \"^0.13.3\",\n \"lint-staged\": \"3.2.5\",\n \"lodash\": \"^4.15.0\",\n \"madge\": \"^1.4.3\",\n \"markdown-doctest\": \"^0.9.1\",\n \"minimist\": \"^1.2.0\",\n \"mkdirp\": \"^0.5.1\",\n \"mocha\": \"^3.0.2\",\n \"mocha-in-sauce\": \"0.0.1\",\n \"npm-run-all\": \"^4.0.2\",\n \"npm-scripts-info\": \"^0.3.4\",\n \"nyc\": \"^10.2.0\",\n \"opn-cli\": \"^3.1.0\",\n \"platform\": \"^1.3.1\",\n \"promise\": \"^7.1.1\",\n \"protractor\": \"^3.1.1\",\n \"rollup\": \"0.36.3\",\n \"rollup-plugin-inject\": \"^2.0.0\",\n \"rollup-plugin-node-resolve\": \"^2.0.0\",\n \"rx\": \"latest\",\n \"rxjs\": \"latest\",\n \"shx\": \"^0.2.2\",\n \"sinon\": \"^2.1.0\",\n \"sinon-chai\": \"^2.9.0\",\n \"source-map-support\": \"^0.4.0\",\n \"tslib\": \"^1.5.0\",\n \"tslint\": \"^4.4.2\",\n \"typescript\": \"~2.0.6\",\n \"typings\": \"^2.0.0\",\n \"validate-commit-msg\": \"^2.14.0\",\n \"watch\": \"^1.0.1\",\n \"webpack\": \"^1.13.1\",\n \"xmlhttprequest\": \"1.8.0\"\n },\n \"directories\": {},\n \"dist\": {\n \"integrity\": \"sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==\",\n \"shasum\": \"0758cddee6033d68e0fd53676f0f3596ce3d483f\",\n \"tarball\": \"https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz\"\n },\n \"engines\": {\n \"npm\": \">=2.0.0\"\n },\n \"homepage\": \"https://github.com/ReactiveX/RxJS\",\n \"keywords\": [\n \"Rx\",\n \"RxJS\",\n \"ReactiveX\",\n \"ReactiveExtensions\",\n \"Streams\",\n \"Observables\",\n \"Observable\",\n \"Stream\",\n \"ES6\",\n \"ES2015\"\n ],\n \"license\": \"Apache-2.0\",\n \"lint-staged\": {\n \"*.@(js)\": [\n \"eslint --fix\",\n \"git add\"\n ],\n \"*.@(ts)\": [\n \"tslint --fix\",\n \"git add\"\n ]\n },\n \"main\": \"Rx.js\",\n \"maintainers\": [\n {\n \"name\": \"blesh\",\n \"email\": \"ben@benlesh.com\"\n }\n ],\n \"name\": \"rxjs\",\n \"optionalDependencies\": {},\n \"readme\": \"ERROR: No README data found!\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+ssh://git@github.com/ReactiveX/RxJS.git\"\n },\n \"scripts-info\": {\n \"info\": \"List available script\",\n \"build_all\": \"Build all packages (ES6, CJS, UMD) and generate packages\",\n \"build_cjs\": \"Build CJS package with clean up existing build, copy source into dist\",\n \"build_es6\": \"Build ES6 package with clean up existing build, copy source into dist\",\n \"build_closure_core\": \"Minify Global core build using closure compiler\",\n \"build_global\": \"Build Global package, then minify build\",\n \"build_perf\": \"Build CJS & Global build, run macro performance test\",\n \"build_test\": \"Build CJS package & test spec, execute mocha test runner\",\n \"build_cover\": \"Run lint to current code, build CJS & test spec, execute test coverage\",\n \"build_docs\": \"Build ES6 & global package, create documentation using it\",\n \"build_spec\": \"Build test specs\",\n \"check_circular_dependencies\": \"Check codebase has circular dependencies\",\n \"clean_spec\": \"Clean up existing test spec build output\",\n \"clean_dist_cjs\": \"Clean up existing CJS package output\",\n \"clean_dist_es6\": \"Clean up existing ES6 package output\",\n \"clean_dist_global\": \"Clean up existing Global package output\",\n \"commit\": \"Run git commit wizard\",\n \"compile_dist_cjs\": \"Compile codebase into CJS module\",\n \"compile_module_es6\": \"Compile codebase into ES6\",\n \"cover\": \"Execute test coverage\",\n \"lint_perf\": \"Run lint against performance test suite\",\n \"lint_spec\": \"Run lint against test spec\",\n \"lint_src\": \"Run lint against source\",\n \"lint\": \"Run lint against everything\",\n \"perf\": \"Run macro performance benchmark\",\n \"perf_micro\": \"Run micro performance benchmark\",\n \"test_mocha\": \"Execute mocha test runner against existing test spec build\",\n \"test_browser\": \"Execute mocha test runner on browser against existing test spec build\",\n \"test\": \"Clean up existing test spec build, build test spec and execute mocha test runner\",\n \"tests2png\": \"Generate marble diagram image from test spec\",\n \"watch\": \"Watch codebase, trigger compile when source code changes\"\n },\n \"typings\": \"Rx.d.ts\",\n \"version\": \"5.4.3\"\n}\n" } + ].map(getRootedFileOrFolder)); + verifyAfterPartialOrCompleteNpmInstall(0); + + // remove /a/b/node_modules/.staging/rxjs-22375c61/package.json.2252192041 + filesAndFoldersToAdd.length--; + // and add few more folders/files + filesAndFoldersToAdd.push(...[ + { path: "/a/b/node_modules/symbol-observable" }, + { path: "/a/b/node_modules/@types" }, + { path: "/a/b/node_modules/@types/lodash" }, + { path: "/a/b/node_modules/lodash" }, + { path: "/a/b/node_modules/rxjs" }, + { path: "/a/b/node_modules/typescript" }, + { path: "/a/b/node_modules/.bin" } + ].map(getRootedFileOrFolder)); + // From the type root update + verifyAfterPartialOrCompleteNpmInstall(2); + + forEach(filesAndFoldersToAdd, f => { + f.path = f.path + .replace("/a/b/node_modules/.staging", "/a/b/node_modules") + .replace(/[\-\.][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w]/g, ""); + }); + + const lodashIndexPath = root + "/a/b/node_modules/@types/lodash/index.d.ts"; + projectFiles.push(find(filesAndFoldersToAdd, f => f.path === lodashIndexPath)!); + // we would now not have failed lookup in the parent of appFolder since lodash is available + recursiveWatchedDirectories.length = 2; + // npm installation complete, timeout after reload fs + npmInstallComplete = true; + verifyAfterPartialOrCompleteNpmInstall(2); + + function verifyAfterPartialOrCompleteNpmInstall(timeoutQueueLengthWhenRunningTimeouts: number) { + host.reloadFS(projectFiles.concat(otherFiles, filesAndFoldersToAdd)); + if (npmInstallComplete || timeoutDuringPartialInstallation) { + host.checkTimeoutQueueLengthAndRun(timeoutQueueLengthWhenRunningTimeouts); + } + else { + host.checkTimeoutQueueLength(2); + } + verifyProject(); + } + + function verifyProject() { + checkNumberOfConfiguredProjects(projectService, 1); + + const project = projectService.configuredProjects.get(tsconfigJson.path)!; + const projectFilePaths = map(projectFiles, f => f.path); + checkProjectActualFiles(project, projectFilePaths); + + const filesWatched = filter(projectFilePaths, p => p !== app.path && p.indexOf("/a/b/node_modules") === -1); + checkWatchedFiles(host, filesWatched); + checkWatchedDirectories(host, typeRootDirectories.concat(recursiveWatchedDirectories), /*recursive*/ true); + checkWatchedDirectories(host, [], /*recursive*/ false); + } + } + + it("timeouts occur inbetween installation", () => { + verifyNpmInstall(/*timeoutDuringPartialInstallation*/ true); + }); + + it("timeout occurs after installation", () => { + verifyNpmInstall(/*timeoutDuringPartialInstallation*/ false); + }); + }); + + it("when node_modules dont receive event for the @types file addition", () => { + const projectLocation = "/user/username/folder/myproject"; + const app: File = { + path: `${projectLocation}/app.ts`, + content: `import * as debug from "debug"` + }; + const tsconfig: File = { + path: `${projectLocation}/tsconfig.json`, + content: "" + }; + + const files = [app, tsconfig, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(app.path); + + const project = service.configuredProjects.get(tsconfig.path)!; + checkProjectActualFiles(project, files.map(f => f.path)); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(app.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); + + const debugTypesFile: File = { + path: `${projectLocation}/node_modules/@types/debug/index.d.ts`, + content: "export {}" + }; + files.push(debugTypesFile); + // Do not invoke recursive directory watcher for anything other than node_module/@types + const invoker = host.invokeWatchedDirectoriesRecursiveCallback; + host.invokeWatchedDirectoriesRecursiveCallback = (fullPath, relativePath) => { + if (fullPath.endsWith("@types")) { + invoker.call(host, fullPath, relativePath); + } + }; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkProjectActualFiles(project, files.map(f => f.path)); + assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(app.path).map(diag => diag.messageText), []); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts index b6154f46b71..f042a43738a 100644 --- a/src/testRunner/unittests/tsserverHelpers.ts +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -450,19 +450,15 @@ namespace ts.projectSystem { } export const nodeModules = "node_modules"; - //function getNodeModuleDirectories(dir: string) { - // return getRootsToWatchWithAncestorDirectory(dir, nodeModules); - //} + export function getNodeModuleDirectories(dir: string) { + return getRootsToWatchWithAncestorDirectory(dir, nodeModules); + } export const nodeModulesAtTypes = "node_modules/@types"; export function getTypeRootsFromLocation(currentDirectory: string) { return getRootsToWatchWithAncestorDirectory(currentDirectory, nodeModulesAtTypes); } - //function getNumberOfWatchesInvokedForRecursiveWatches(recursiveWatchedDirs: string[], file: string) { - // return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); - //} - //function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { // checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); //} diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 624b11d8d99..f30e8ad5d9c 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -1,12 +1,4 @@ namespace ts.projectSystem { - function getNodeModuleDirectories(dir: string) { - return getRootsToWatchWithAncestorDirectory(dir, nodeModules); - } - - function getNumberOfWatchesInvokedForRecursiveWatches(recursiveWatchedDirs: string[], file: string) { - return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); - } - function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); } @@ -5198,705 +5190,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem CachingFileSystemInformation", () => { - enum CalledMapsWithSingleArg { - fileExists = "fileExists", - directoryExists = "directoryExists", - getDirectories = "getDirectories", - readFile = "readFile" - } - enum CalledMapsWithFiveArgs { - readDirectory = "readDirectory" - } - type CalledMaps = CalledMapsWithSingleArg | CalledMapsWithFiveArgs; - function createCallsTrackingHost(host: TestServerHost) { - const calledMaps: Record> & Record, ReadonlyArray, ReadonlyArray, number]>> = { - fileExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.fileExists), - directoryExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.directoryExists), - getDirectories: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.getDirectories), - readFile: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.readFile), - readDirectory: setCallsTrackingWithFiveArgFn(CalledMapsWithFiveArgs.readDirectory) - }; - - return { - verifyNoCall, - verifyCalledOnEachEntryNTimes, - verifyCalledOnEachEntry, - verifyNoHostCalls, - verifyNoHostCallsExceptFileExistsOnce, - verifyCalledOn, - clear - }; - - function setCallsTrackingWithSingleArgFn(prop: CalledMapsWithSingleArg) { - const calledMap = createMultiMap(); - const cb = (host)[prop].bind(host); - (host)[prop] = (f: string) => { - calledMap.add(f, /*value*/ true); - return cb(f); - }; - return calledMap; - } - - function setCallsTrackingWithFiveArgFn(prop: CalledMapsWithFiveArgs) { - const calledMap = createMultiMap<[U, V, W, X]>(); - const cb = (host)[prop].bind(host); - (host)[prop] = (f: string, arg1?: U, arg2?: V, arg3?: W, arg4?: X) => { - calledMap.add(f, [arg1!, arg2!, arg3!, arg4!]); // TODO: GH#18217 - return cb(f, arg1, arg2, arg3, arg4); - }; - return calledMap; - } - - function verifyCalledOn(callback: CalledMaps, name: string) { - const calledMap = calledMaps[callback]; - const result = calledMap.get(name); - assert.isTrue(result && !!result.length, `${callback} should be called with name: ${name}: ${arrayFrom(calledMap.keys())}`); - } - - function verifyNoCall(callback: CalledMaps) { - const calledMap = calledMaps[callback]; - assert.equal(calledMap.size, 0, `${callback} shouldn't be called: ${arrayFrom(calledMap.keys())}`); - } - - function verifyCalledOnEachEntry(callback: CalledMaps, expectedKeys: Map) { - TestFSWithWatch.checkMultiMapKeyCount(callback, calledMaps[callback], expectedKeys); - } - - function verifyCalledOnEachEntryNTimes(callback: CalledMaps, expectedKeys: ReadonlyArray, nTimes: number) { - TestFSWithWatch.checkMultiMapKeyCount(callback, calledMaps[callback], expectedKeys, nTimes); - } - - function verifyNoHostCalls() { - iterateOnCalledMaps(key => verifyNoCall(key)); - } - - function verifyNoHostCallsExceptFileExistsOnce(expectedKeys: ReadonlyArray) { - verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, expectedKeys, 1); - verifyNoCall(CalledMapsWithSingleArg.directoryExists); - verifyNoCall(CalledMapsWithSingleArg.getDirectories); - verifyNoCall(CalledMapsWithSingleArg.readFile); - verifyNoCall(CalledMapsWithFiveArgs.readDirectory); - } - - function clear() { - iterateOnCalledMaps(key => calledMaps[key].clear()); - } - - function iterateOnCalledMaps(cb: (key: CalledMaps) => void) { - for (const key in CalledMapsWithSingleArg) { - cb(key as CalledMapsWithSingleArg); - } - for (const key in CalledMapsWithFiveArgs) { - cb(key as CalledMapsWithFiveArgs); - } - } - } - - it("works using legacy resolution logic", () => { - let rootContent = `import {x} from "f1"`; - const root: File = { - path: "/c/d/f0.ts", - content: rootContent - }; - - const imported: File = { - path: "/c/f1.ts", - content: `foo()` - }; - - const host = createServerHost([root, imported]); - const projectService = createProjectService(host); - projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); - projectService.openClientFile(root.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const project = projectService.inferredProjects[0]; - const rootScriptInfo = project.getRootScriptInfos()[0]; - assert.equal(rootScriptInfo.fileName, root.path); - - // ensure that imported file was found - verifyImportedDiagnostics(); - - const callsTrackingHost = createCallsTrackingHost(host); - - // trigger synchronization to make sure that import will be fetched from the cache - // ensure file has correct number of errors after edit - editContent(`import {x} from "f1"; - var x: string = 1;`); - verifyImportedDiagnostics(); - callsTrackingHost.verifyNoHostCalls(); - - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk - editContent(`import {x} from "f2"`); - try { - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk - verifyImportedDiagnostics(); - assert.isTrue(false, `should not find file '${imported.path}'`); - } - catch (e) { - assert.isTrue(e.message.indexOf(`Could not find file: '${imported.path}'.`) === 0); - } - const f2Lookups = getLocationsForModuleLookup("f2"); - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f2Lookups, 1); - const f2DirLookups = getLocationsForDirectoryLookup(); - callsTrackingHost.verifyCalledOnEachEntry(CalledMapsWithSingleArg.directoryExists, f2DirLookups); - callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); - callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.readFile); - callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); - - editContent(`import {x} from "f1"`); - verifyImportedDiagnostics(); - const f1Lookups = f2Lookups.map(s => s.replace("f2", "f1")); - f1Lookups.length = f1Lookups.indexOf(imported.path) + 1; - const f1DirLookups = ["/c/d", "/c", ...mapCombinedPathsInAncestor(getDirectoryPath(root.path), nodeModulesAtTypes, returnTrue)]; - vertifyF1Lookups(); - - // setting compiler options discards module resolution cache - callsTrackingHost.clear(); - projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true, target: ScriptTarget.ES5 }); - verifyImportedDiagnostics(); - vertifyF1Lookups(); - - function vertifyF1Lookups() { - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f1Lookups, 1); - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.directoryExists, f1DirLookups, 1); - callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); - callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.readFile); - callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); - } - - function editContent(newContent: string) { - callsTrackingHost.clear(); - rootScriptInfo.editContent(0, rootContent.length, newContent); - rootContent = newContent; - } - - function verifyImportedDiagnostics() { - const diags = project.getLanguageService().getSemanticDiagnostics(imported.path); - assert.equal(diags.length, 1); - const diag = diags[0]; - assert.equal(diag.code, Diagnostics.Cannot_find_name_0.code); - assert.equal(flattenDiagnosticMessageText(diag.messageText, "\n"), "Cannot find name 'foo'."); - } - - function getLocationsForModuleLookup(module: string) { - const locations: string[] = []; - forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { - locations.push( - combinePaths(ancestor, `${module}.ts`), - combinePaths(ancestor, `${module}.tsx`), - combinePaths(ancestor, `${module}.d.ts`) - ); - }); - forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { - locations.push( - combinePaths(ancestor, `${module}.js`), - combinePaths(ancestor, `${module}.jsx`) - ); - }); - return locations; - } - - function getLocationsForDirectoryLookup() { - const result = createMap(); - forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { - // To resolve modules - result.set(ancestor, 2); - // for type roots - result.set(combinePaths(ancestor, nodeModules), 1); - result.set(combinePaths(ancestor, nodeModulesAtTypes), 1); - }); - return result; - } - }); - - it("loads missing files from disk", () => { - const root: File = { - path: "/c/foo.ts", - content: `import {y} from "bar"` - }; - - const imported: File = { - path: "/c/bar.d.ts", - content: `export var y = 1` - }; - - const host = createServerHost([root]); - const projectService = createProjectService(host); - projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); - const callsTrackingHost = createCallsTrackingHost(host); - projectService.openClientFile(root.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const project = projectService.inferredProjects[0]; - const rootScriptInfo = project.getRootScriptInfos()[0]; - assert.equal(rootScriptInfo.fileName, root.path); - - let diags = project.getLanguageService().getSemanticDiagnostics(root.path); - assert.equal(diags.length, 1); - const diag = diags[0]; - assert.equal(diag.code, Diagnostics.Cannot_find_module_0.code); - assert.equal(flattenDiagnosticMessageText(diag.messageText, "\n"), "Cannot find module 'bar'."); - callsTrackingHost.verifyCalledOn(CalledMapsWithSingleArg.fileExists, imported.path); - - - callsTrackingHost.clear(); - host.reloadFS([root, imported]); - host.runQueuedTimeoutCallbacks(); - diags = project.getLanguageService().getSemanticDiagnostics(root.path); - assert.equal(diags.length, 0); - callsTrackingHost.verifyCalledOn(CalledMapsWithSingleArg.fileExists, imported.path); - }); - - it("when calling goto definition of module", () => { - const clientFile: File = { - path: "/a/b/controllers/vessels/client.ts", - content: ` - import { Vessel } from '~/models/vessel'; - const v = new Vessel(); - ` - }; - const anotherModuleFile: File = { - path: "/a/b/utils/db.ts", - content: "export class Bookshelf { }" - }; - const moduleFile: File = { - path: "/a/b/models/vessel.ts", - content: ` - import { Bookshelf } from '~/utils/db'; - export class Vessel extends Bookshelf {} - ` - }; - const tsconfigFile: File = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - target: "es6", - module: "es6", - baseUrl: "./", // all paths are relative to the baseUrl - paths: { - "~/*": ["*"] // resolve any `~/foo/bar` to `/foo/bar` - } - }, - exclude: [ - "api", - "build", - "node_modules", - "public", - "seeds", - "sql_updates", - "tests.build" - ] - }) - }; - const projectFiles = [clientFile, anotherModuleFile, moduleFile, tsconfigFile]; - const host = createServerHost(projectFiles); - const session = createSession(host); - const projectService = session.getProjectService(); - const { configFileName } = projectService.openClientFile(clientFile.path); - - assert.isDefined(configFileName, `should find config`); - checkNumberOfConfiguredProjects(projectService, 1); - - const project = projectService.configuredProjects.get(tsconfigFile.path)!; - checkProjectActualFiles(project, map(projectFiles, f => f.path)); - - const callsTrackingHost = createCallsTrackingHost(host); - - // Get definitions shouldnt make host requests - const getDefinitionRequest = makeSessionRequest(protocol.CommandTypes.Definition, { - file: clientFile.path, - position: clientFile.content.indexOf("/vessel") + 1, - line: undefined!, // TODO: GH#18217 - offset: undefined! // TODO: GH#18217 - }); - const response = session.executeCommand(getDefinitionRequest).response as server.protocol.FileSpan[]; - assert.equal(response[0].file, moduleFile.path, "Should go to definition of vessel: response: " + JSON.stringify(response)); - callsTrackingHost.verifyNoHostCalls(); - - // Open the file should call only file exists on module directory and use cached value for parental directory - const { configFileName: config2 } = projectService.openClientFile(moduleFile.path); - assert.equal(config2, configFileName); - callsTrackingHost.verifyNoHostCallsExceptFileExistsOnce(["/a/b/models/tsconfig.json", "/a/b/models/jsconfig.json"]); - - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(tsconfigFile.path), project); - }); - - describe("WatchDirectories for config file with", () => { - function verifyWatchDirectoriesCaseSensitivity(useCaseSensitiveFileNames: boolean) { - const frontendDir = "/Users/someuser/work/applications/frontend"; - const toCanonical: (s: string) => Path = useCaseSensitiveFileNames ? s => s as Path : s => s.toLowerCase() as Path; - const canonicalFrontendDir = toCanonical(frontendDir); - const file1: File = { - path: `${frontendDir}/src/app/utils/Analytic.ts`, - content: "export class SomeClass { };" - }; - const file2: File = { - path: `${frontendDir}/src/app/redux/configureStore.ts`, - content: "export class configureStore { }" - }; - const file3: File = { - path: `${frontendDir}/src/app/utils/Cookie.ts`, - content: "export class Cookie { }" - }; - const es2016LibFile: File = { - path: "/a/lib/lib.es2016.full.d.ts", - content: libFile.content - }; - const typeRoots = ["types", "node_modules/@types"]; - const types = ["node", "jest"]; - const tsconfigFile: File = { - path: `${frontendDir}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { - strict: true, - strictNullChecks: true, - target: "es2016", - module: "commonjs", - moduleResolution: "node", - sourceMap: true, - noEmitOnError: true, - experimentalDecorators: true, - emitDecoratorMetadata: true, - types, - noUnusedLocals: true, - outDir: "./compiled", - typeRoots, - baseUrl: ".", - paths: { - "*": [ - "types/*" - ] - } - }, - include: [ - "src/**/*" - ], - exclude: [ - "node_modules", - "compiled" - ] - }) - }; - const projectFiles = [file1, file2, es2016LibFile, tsconfigFile]; - const host = createServerHost(projectFiles, { useCaseSensitiveFileNames }); - const projectService = createProjectService(host); - const canonicalConfigPath = toCanonical(tsconfigFile.path); - const { configFileName } = projectService.openClientFile(file1.path); - assert.equal(configFileName, tsconfigFile.path as server.NormalizedPath, `should find config`); // tslint:disable-line no-unnecessary-type-assertion (TODO: GH#18217) - checkNumberOfConfiguredProjects(projectService, 1); - const watchingRecursiveDirectories = [`${canonicalFrontendDir}/src`, `${canonicalFrontendDir}/types`, `${canonicalFrontendDir}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(canonicalFrontendDir))); - - const project = projectService.configuredProjects.get(canonicalConfigPath)!; - verifyProjectAndWatchedDirectories(); - - const callsTrackingHost = createCallsTrackingHost(host); - - // Create file cookie.ts - projectFiles.push(file3); - host.reloadFS(projectFiles); - host.runQueuedTimeoutCallbacks(); - - const canonicalFile3Path = useCaseSensitiveFileNames ? file3.path : file3.path.toLocaleLowerCase(); - const numberOfTimesWatchInvoked = getNumberOfWatchesInvokedForRecursiveWatches(watchingRecursiveDirectories, canonicalFile3Path); - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, [canonicalFile3Path], numberOfTimesWatchInvoked); - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.directoryExists, [canonicalFile3Path], numberOfTimesWatchInvoked); - callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); - callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.readFile, [file3.path], 1); - callsTrackingHost.verifyNoCall(CalledMapsWithFiveArgs.readDirectory); - - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(canonicalConfigPath), project); - verifyProjectAndWatchedDirectories(); - - callsTrackingHost.clear(); - - const { configFileName: configFile2 } = projectService.openClientFile(file3.path); - assert.equal(configFile2, configFileName); - - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(canonicalConfigPath), project); - verifyProjectAndWatchedDirectories(); - callsTrackingHost.verifyNoHostCalls(); - - function getFilePathIfNotOpen(f: File) { - const path = toCanonical(f.path); - const info = projectService.getScriptInfoForPath(toCanonical(f.path)); - return info && info.isScriptOpen() ? undefined : path; - } - - function verifyProjectAndWatchedDirectories() { - checkProjectActualFiles(project, map(projectFiles, f => f.path)); - checkWatchedFiles(host, mapDefined(projectFiles, getFilePathIfNotOpen)); - checkWatchedDirectories(host, watchingRecursiveDirectories, /*recursive*/ true); - checkWatchedDirectories(host, [], /*recursive*/ false); - } - } - - it("case insensitive file system", () => { - verifyWatchDirectoriesCaseSensitivity(/*useCaseSensitiveFileNames*/ false); - }); - - it("case sensitive file system", () => { - verifyWatchDirectoriesCaseSensitivity(/*useCaseSensitiveFileNames*/ true); - }); - }); - - describe("Subfolder invalidations correctly include parent folder failed lookup locations", () => { - function runFailedLookupTest(resolution: "Node" | "Classic") { - const projectLocation = "/proj"; - const file1: File = { - path: `${projectLocation}/foo/boo/app.ts`, - content: `import * as debug from "debug"` - }; - const file2: File = { - path: `${projectLocation}/foo/boo/moo/app.ts`, - content: `import * as debug from "debug"` - }; - const tsconfig: File = { - path: `${projectLocation}/tsconfig.json`, - content: JSON.stringify({ - files: ["foo/boo/app.ts", "foo/boo/moo/app.ts"], - moduleResolution: resolution - }) - }; - - const files = [file1, file2, tsconfig, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(file1.path); - - const project = service.configuredProjects.get(tsconfig.path)!; - checkProjectActualFiles(project, files.map(f => f.path)); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file1.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file2.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); - - const debugTypesFile: File = { - path: `${projectLocation}/node_modules/debug/index.d.ts`, - content: "export {}" - }; - files.push(debugTypesFile); - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkProjectActualFiles(project, files.map(f => f.path)); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file1.path).map(diag => diag.messageText), []); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(file2.path).map(diag => diag.messageText), []); - } - - it("Includes the parent folder FLLs in node module resolution mode", () => { - runFailedLookupTest("Node"); - }); - it("Includes the parent folder FLLs in classic module resolution mode", () => { - runFailedLookupTest("Classic"); - }); - }); - - describe("Verify npm install in directory with tsconfig file works when", () => { - function verifyNpmInstall(timeoutDuringPartialInstallation: boolean) { - const root = "/user/username/rootfolder/otherfolder"; - const getRootedFileOrFolder = (fileOrFolder: File) => { - fileOrFolder.path = root + fileOrFolder.path; - return fileOrFolder; - }; - const app: File = getRootedFileOrFolder({ - path: "/a/b/app.ts", - content: "import _ from 'lodash';" - }); - const tsconfigJson: File = getRootedFileOrFolder({ - path: "/a/b/tsconfig.json", - content: '{ "compilerOptions": { } }' - }); - const packageJson: File = getRootedFileOrFolder({ - path: "/a/b/package.json", - content: ` -{ - "name": "test", - "version": "1.0.0", - "description": "", - "main": "index.js", - "dependencies": { - "lodash", - "rxjs" - }, - "devDependencies": { - "@types/lodash", - "typescript" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} -` - }); - const appFolder = getDirectoryPath(app.path); - const projectFiles = [app, libFile, tsconfigJson]; - const typeRootDirectories = getTypeRootsFromLocation(getDirectoryPath(tsconfigJson.path)); - const otherFiles = [packageJson]; - const host = createServerHost(projectFiles.concat(otherFiles)); - const projectService = createProjectService(host); - const { configFileName } = projectService.openClientFile(app.path); - assert.equal(configFileName, tsconfigJson.path as server.NormalizedPath, `should find config`); // TODO: GH#18217 - const recursiveWatchedDirectories: string[] = [`${appFolder}`, `${appFolder}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(appFolder))); - verifyProject(); - - let npmInstallComplete = false; - - // Simulate npm install - const filesAndFoldersToAdd: File[] = [ - { path: "/a/b/node_modules" }, - { path: "/a/b/node_modules/.staging/@types" }, - { path: "/a/b/node_modules/.staging/lodash-b0733faa" }, - { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61" }, - { path: "/a/b/node_modules/.staging/typescript-8493ea5d" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/package.json", content: "{\n \"name\": \"symbol-observable\",\n \"version\": \"1.0.4\",\n \"description\": \"Symbol.observable ponyfill\",\n \"license\": \"MIT\",\n \"repository\": \"blesh/symbol-observable\",\n \"author\": {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"engines\": {\n \"node\": \">=0.10.0\"\n },\n \"scripts\": {\n \"test\": \"npm run build && mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js && check-es3-syntax -p lib/ --kill\",\n \"build\": \"babel es --out-dir lib\",\n \"prepublish\": \"npm test\"\n },\n \"files\": [\n \"" }, - { path: "/a/b/node_modules/.staging/lodash-b0733faa/package.json", content: "{\n \"name\": \"lodash\",\n \"version\": \"4.17.4\",\n \"description\": \"Lodash modular utilities.\",\n \"keywords\": \"modules, stdlib, util\",\n \"homepage\": \"https://lodash.com/\",\n \"repository\": \"lodash/lodash\",\n \"icon\": \"https://lodash.com/icon.svg\",\n \"license\": \"MIT\",\n \"main\": \"lodash.js\",\n \"author\": \"John-David Dalton (http://allyoucanleet.com/)\",\n \"contributors\": [\n \"John-David Dalton (http://allyoucanleet.com/)\",\n \"Mathias Bynens \",\n \"contributors\": [\n {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n {\n \"name\": \"Paul Taylor\",\n \"email\": \"paul.e.taylor@me.com\"\n },\n {\n \"name\": \"Jeff Cross\",\n \"email\": \"crossj@google.com\"\n },\n {\n \"name\": \"Matthew Podwysocki\",\n \"email\": \"matthewp@microsoft.com\"\n },\n {\n \"name\": \"OJ Kwon\",\n \"email\": \"kwon.ohjoong@gmail.com\"\n },\n {\n \"name\": \"Andre Staltz\",\n \"email\": \"andre@staltz.com\"\n }\n ],\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/ReactiveX/RxJS/issues\"\n },\n \"homepage\": \"https://github.com/ReactiveX/RxJS\",\n \"devDependencies\": {\n \"babel-polyfill\": \"^6.23.0\",\n \"benchmark\": \"^2.1.0\",\n \"benchpress\": \"2.0.0-beta.1\",\n \"chai\": \"^3.5.0\",\n \"color\": \"^0.11.1\",\n \"colors\": \"1.1.2\",\n \"commitizen\": \"^2.8.6\",\n \"coveralls\": \"^2.11.13\",\n \"cz-conventional-changelog\": \"^1.2.0\",\n \"danger\": \"^1.1.0\",\n \"doctoc\": \"^1.0.0\",\n \"escape-string-regexp\": \"^1.0.5 \",\n \"esdoc\": \"^0.4.7\",\n \"eslint\": \"^3.8.0\",\n \"fs-extra\": \"^2.1.2\",\n \"get-folder-size\": \"^1.0.0\",\n \"glob\": \"^7.0.3\",\n \"gm\": \"^1.22.0\",\n \"google-closure-compiler-js\": \"^20170218.0.0\",\n \"gzip-size\": \"^3.0.0\",\n \"http-server\": \"^0.9.0\",\n \"husky\": \"^0.13.3\",\n \"lint-staged\": \"3.2.5\",\n \"lodash\": \"^4.15.0\",\n \"madge\": \"^1.4.3\",\n \"markdown-doctest\": \"^0.9.1\",\n \"minimist\": \"^1.2.0\",\n \"mkdirp\": \"^0.5.1\",\n \"mocha\": \"^3.0.2\",\n \"mocha-in-sauce\": \"0.0.1\",\n \"npm-run-all\": \"^4.0.2\",\n \"npm-scripts-info\": \"^0.3.4\",\n \"nyc\": \"^10.2.0\",\n \"opn-cli\": \"^3.1.0\",\n \"platform\": \"^1.3.1\",\n \"promise\": \"^7.1.1\",\n \"protractor\": \"^3.1.1\",\n \"rollup\": \"0.36.3\",\n \"rollup-plugin-inject\": \"^2.0.0\",\n \"rollup-plugin-node-resolve\": \"^2.0.0\",\n \"rx\": \"latest\",\n \"rxjs\": \"latest\",\n \"shx\": \"^0.2.2\",\n \"sinon\": \"^2.1.0\",\n \"sinon-chai\": \"^2.9.0\",\n \"source-map-support\": \"^0.4.0\",\n \"tslib\": \"^1.5.0\",\n \"tslint\": \"^4.4.2\",\n \"typescript\": \"~2.0.6\",\n \"typings\": \"^2.0.0\",\n \"validate-commit-msg\": \"^2.14.0\",\n \"watch\": \"^1.0.1\",\n \"webpack\": \"^1.13.1\",\n \"xmlhttprequest\": \"1.8.0\"\n },\n \"engines\": {\n \"npm\": \">=2.0.0\"\n },\n \"typings\": \"Rx.d.ts\",\n \"dependencies\": {\n \"symbol-observable\": \"^1.0.1\"\n }\n}" }, - { path: "/a/b/node_modules/.staging/typescript-8493ea5d/package.json", content: "{\n \"name\": \"typescript\",\n \"author\": \"Microsoft Corp.\",\n \"homepage\": \"http://typescriptlang.org/\",\n \"version\": \"2.4.2\",\n \"license\": \"Apache-2.0\",\n \"description\": \"TypeScript is a language for application scale JavaScript development\",\n \"keywords\": [\n \"TypeScript\",\n \"Microsoft\",\n \"compiler\",\n \"language\",\n \"javascript\"\n ],\n \"bugs\": {\n \"url\": \"https://github.com/Microsoft/TypeScript/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/Microsoft/TypeScript.git\"\n },\n \"main\": \"./lib/typescript.js\",\n \"typings\": \"./lib/typescript.d.ts\",\n \"bin\": {\n \"tsc\": \"./bin/tsc\",\n \"tsserver\": \"./bin/tsserver\"\n },\n \"engines\": {\n \"node\": \">=4.2.0\"\n },\n \"devDependencies\": {\n \"@types/browserify\": \"latest\",\n \"@types/chai\": \"latest\",\n \"@types/convert-source-map\": \"latest\",\n \"@types/del\": \"latest\",\n \"@types/glob\": \"latest\",\n \"@types/gulp\": \"latest\",\n \"@types/gulp-concat\": \"latest\",\n \"@types/gulp-help\": \"latest\",\n \"@types/gulp-newer\": \"latest\",\n \"@types/gulp-sourcemaps\": \"latest\",\n \"@types/merge2\": \"latest\",\n \"@types/minimatch\": \"latest\",\n \"@types/minimist\": \"latest\",\n \"@types/mkdirp\": \"latest\",\n \"@types/mocha\": \"latest\",\n \"@types/node\": \"latest\",\n \"@types/q\": \"latest\",\n \"@types/run-sequence\": \"latest\",\n \"@types/through2\": \"latest\",\n \"browserify\": \"latest\",\n \"chai\": \"latest\",\n \"convert-source-map\": \"latest\",\n \"del\": \"latest\",\n \"gulp\": \"latest\",\n \"gulp-clone\": \"latest\",\n \"gulp-concat\": \"latest\",\n \"gulp-help\": \"latest\",\n \"gulp-insert\": \"latest\",\n \"gulp-newer\": \"latest\",\n \"gulp-sourcemaps\": \"latest\",\n \"gulp-typescript\": \"latest\",\n \"into-stream\": \"latest\",\n \"istanbul\": \"latest\",\n \"jake\": \"latest\",\n \"merge2\": \"latest\",\n \"minimist\": \"latest\",\n \"mkdirp\": \"latest\",\n \"mocha\": \"latest\",\n \"mocha-fivemat-progress-reporter\": \"latest\",\n \"q\": \"latest\",\n \"run-sequence\": \"latest\",\n \"sorcery\": \"latest\",\n \"through2\": \"latest\",\n \"travis-fold\": \"latest\",\n \"ts-node\": \"latest\",\n \"tslint\": \"latest\",\n \"typescript\": \"^2.4\"\n },\n \"scripts\": {\n \"pretest\": \"jake tests\",\n \"test\": \"jake runtests-parallel\",\n \"build\": \"npm run build:compiler && npm run build:tests\",\n \"build:compiler\": \"jake local\",\n \"build:tests\": \"jake tests\",\n \"start\": \"node lib/tsc\",\n \"clean\": \"jake clean\",\n \"gulp\": \"gulp\",\n \"jake\": \"jake\",\n \"lint\": \"jake lint\",\n \"setup-hooks\": \"node scripts/link-hooks.js\"\n },\n \"browser\": {\n \"buffer\": false,\n \"fs\": false,\n \"os\": false,\n \"path\": false\n }\n}" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/index.js", content: "module.exports = require('./lib/index');\n" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/index.d.ts", content: "declare const observableSymbol: symbol;\nexport default observableSymbol;\n" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/lib" }, - { path: "/a/b/node_modules/.staging/symbol-observable-24bcbbff/lib/index.js", content: "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ponyfill = require('./ponyfill');\n\nvar _ponyfill2 = _interopRequireDefault(_ponyfill);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar root; /* global window */\n\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = (0, _ponyfill2['default'])(root);\nexports['default'] = result;" }, - ].map(getRootedFileOrFolder); - verifyAfterPartialOrCompleteNpmInstall(2); - - filesAndFoldersToAdd.push(...[ - { path: "/a/b/node_modules/.staging/typescript-8493ea5d/lib" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/add/operator" }, - { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7/package.json", content: "{\n \"name\": \"@types/lodash\",\n \"version\": \"4.14.74\",\n \"description\": \"TypeScript definitions for Lo-Dash\",\n \"license\": \"MIT\",\n \"contributors\": [\n {\n \"name\": \"Brian Zengel\",\n \"url\": \"https://github.com/bczengel\"\n },\n {\n \"name\": \"Ilya Mochalov\",\n \"url\": \"https://github.com/chrootsu\"\n },\n {\n \"name\": \"Stepan Mikhaylyuk\",\n \"url\": \"https://github.com/stepancar\"\n },\n {\n \"name\": \"Eric L Anderson\",\n \"url\": \"https://github.com/ericanderson\"\n },\n {\n \"name\": \"AJ Richardson\",\n \"url\": \"https://github.com/aj-r\"\n },\n {\n \"name\": \"Junyoung Clare Jang\",\n \"url\": \"https://github.com/ailrun\"\n }\n ],\n \"main\": \"\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://www.github.com/DefinitelyTyped/DefinitelyTyped.git\"\n },\n \"scripts\": {},\n \"dependencies\": {},\n \"typesPublisherContentHash\": \"12af578ffaf8d86d2df37e591857906a86b983fa9258414326544a0fe6af0de8\",\n \"typeScriptVersion\": \"2.2\"\n}" }, - { path: "/a/b/node_modules/.staging/lodash-b0733faa/index.js", content: "module.exports = require('./lodash');" }, - { path: "/a/b/node_modules/.staging/typescript-8493ea5d/package.json.3017591594" } - ].map(getRootedFileOrFolder)); - // Since we added/removed in .staging no timeout - verifyAfterPartialOrCompleteNpmInstall(0); - - // Remove file "/a/b/node_modules/.staging/typescript-8493ea5d/package.json.3017591594" - filesAndFoldersToAdd.length--; - verifyAfterPartialOrCompleteNpmInstall(0); - - filesAndFoldersToAdd.push(...[ - { path: "/a/b/node_modules/.staging/rxjs-22375c61/bundles" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/operator" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/add/observable/dom" }, - { path: "/a/b/node_modules/.staging/@types/lodash-e56c4fe7/index.d.ts", content: "\n// Stub for lodash\nexport = _;\nexport as namespace _;\ndeclare var _: _.LoDashStatic;\ndeclare namespace _ {\n interface LoDashStatic {\n someProp: string;\n }\n class SomeClass {\n someMethod(): void;\n }\n}" } - ].map(getRootedFileOrFolder)); - verifyAfterPartialOrCompleteNpmInstall(0); - - filesAndFoldersToAdd.push(...[ - { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/scheduler" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/src/util" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/symbol" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/testing" }, - { path: "/a/b/node_modules/.staging/rxjs-22375c61/package.json.2252192041", content: "{\n \"_args\": [\n [\n {\n \"raw\": \"rxjs@^5.4.2\",\n \"scope\": null,\n \"escapedName\": \"rxjs\",\n \"name\": \"rxjs\",\n \"rawSpec\": \"^5.4.2\",\n \"spec\": \">=5.4.2 <6.0.0\",\n \"type\": \"range\"\n },\n \"C:\\\\Users\\\\shkamat\\\\Desktop\\\\app\"\n ]\n ],\n \"_from\": \"rxjs@>=5.4.2 <6.0.0\",\n \"_id\": \"rxjs@5.4.3\",\n \"_inCache\": true,\n \"_location\": \"/rxjs\",\n \"_nodeVersion\": \"7.7.2\",\n \"_npmOperationalInternal\": {\n \"host\": \"s3://npm-registry-packages\",\n \"tmp\": \"tmp/rxjs-5.4.3.tgz_1502407898166_0.6800217325799167\"\n },\n \"_npmUser\": {\n \"name\": \"blesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"_npmVersion\": \"5.3.0\",\n \"_phantomChildren\": {},\n \"_requested\": {\n \"raw\": \"rxjs@^5.4.2\",\n \"scope\": null,\n \"escapedName\": \"rxjs\",\n \"name\": \"rxjs\",\n \"rawSpec\": \"^5.4.2\",\n \"spec\": \">=5.4.2 <6.0.0\",\n \"type\": \"range\"\n },\n \"_requiredBy\": [\n \"/\"\n ],\n \"_resolved\": \"https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz\",\n \"_shasum\": \"0758cddee6033d68e0fd53676f0f3596ce3d483f\",\n \"_shrinkwrap\": null,\n \"_spec\": \"rxjs@^5.4.2\",\n \"_where\": \"C:\\\\Users\\\\shkamat\\\\Desktop\\\\app\",\n \"author\": {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/ReactiveX/RxJS/issues\"\n },\n \"config\": {\n \"commitizen\": {\n \"path\": \"cz-conventional-changelog\"\n }\n },\n \"contributors\": [\n {\n \"name\": \"Ben Lesh\",\n \"email\": \"ben@benlesh.com\"\n },\n {\n \"name\": \"Paul Taylor\",\n \"email\": \"paul.e.taylor@me.com\"\n },\n {\n \"name\": \"Jeff Cross\",\n \"email\": \"crossj@google.com\"\n },\n {\n \"name\": \"Matthew Podwysocki\",\n \"email\": \"matthewp@microsoft.com\"\n },\n {\n \"name\": \"OJ Kwon\",\n \"email\": \"kwon.ohjoong@gmail.com\"\n },\n {\n \"name\": \"Andre Staltz\",\n \"email\": \"andre@staltz.com\"\n }\n ],\n \"dependencies\": {\n \"symbol-observable\": \"^1.0.1\"\n },\n \"description\": \"Reactive Extensions for modern JavaScript\",\n \"devDependencies\": {\n \"babel-polyfill\": \"^6.23.0\",\n \"benchmark\": \"^2.1.0\",\n \"benchpress\": \"2.0.0-beta.1\",\n \"chai\": \"^3.5.0\",\n \"color\": \"^0.11.1\",\n \"colors\": \"1.1.2\",\n \"commitizen\": \"^2.8.6\",\n \"coveralls\": \"^2.11.13\",\n \"cz-conventional-changelog\": \"^1.2.0\",\n \"danger\": \"^1.1.0\",\n \"doctoc\": \"^1.0.0\",\n \"escape-string-regexp\": \"^1.0.5 \",\n \"esdoc\": \"^0.4.7\",\n \"eslint\": \"^3.8.0\",\n \"fs-extra\": \"^2.1.2\",\n \"get-folder-size\": \"^1.0.0\",\n \"glob\": \"^7.0.3\",\n \"gm\": \"^1.22.0\",\n \"google-closure-compiler-js\": \"^20170218.0.0\",\n \"gzip-size\": \"^3.0.0\",\n \"http-server\": \"^0.9.0\",\n \"husky\": \"^0.13.3\",\n \"lint-staged\": \"3.2.5\",\n \"lodash\": \"^4.15.0\",\n \"madge\": \"^1.4.3\",\n \"markdown-doctest\": \"^0.9.1\",\n \"minimist\": \"^1.2.0\",\n \"mkdirp\": \"^0.5.1\",\n \"mocha\": \"^3.0.2\",\n \"mocha-in-sauce\": \"0.0.1\",\n \"npm-run-all\": \"^4.0.2\",\n \"npm-scripts-info\": \"^0.3.4\",\n \"nyc\": \"^10.2.0\",\n \"opn-cli\": \"^3.1.0\",\n \"platform\": \"^1.3.1\",\n \"promise\": \"^7.1.1\",\n \"protractor\": \"^3.1.1\",\n \"rollup\": \"0.36.3\",\n \"rollup-plugin-inject\": \"^2.0.0\",\n \"rollup-plugin-node-resolve\": \"^2.0.0\",\n \"rx\": \"latest\",\n \"rxjs\": \"latest\",\n \"shx\": \"^0.2.2\",\n \"sinon\": \"^2.1.0\",\n \"sinon-chai\": \"^2.9.0\",\n \"source-map-support\": \"^0.4.0\",\n \"tslib\": \"^1.5.0\",\n \"tslint\": \"^4.4.2\",\n \"typescript\": \"~2.0.6\",\n \"typings\": \"^2.0.0\",\n \"validate-commit-msg\": \"^2.14.0\",\n \"watch\": \"^1.0.1\",\n \"webpack\": \"^1.13.1\",\n \"xmlhttprequest\": \"1.8.0\"\n },\n \"directories\": {},\n \"dist\": {\n \"integrity\": \"sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==\",\n \"shasum\": \"0758cddee6033d68e0fd53676f0f3596ce3d483f\",\n \"tarball\": \"https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz\"\n },\n \"engines\": {\n \"npm\": \">=2.0.0\"\n },\n \"homepage\": \"https://github.com/ReactiveX/RxJS\",\n \"keywords\": [\n \"Rx\",\n \"RxJS\",\n \"ReactiveX\",\n \"ReactiveExtensions\",\n \"Streams\",\n \"Observables\",\n \"Observable\",\n \"Stream\",\n \"ES6\",\n \"ES2015\"\n ],\n \"license\": \"Apache-2.0\",\n \"lint-staged\": {\n \"*.@(js)\": [\n \"eslint --fix\",\n \"git add\"\n ],\n \"*.@(ts)\": [\n \"tslint --fix\",\n \"git add\"\n ]\n },\n \"main\": \"Rx.js\",\n \"maintainers\": [\n {\n \"name\": \"blesh\",\n \"email\": \"ben@benlesh.com\"\n }\n ],\n \"name\": \"rxjs\",\n \"optionalDependencies\": {},\n \"readme\": \"ERROR: No README data found!\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+ssh://git@github.com/ReactiveX/RxJS.git\"\n },\n \"scripts-info\": {\n \"info\": \"List available script\",\n \"build_all\": \"Build all packages (ES6, CJS, UMD) and generate packages\",\n \"build_cjs\": \"Build CJS package with clean up existing build, copy source into dist\",\n \"build_es6\": \"Build ES6 package with clean up existing build, copy source into dist\",\n \"build_closure_core\": \"Minify Global core build using closure compiler\",\n \"build_global\": \"Build Global package, then minify build\",\n \"build_perf\": \"Build CJS & Global build, run macro performance test\",\n \"build_test\": \"Build CJS package & test spec, execute mocha test runner\",\n \"build_cover\": \"Run lint to current code, build CJS & test spec, execute test coverage\",\n \"build_docs\": \"Build ES6 & global package, create documentation using it\",\n \"build_spec\": \"Build test specs\",\n \"check_circular_dependencies\": \"Check codebase has circular dependencies\",\n \"clean_spec\": \"Clean up existing test spec build output\",\n \"clean_dist_cjs\": \"Clean up existing CJS package output\",\n \"clean_dist_es6\": \"Clean up existing ES6 package output\",\n \"clean_dist_global\": \"Clean up existing Global package output\",\n \"commit\": \"Run git commit wizard\",\n \"compile_dist_cjs\": \"Compile codebase into CJS module\",\n \"compile_module_es6\": \"Compile codebase into ES6\",\n \"cover\": \"Execute test coverage\",\n \"lint_perf\": \"Run lint against performance test suite\",\n \"lint_spec\": \"Run lint against test spec\",\n \"lint_src\": \"Run lint against source\",\n \"lint\": \"Run lint against everything\",\n \"perf\": \"Run macro performance benchmark\",\n \"perf_micro\": \"Run micro performance benchmark\",\n \"test_mocha\": \"Execute mocha test runner against existing test spec build\",\n \"test_browser\": \"Execute mocha test runner on browser against existing test spec build\",\n \"test\": \"Clean up existing test spec build, build test spec and execute mocha test runner\",\n \"tests2png\": \"Generate marble diagram image from test spec\",\n \"watch\": \"Watch codebase, trigger compile when source code changes\"\n },\n \"typings\": \"Rx.d.ts\",\n \"version\": \"5.4.3\"\n}\n" } - ].map(getRootedFileOrFolder)); - verifyAfterPartialOrCompleteNpmInstall(0); - - // remove /a/b/node_modules/.staging/rxjs-22375c61/package.json.2252192041 - filesAndFoldersToAdd.length--; - // and add few more folders/files - filesAndFoldersToAdd.push(...[ - { path: "/a/b/node_modules/symbol-observable" }, - { path: "/a/b/node_modules/@types" }, - { path: "/a/b/node_modules/@types/lodash" }, - { path: "/a/b/node_modules/lodash" }, - { path: "/a/b/node_modules/rxjs" }, - { path: "/a/b/node_modules/typescript" }, - { path: "/a/b/node_modules/.bin" } - ].map(getRootedFileOrFolder)); - // From the type root update - verifyAfterPartialOrCompleteNpmInstall(2); - - forEach(filesAndFoldersToAdd, f => { - f.path = f.path - .replace("/a/b/node_modules/.staging", "/a/b/node_modules") - .replace(/[\-\.][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w][\d\w]/g, ""); - }); - - const lodashIndexPath = root + "/a/b/node_modules/@types/lodash/index.d.ts"; - projectFiles.push(find(filesAndFoldersToAdd, f => f.path === lodashIndexPath)!); - // we would now not have failed lookup in the parent of appFolder since lodash is available - recursiveWatchedDirectories.length = 2; - // npm installation complete, timeout after reload fs - npmInstallComplete = true; - verifyAfterPartialOrCompleteNpmInstall(2); - - function verifyAfterPartialOrCompleteNpmInstall(timeoutQueueLengthWhenRunningTimeouts: number) { - host.reloadFS(projectFiles.concat(otherFiles, filesAndFoldersToAdd)); - if (npmInstallComplete || timeoutDuringPartialInstallation) { - host.checkTimeoutQueueLengthAndRun(timeoutQueueLengthWhenRunningTimeouts); - } - else { - host.checkTimeoutQueueLength(2); - } - verifyProject(); - } - - function verifyProject() { - checkNumberOfConfiguredProjects(projectService, 1); - - const project = projectService.configuredProjects.get(tsconfigJson.path)!; - const projectFilePaths = map(projectFiles, f => f.path); - checkProjectActualFiles(project, projectFilePaths); - - const filesWatched = filter(projectFilePaths, p => p !== app.path && p.indexOf("/a/b/node_modules") === -1); - checkWatchedFiles(host, filesWatched); - checkWatchedDirectories(host, typeRootDirectories.concat(recursiveWatchedDirectories), /*recursive*/ true); - checkWatchedDirectories(host, [], /*recursive*/ false); - } - } - - it("timeouts occur inbetween installation", () => { - verifyNpmInstall(/*timeoutDuringPartialInstallation*/ true); - }); - - it("timeout occurs after installation", () => { - verifyNpmInstall(/*timeoutDuringPartialInstallation*/ false); - }); - }); - - it("when node_modules dont receive event for the @types file addition", () => { - const projectLocation = "/user/username/folder/myproject"; - const app: File = { - path: `${projectLocation}/app.ts`, - content: `import * as debug from "debug"` - }; - const tsconfig: File = { - path: `${projectLocation}/tsconfig.json`, - content: "" - }; - - const files = [app, tsconfig, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(app.path); - - const project = service.configuredProjects.get(tsconfig.path)!; - checkProjectActualFiles(project, files.map(f => f.path)); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(app.path).map(diag => diag.messageText), ["Cannot find module 'debug'."]); - - const debugTypesFile: File = { - path: `${projectLocation}/node_modules/@types/debug/index.d.ts`, - content: "export {}" - }; - files.push(debugTypesFile); - // Do not invoke recursive directory watcher for anything other than node_module/@types - const invoker = host.invokeWatchedDirectoriesRecursiveCallback; - host.invokeWatchedDirectoriesRecursiveCallback = (fullPath, relativePath) => { - if (fullPath.endsWith("@types")) { - invoker.call(host, fullPath, relativePath); - } - }; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkProjectActualFiles(project, files.map(f => f.path)); - assert.deepEqual(project.getLanguageService().getSemanticDiagnostics(app.path).map(diag => diag.messageText), []); - }); - }); - describe("tsserverProjectSystem with symLinks", () => { it("rename in common file renames all project", () => { const projects = "/users/username/projects"; From 5234b8b18e08d6835b90d3b667a77be9c3ccf9b6 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 13:23:26 -0800 Subject: [PATCH 235/322] Move more tests into resolutionCache and project errors --- src/testRunner/unittests/projectErrors.ts | 166 ++-- src/testRunner/unittests/resolutionCache.ts | 848 +++++++++--------- .../unittests/tsserverProjectSystem.ts | 46 - 3 files changed, 530 insertions(+), 530 deletions(-) diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/projectErrors.ts index 9ff7278e78c..cb82a9eeca6 100644 --- a/src/testRunner/unittests/projectErrors.ts +++ b/src/testRunner/unittests/projectErrors.ts @@ -481,89 +481,6 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors dont include overwrite emit error", () => { - it("for inferred project", () => { - const f1 = { - path: "/a/b/f1.js", - content: "function test1() { }" - }; - const host = createServerHost([f1, libFile]); - const session = createSession(host); - openFilesForSession([f1], session); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const projectName = projectService.inferredProjects[0].getProjectName(); - - const diags = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName: projectName } - }).response as ReadonlyArray; - assert.isTrue(diags.length === 0); - - session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsForInferredProjects, - seq: 3, - arguments: { options: { module: ModuleKind.CommonJS } } - }); - const diagsAfterUpdate = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 4, - arguments: { projectFileName: projectName } - }).response as ReadonlyArray; - assert.isTrue(diagsAfterUpdate.length === 0); - }); - - it("for external project", () => { - const f1 = { - path: "/a/b/f1.js", - content: "function test1() { }" - }; - const host = createServerHost([f1, libFile]); - const session = createSession(host); - const projectService = session.getProjectService(); - const projectFileName = "/a/b/project.csproj"; - const externalFiles = toExternalFiles([f1.path]); - projectService.openExternalProject({ - projectFileName, - rootFiles: externalFiles, - options: {} - }); - - checkNumberOfProjects(projectService, { externalProjects: 1 }); - - const diags = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName } - }).response as ReadonlyArray; - assert.isTrue(diags.length === 0); - - session.executeCommand({ - type: "request", - command: server.CommandNames.OpenExternalProject, - seq: 3, - arguments: { - projectFileName, - rootFiles: externalFiles, - options: { module: ModuleKind.CommonJS } - } - }); - const diagsAfterUpdate = session.executeCommand({ - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 4, - arguments: { projectFileName } - }).response as ReadonlyArray; - assert.isTrue(diagsAfterUpdate.length === 0); - }); - }); - describe("tsserver:: Project Errors for Configure file diagnostics events", () => { function getUnknownCompilerOptionDiagnostic(configFile: File, prop: string): ConfigFileDiagnostic { const d = Diagnostics.Unknown_compiler_option_0; @@ -754,6 +671,89 @@ namespace ts.projectSystem { }); }); + describe("tsserver:: Project Errors dont include overwrite emit error", () => { + it("for inferred project", () => { + const f1 = { + path: "/a/b/f1.js", + content: "function test1() { }" + }; + const host = createServerHost([f1, libFile]); + const session = createSession(host); + openFilesForSession([f1], session); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const projectName = projectService.inferredProjects[0].getProjectName(); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 2, + arguments: { projectFileName: projectName } + }).response as ReadonlyArray; + assert.isTrue(diags.length === 0); + + session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsForInferredProjects, + seq: 3, + arguments: { options: { module: ModuleKind.CommonJS } } + }); + const diagsAfterUpdate = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 4, + arguments: { projectFileName: projectName } + }).response as ReadonlyArray; + assert.isTrue(diagsAfterUpdate.length === 0); + }); + + it("for external project", () => { + const f1 = { + path: "/a/b/f1.js", + content: "function test1() { }" + }; + const host = createServerHost([f1, libFile]); + const session = createSession(host); + const projectService = session.getProjectService(); + const projectFileName = "/a/b/project.csproj"; + const externalFiles = toExternalFiles([f1.path]); + projectService.openExternalProject({ + projectFileName, + rootFiles: externalFiles, + options: {} + }); + + checkNumberOfProjects(projectService, { externalProjects: 1 }); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 2, + arguments: { projectFileName } + }).response as ReadonlyArray; + assert.isTrue(diags.length === 0); + + session.executeCommand({ + type: "request", + command: server.CommandNames.OpenExternalProject, + seq: 3, + arguments: { + projectFileName, + rootFiles: externalFiles, + options: { module: ModuleKind.CommonJS } + } + }); + const diagsAfterUpdate = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 4, + arguments: { projectFileName } + }).response as ReadonlyArray; + assert.isTrue(diagsAfterUpdate.length === 0); + }); + }); + describe("tsserver:: Project Errors reports Options Diagnostic locations correctly with changes in configFile contents", () => { it("when options change", () => { const file = { diff --git a/src/testRunner/unittests/resolutionCache.ts b/src/testRunner/unittests/resolutionCache.ts index ab6c6830618..d97770e21b5 100644 --- a/src/testRunner/unittests/resolutionCache.ts +++ b/src/testRunner/unittests/resolutionCache.ts @@ -495,6 +495,453 @@ namespace ts.projectSystem { }); }); + describe("resolutionCache:: tsserverProjectSystem watching @types", () => { + it("works correctly when typings are added or removed", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1;" + }; + const t1 = { + path: "/a/b/node_modules/@types/lib1/index.d.ts", + content: "export let a: number" + }; + const t2 = { + path: "/a/b/node_modules/@types/lib2/index.d.ts", + content: "export let b: number" + }; + const tsconfig = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ + compilerOptions: {}, + exclude: ["node_modules"] + }) + }; + const host = createServerHost([f1, t1, tsconfig]); + const projectService = createProjectService(host); + + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, t1.path, tsconfig.path]); + + // delete t1 + host.reloadFS([f1, tsconfig]); + // run throttled operation + host.runQueuedTimeoutCallbacks(); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, tsconfig.path]); + + // create t2 + host.reloadFS([f1, tsconfig, t2]); + // run throttled operation + host.runQueuedTimeoutCallbacks(); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, t2.path, tsconfig.path]); + }); + }); + + describe("resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { + it("should remove the `module not found` error", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const host = createServerHost([file1]); + const session = createSession(host); + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + + host.reloadFS([file1, moduleFile]); + host.runQueuedTimeoutCallbacks(); + + // Make a change to trigger the program rebuild + const changeRequest = makeSessionRequest( + server.CommandNames.Change, + { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } + ); + session.executeCommand(changeRequest); + + // Recheck + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("npm install @types works", () => { + const folderPath = "/a/b/projects/temp"; + const file1: File = { + path: `${folderPath}/a.ts`, + content: 'import f = require("pad"); f;' + }; + const files = [file1, libFile]; + const host = createServerHost(files); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { + file: file1.path, + fileContent: file1.content, + scriptKindName: "TS", + projectRootPath: folderPath + } + }); + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file1.path] + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + const startOffset = file1.content.indexOf('"') + 1; + checkErrorMessage(session, "semanticDiag", { + file: file1.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + '"pad"'.length }, Diagnostics.Cannot_find_module_0, ["pad"]) + ], + }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: file1.path, diagnostics: [] }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + + const padIndex: File = { + path: `${folderPath}/node_modules/@types/pad/index.d.ts`, + content: "export = pad;declare function pad(length: number, text: string, char ?: string): string;" + }; + files.push(padIndex); + host.reloadFS(files, { ignoreWatchInvokedWithTriggerAsFileCreate: true }); + host.runQueuedTimeoutCallbacks(); + checkProjectUpdatedInBackgroundEvent(session, [file1.path]); + session.clearMessages(); + + host.runQueuedTimeoutCallbacks(); + checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(); + checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] }); + }); + + it("suggestion diagnostics", () => { + const file: File = { + path: "/a.js", + content: "function f(p) {}", + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + host.checkTimeoutQueueLengthAndRun(2); + + checkProjectUpdatedInBackgroundEvent(session, [file.path]); + session.clearMessages(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "suggestionDiag", { + file: file.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecessary*/ true), + ], + }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + }); + + it("disable suggestion diagnostics", () => { + const file: File = { + path: "/a.js", + content: 'require("b")', + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + session.executeCommandSeq({ + command: server.CommandNames.Configure, + arguments: { + preferences: { disableSuggestions: true } + }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + host.checkTimeoutQueueLengthAndRun(2); + + checkProjectUpdatedInBackgroundEvent(session, [file.path]); + session.clearMessages(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); + // No suggestion event, we're done. + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + }); + + it("suppressed diagnostic events", () => { + const file: File = { + path: "/a.ts", + content: "1 = 2;", + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true, suppressDiagnosticEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + session.clearMessages(); + + let expectedSequenceId = session.getNextSeq(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + checkCompleteEvent(session, 1, expectedSequenceId); + + session.clearMessages(); + + expectedSequenceId = session.getNextSeq(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + file: file.path, + } + }); + + host.checkTimeoutQueueLength(0); + checkNoDiagnosticEvents(session); + + checkCompleteEvent(session, 1, expectedSequenceId); + + session.clearMessages(); + }); + }); + + describe("resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { + it("should restore the states for inferred projects", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const host = createServerHost([moduleFile, file1]); + const session = createSession(host); + + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + + const moduleFileOldPath = moduleFile.path; + const moduleFileNewPath = "/a/b/moduleFile1.ts"; + moduleFile.path = moduleFileNewPath; + host.reloadFS([moduleFile, file1]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + assert.equal(diags.length, 1); + + moduleFile.path = moduleFileOldPath; + host.reloadFS([moduleFile, file1]); + host.runQueuedTimeoutCallbacks(); + + // Make a change to trigger the program rebuild + const changeRequest = makeSessionRequest( + server.CommandNames.Change, + { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } + ); + session.executeCommand(changeRequest); + host.runQueuedTimeoutCallbacks(); + + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("should restore the states for configured projects", () => { + const moduleFile = { + path: "/a/b/moduleFile.ts", + content: "export function bar() { };" + }; + const file1 = { + path: "/a/b/file1.ts", + content: "import * as T from './moduleFile'; T.bar();" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([moduleFile, file1, configFile]); + const session = createSession(host); + + openFilesForSession([file1], session); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + + const moduleFileOldPath = moduleFile.path; + const moduleFileNewPath = "/a/b/moduleFile1.ts"; + moduleFile.path = moduleFileNewPath; + host.reloadFS([moduleFile, file1, configFile]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } + ]); + + moduleFile.path = moduleFileOldPath; + host.reloadFS([moduleFile, file1, configFile]); + host.runQueuedTimeoutCallbacks(); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("should property handle missing config files", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: "{}" + }; + const projectName = "project1"; + const host = createServerHost([f1]); + const projectService = createProjectService(host); + projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); + + // should have one external project since config file is missing + projectService.checkNumberOfProjects({ externalProjects: 1 }); + + host.reloadFS([f1, config]); + projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + }); + + it("types should load from config file path if config exists", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { types: ["node"], typeRoots: [] } }) + }; + const node = { + path: "/a/b/node_modules/@types/node/index.d.ts", + content: "declare var process: any" + }; + const cwd = { + path: "/a/c" + }; + const host = createServerHost([f1, config, node, cwd], { currentDirectory: cwd.path }); + const projectService = createProjectService(host); + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, node.path, config.path]); + }); + }); + describe("resolutionCache:: tsserverProjectSystem module resolution caching", () => { const projectLocation = "/user/username/projects/myproject"; const configFile: File = { @@ -978,405 +1425,4 @@ export const x = 10;` }); }); }); - - describe("resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { - it("should restore the states for inferred projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const host = createServerHost([moduleFile, file1]); - const session = createSession(host); - - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - assert.equal(diags.length, 1); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1]); - host.runQueuedTimeoutCallbacks(); - - // Make a change to trigger the program rebuild - const changeRequest = makeSessionRequest( - server.CommandNames.Change, - { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } - ); - session.executeCommand(changeRequest); - host.runQueuedTimeoutCallbacks(); - - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("should restore the states for configured projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createServerHost([moduleFile, file1, configFile]); - const session = createSession(host); - - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1, configFile]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1, configFile]); - host.runQueuedTimeoutCallbacks(); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("should property handle missing config files", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: "{}" - }; - const projectName = "project1"; - const host = createServerHost([f1]); - const projectService = createProjectService(host); - projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); - - // should have one external project since config file is missing - projectService.checkNumberOfProjects({ externalProjects: 1 }); - - host.reloadFS([f1, config]); - projectService.openExternalProject({ rootFiles: toExternalFiles([f1.path, config.path]), options: {}, projectFileName: projectName }); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - }); - - it("types should load from config file path if config exists", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { types: ["node"], typeRoots: [] } }) - }; - const node = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: "declare var process: any" - }; - const cwd = { - path: "/a/c" - }; - const host = createServerHost([f1, config, node, cwd], { currentDirectory: cwd.path }); - const projectService = createProjectService(host); - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, node.path, config.path]); - }); - }); - - describe("resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { - it("should remove the `module not found` error", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" - }; - const host = createServerHost([file1]); - const session = createSession(host); - openFilesForSession([file1], session); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_module_0, errorTextArguments: ["./moduleFile"] } - ]); - - host.reloadFS([file1, moduleFile]); - host.runQueuedTimeoutCallbacks(); - - // Make a change to trigger the program rebuild - const changeRequest = makeSessionRequest( - server.CommandNames.Change, - { file: file1.path, line: 1, offset: 44, endLine: 1, endOffset: 44, insertString: "\n" } - ); - session.executeCommand(changeRequest); - - // Recheck - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); - - it("npm install @types works", () => { - const folderPath = "/a/b/projects/temp"; - const file1: File = { - path: `${folderPath}/a.ts`, - content: 'import f = require("pad"); f;' - }; - const files = [file1, libFile]; - const host = createServerHost(files); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { - file: file1.path, - fileContent: file1.content, - scriptKindName: "TS", - projectRootPath: folderPath - } - }); - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file1.path] - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - const startOffset = file1.content.indexOf('"') + 1; - checkErrorMessage(session, "semanticDiag", { - file: file1.path, - diagnostics: [ - createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + '"pad"'.length }, Diagnostics.Cannot_find_module_0, ["pad"]) - ], - }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - checkErrorMessage(session, "suggestionDiag", { file: file1.path, diagnostics: [] }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - - const padIndex: File = { - path: `${folderPath}/node_modules/@types/pad/index.d.ts`, - content: "export = pad;declare function pad(length: number, text: string, char ?: string): string;" - }; - files.push(padIndex); - host.reloadFS(files, { ignoreWatchInvokedWithTriggerAsFileCreate: true }); - host.runQueuedTimeoutCallbacks(); - checkProjectUpdatedInBackgroundEvent(session, [file1.path]); - session.clearMessages(); - - host.runQueuedTimeoutCallbacks(); - checkErrorMessage(session, "syntaxDiag", { file: file1.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(); - checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] }); - }); - - it("suggestion diagnostics", () => { - const file: File = { - path: "/a.js", - content: "function f(p) {}", - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - host.checkTimeoutQueueLengthAndRun(2); - - checkProjectUpdatedInBackgroundEvent(session, [file.path]); - session.clearMessages(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - - checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "suggestionDiag", { - file: file.path, - diagnostics: [ - createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecessary*/ true), - ], - }); - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - }); - - it("disable suggestion diagnostics", () => { - const file: File = { - path: "/a.js", - content: 'require("b")', - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - session.executeCommandSeq({ - command: server.CommandNames.Configure, - arguments: { - preferences: { disableSuggestions: true } - }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - host.checkTimeoutQueueLengthAndRun(2); - - checkProjectUpdatedInBackgroundEvent(session, [file.path]); - session.clearMessages(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLengthAndRun(1); - - checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); - // No suggestion event, we're done. - checkCompleteEvent(session, 2, expectedSequenceId); - session.clearMessages(); - }); - - it("suppressed diagnostic events", () => { - const file: File = { - path: "/a.ts", - content: "1 = 2;", - }; - - const host = createServerHost([file]); - const session = createSession(host, { canUseEvents: true, suppressDiagnosticEvents: true }); - const service = session.getProjectService(); - - session.executeCommandSeq({ - command: server.CommandNames.Open, - arguments: { file: file.path, fileContent: file.content }, - }); - - checkNumberOfProjects(service, { inferredProjects: 1 }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - session.clearMessages(); - - let expectedSequenceId = session.getNextSeq(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [file.path], - } - }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - checkCompleteEvent(session, 1, expectedSequenceId); - - session.clearMessages(); - - expectedSequenceId = session.getNextSeq(); - - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - file: file.path, - } - }); - - host.checkTimeoutQueueLength(0); - checkNoDiagnosticEvents(session); - - checkCompleteEvent(session, 1, expectedSequenceId); - - session.clearMessages(); - }); - }); } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index f30e8ad5d9c..996b81d4c2d 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -3653,52 +3653,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem watching @types", () => { - it("works correctly when typings are added or removed", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1;" - }; - const t1 = { - path: "/a/b/node_modules/@types/lib1/index.d.ts", - content: "export let a: number" - }; - const t2 = { - path: "/a/b/node_modules/@types/lib2/index.d.ts", - content: "export let b: number" - }; - const tsconfig = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ - compilerOptions: {}, - exclude: ["node_modules"] - }) - }; - const host = createServerHost([f1, t1, tsconfig]); - const projectService = createProjectService(host); - - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, t1.path, tsconfig.path]); - - // delete t1 - host.reloadFS([f1, tsconfig]); - // run throttled operation - host.runQueuedTimeoutCallbacks(); - - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, tsconfig.path]); - - // create t2 - host.reloadFS([f1, tsconfig, t2]); - // run throttled operation - host.runQueuedTimeoutCallbacks(); - - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, t2.path, tsconfig.path]); - }); - }); - describe("tsserverProjectSystem Open-file", () => { it("can be reloaded with empty content", () => { const f = { From 9e17a66151ac9b4c6bb9d6507dfbdecd3985d844 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 13:44:01 -0800 Subject: [PATCH 236/322] Sym links into single test --- src/testRunner/tsconfig.json | 1 + src/testRunner/unittests/tsserverHelpers.ts | 17 +- .../unittests/tsserverProjectSystem.ts | 289 ------------------ src/testRunner/unittests/tsserverSymLinks.ts | 282 +++++++++++++++++ 4 files changed, 292 insertions(+), 297 deletions(-) create mode 100644 src/testRunner/unittests/tsserverSymLinks.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index daad5a29b6a..8a5aab050c7 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -93,6 +93,7 @@ "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", "unittests/tsserverProjectUpdatedInBackgroundEvent.ts", + "unittests/tsserverSymLinks.ts", "unittests/typingsInstaller.ts", "unittests/versionCache.ts", "unittests/watchEnvironment.ts", diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserverHelpers.ts index f042a43738a..86dfddf3bb3 100644 --- a/src/testRunner/unittests/tsserverHelpers.ts +++ b/src/testRunner/unittests/tsserverHelpers.ts @@ -482,14 +482,15 @@ namespace ts.projectSystem { const toLocation = protocolToLocation(str); return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; } - //function protocolRenameSpanFromSubstring( - // str: string, - // substring: string, - // options?: SpanFromSubstringOptions, - // prefixSuffixText?: { readonly prefixText?: string, readonly suffixText?: string }, - //): protocol.RenameTextSpan { - // return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; - //} + + export function protocolRenameSpanFromSubstring( + str: string, + substring: string, + options?: SpanFromSubstringOptions, + prefixSuffixText?: { readonly prefixText?: string, readonly suffixText?: string }, + ): protocol.RenameTextSpan { + return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; + } export function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { const start = nthIndexOf(str, substring, options ? options.index : 0); diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 996b81d4c2d..56493c01e35 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -7,14 +7,6 @@ namespace ts.projectSystem { checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles); } - function protocolRenameSpanFromSubstring( - str: string, - substring: string, - options?: SpanFromSubstringOptions, - prefixSuffixText?: { readonly prefixText?: string, readonly suffixText?: string }, - ): protocol.RenameTextSpan { - return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; - } function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; } @@ -5144,287 +5136,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem with symLinks", () => { - it("rename in common file renames all project", () => { - const projects = "/users/username/projects"; - const folderA = `${projects}/a`; - const aFile: File = { - path: `${folderA}/a.ts`, - content: `import {C} from "./c/fc"; console.log(C)` - }; - const aTsconfig: File = { - path: `${folderA}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { module: "commonjs" } }) - }; - const aC: SymLink = { - path: `${folderA}/c`, - symLink: "../c" - }; - const aFc = `${folderA}/c/fc.ts`; - - const folderB = `${projects}/b`; - const bFile: File = { - path: `${folderB}/b.ts`, - content: `import {C} from "./c/fc"; console.log(C)` - }; - const bTsconfig: File = { - path: `${folderB}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { module: "commonjs" } }) - }; - const bC: SymLink = { - path: `${folderB}/c`, - symLink: "../c" - }; - const bFc = `${folderB}/c/fc.ts`; - - const folderC = `${projects}/c`; - const cFile: File = { - path: `${folderC}/fc.ts`, - content: `export const C = 8` - }; - - const files = [cFile, libFile, aFile, aTsconfig, aC, bFile, bTsconfig, bC]; - const host = createServerHost(files); - const session = createSession(host); - const projectService = session.getProjectService(); - openFilesForSession( - [ - { file: aFile, projectRootPath: folderA }, - { file: bFile, projectRootPath: folderB }, - { file: aFc, projectRootPath: folderA }, - { file: bFc, projectRootPath: folderB }, - ], - session); - checkNumberOfProjects(projectService, { configuredProjects: 2 }); - assert.isDefined(projectService.configuredProjects.get(aTsconfig.path)); - assert.isDefined(projectService.configuredProjects.get(bTsconfig.path)); - - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, { file: aFc, ...protocolLocationFromSubstring(cFile.content, "C") }); - - assert.equal(aFile.content, bFile.content); - const abLocs: protocol.RenameTextSpan[] = [ - protocolRenameSpanFromSubstring(aFile.content, "C"), - protocolRenameSpanFromSubstring(aFile.content, "C", { index: 1 }), - ]; - const span = protocolRenameSpanFromSubstring(cFile.content, "C"); - const cLocs: protocol.RenameTextSpan[] = [span]; - assert.deepEqual(response, { - info: { - canRename: true, - displayName: "C", - fileToRename: undefined, - fullDisplayName: '"/users/username/projects/a/c/fc".C', - kind: ScriptElementKind.constElement, - kindModifiers: ScriptElementKindModifier.exportedModifier, - triggerSpan: protocolTextSpanFromSubstring(cFile.content, "C"), - }, - locs: [ - { file: aFc, locs: cLocs }, - { file: aFile.path, locs: abLocs }, - { file: bFc, locs: cLocs }, - { file: bFile.path, locs: abLocs }, - ], - }); - }); - - describe("module resolution when symlinked folder contents change and resolve modules", () => { - const projectRootPath = "/users/username/projects/myproject"; - const packages = `${projectRootPath}/javascript/packages`; - const recognizersDateTime = `${packages}/recognizers-date-time`; - const recognizersText = `${packages}/recognizers-text`; - const recognizersTextDist = `${recognizersText}/dist`; - const moduleName = "@microsoft/recognizers-text"; - const moduleNameInFile = `"${moduleName}"`; - const recognizersDateTimeSrcFile: File = { - path: `${recognizersDateTime}/src/datetime/baseDate.ts`, - content: `import {C} from ${moduleNameInFile}; -new C();` - }; - const recognizerDateTimeTsconfigPath = `${recognizersDateTime}/tsconfig.json`; - const recognizerDateTimeTsconfigWithoutPathMapping: File = { - path: recognizerDateTimeTsconfigPath, - content: JSON.stringify({ - include: ["src"] - }) - }; - const recognizerDateTimeTsconfigWithPathMapping: File = { - path: recognizerDateTimeTsconfigPath, - content: JSON.stringify({ - compilerOptions: { - rootDir: "src", - baseUrl: "./", - paths: { - "@microsoft/*": ["../*"] - } - }, - include: ["src"] - }) - }; - const nodeModulesRecorgnizersText: SymLink = { - path: `${recognizersDateTime}/node_modules/@microsoft/recognizers-text`, - symLink: recognizersText - }; - const recognizerTextSrcFile: File = { - path: `${recognizersText}/src/recognizers-text.ts`, - content: `export class C { method () { return 10; } }` - }; - const recongnizerTextDistTypingFile: File = { - path: `${recognizersTextDist}/types/recognizers-text.d.ts`, - content: `export class C { method(): number; }` - }; - const recongnizerTextPackageJson: File = { - path: `${recognizersText}/package.json`, - content: JSON.stringify({ - typings: "dist/types/recognizers-text.d.ts" - }) - }; - const filesInProjectWithUnresolvedModule = [recognizerDateTimeTsconfigPath, libFile.path, recognizersDateTimeSrcFile.path]; - const filesInProjectWithResolvedModule = [...filesInProjectWithUnresolvedModule, recongnizerTextDistTypingFile.path]; - - function verifyErrors(session: TestSession, semanticErrors: protocol.Diagnostic[]) { - session.clearMessages(); - const expectedSequenceId = session.getNextSeq(); - session.executeCommandSeq({ - command: server.CommandNames.Geterr, - arguments: { - delay: 0, - files: [recognizersDateTimeSrcFile.path], - } - }); - - const host = session.host; - host.checkTimeoutQueueLengthAndRun(1); - - checkErrorMessage(session, "syntaxDiag", { file: recognizersDateTimeSrcFile.path, diagnostics: [] }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "semanticDiag", { file: recognizersDateTimeSrcFile.path, diagnostics: semanticErrors }); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - - checkErrorMessage(session, "suggestionDiag", { - file: recognizersDateTimeSrcFile.path, - diagnostics: [], - }); - checkCompleteEvent(session, 2, expectedSequenceId); - } - - function verifyWatchedFilesAndDirectories(host: TestServerHost, files: string[], recursiveDirectories: ReadonlyMap, nonRecursiveDirectories: string[]) { - checkWatchedFilesDetailed(host, files.filter(f => f !== recognizersDateTimeSrcFile.path), 1); - checkWatchedDirectoriesDetailed(host, nonRecursiveDirectories, 1, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, recursiveDirectories, /*recursive*/ true); - } - - function createSessionAndOpenFile(host: TestServerHost) { - const session = createSession(host, { canUseEvents: true }); - session.executeCommandSeq({ - command: protocol.CommandTypes.Open, - arguments: { - file: recognizersDateTimeSrcFile.path, - projectRootPath - } - }); - return session; - } - - function verifyModuleResolution(withPathMapping: boolean) { - describe(withPathMapping ? "when tsconfig file contains path mapping" : "when tsconfig does not contain path mapping", () => { - const filesWithSources = [libFile, recognizersDateTimeSrcFile, withPathMapping ? recognizerDateTimeTsconfigWithPathMapping : recognizerDateTimeTsconfigWithoutPathMapping, recognizerTextSrcFile, recongnizerTextPackageJson]; - const filesWithNodeModulesSetup = [...filesWithSources, nodeModulesRecorgnizersText]; - const filesAfterCompilation = [...filesWithNodeModulesSetup, recongnizerTextDistTypingFile]; - - const watchedDirectoriesWithResolvedModule = arrayToMap(getTypeRootsFromLocation(recognizersDateTime), k => k, () => 1); - watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/src`, withPathMapping ? 1 : 2); // wild card + failed lookups - if (!withPathMapping) { - watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/node_modules`, 1); // failed lookups - } - const watchedDirectoriesWithUnresolvedModule = cloneMap(watchedDirectoriesWithResolvedModule); - watchedDirectoriesWithUnresolvedModule.set(`${recognizersDateTime}/src`, 2); // wild card + failed lookups - [`${recognizersDateTime}/node_modules`, ...(withPathMapping ? [recognizersText] : emptyArray), ...getNodeModuleDirectories(packages)].forEach(d => { - watchedDirectoriesWithUnresolvedModule.set(d, 1); - }); - const nonRecursiveWatchedDirectories = withPathMapping ? [packages] : emptyArray; - - function verifyProjectWithResolvedModule(session: TestSession) { - const projectService = session.getProjectService(); - const project = projectService.configuredProjects.get(recognizerDateTimeTsconfigPath)!; - checkProjectActualFiles(project, filesInProjectWithResolvedModule); - verifyWatchedFilesAndDirectories(session.host, filesInProjectWithResolvedModule, watchedDirectoriesWithResolvedModule, nonRecursiveWatchedDirectories); - verifyErrors(session, []); - } - - function verifyProjectWithUnresolvedModule(session: TestSession) { - const projectService = session.getProjectService(); - const project = projectService.configuredProjects.get(recognizerDateTimeTsconfigPath)!; - checkProjectActualFiles(project, filesInProjectWithUnresolvedModule); - verifyWatchedFilesAndDirectories(session.host, filesInProjectWithUnresolvedModule, watchedDirectoriesWithUnresolvedModule, nonRecursiveWatchedDirectories); - const startOffset = recognizersDateTimeSrcFile.content.indexOf('"') + 1; - verifyErrors(session, [ - createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + moduleNameInFile.length }, Diagnostics.Cannot_find_module_0, [moduleName]) - ]); - } - - it("when project compiles from sources", () => { - const host = createServerHost(filesWithSources); - const session = createSessionAndOpenFile(host); - verifyProjectWithUnresolvedModule(session); - - host.reloadFS(filesAfterCompilation); - host.runQueuedTimeoutCallbacks(); - - verifyProjectWithResolvedModule(session); - }); - - it("when project has node_modules setup but doesnt have modules in typings folder and then recompiles", () => { - const host = createServerHost(filesWithNodeModulesSetup); - const session = createSessionAndOpenFile(host); - verifyProjectWithUnresolvedModule(session); - - host.reloadFS(filesAfterCompilation); - host.runQueuedTimeoutCallbacks(); - - if (withPathMapping) { - verifyProjectWithResolvedModule(session); - } - else { - // Cannot handle the resolution update - verifyProjectWithUnresolvedModule(session); - } - }); - - it("when project recompiles after deleting generated folders", () => { - const host = createServerHost(filesAfterCompilation); - const session = createSessionAndOpenFile(host); - - verifyProjectWithResolvedModule(session); - - host.deleteFolder(recognizersTextDist, /*recursive*/ true); - host.runQueuedTimeoutCallbacks(); - - verifyProjectWithUnresolvedModule(session); - - host.ensureFileOrFolder(recongnizerTextDistTypingFile); - host.runQueuedTimeoutCallbacks(); - - if (withPathMapping) { - verifyProjectWithResolvedModule(session); - } - else { - // Cannot handle the resolution update - verifyProjectWithUnresolvedModule(session); - } - }); - }); - } - - verifyModuleResolution(/*withPathMapping*/ false); - verifyModuleResolution(/*withPathMapping*/ true); - }); - }); - describe("tsserverProjectSystem forceConsistentCasingInFileNames", () => { it("works when extends is specified with a case insensitive file system", () => { const rootPath = "/Users/username/dev/project"; diff --git a/src/testRunner/unittests/tsserverSymLinks.ts b/src/testRunner/unittests/tsserverSymLinks.ts new file mode 100644 index 00000000000..c9bad7ea678 --- /dev/null +++ b/src/testRunner/unittests/tsserverSymLinks.ts @@ -0,0 +1,282 @@ +namespace ts.projectSystem { + describe("tsserverProjectSystem with symLinks", () => { + it("rename in common file renames all project", () => { + const projects = "/users/username/projects"; + const folderA = `${projects}/a`; + const aFile: File = { + path: `${folderA}/a.ts`, + content: `import {C} from "./c/fc"; console.log(C)` + }; + const aTsconfig: File = { + path: `${folderA}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { module: "commonjs" } }) + }; + const aC: SymLink = { + path: `${folderA}/c`, + symLink: "../c" + }; + const aFc = `${folderA}/c/fc.ts`; + + const folderB = `${projects}/b`; + const bFile: File = { + path: `${folderB}/b.ts`, + content: `import {C} from "./c/fc"; console.log(C)` + }; + const bTsconfig: File = { + path: `${folderB}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { module: "commonjs" } }) + }; + const bC: SymLink = { + path: `${folderB}/c`, + symLink: "../c" + }; + const bFc = `${folderB}/c/fc.ts`; + + const folderC = `${projects}/c`; + const cFile: File = { + path: `${folderC}/fc.ts`, + content: `export const C = 8` + }; + + const files = [cFile, libFile, aFile, aTsconfig, aC, bFile, bTsconfig, bC]; + const host = createServerHost(files); + const session = createSession(host); + const projectService = session.getProjectService(); + openFilesForSession( + [ + { file: aFile, projectRootPath: folderA }, + { file: bFile, projectRootPath: folderB }, + { file: aFc, projectRootPath: folderA }, + { file: bFc, projectRootPath: folderB }, + ], + session); + checkNumberOfProjects(projectService, { configuredProjects: 2 }); + assert.isDefined(projectService.configuredProjects.get(aTsconfig.path)); + assert.isDefined(projectService.configuredProjects.get(bTsconfig.path)); + + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, { file: aFc, ...protocolLocationFromSubstring(cFile.content, "C") }); + + assert.equal(aFile.content, bFile.content); + const abLocs: protocol.RenameTextSpan[] = [ + protocolRenameSpanFromSubstring(aFile.content, "C"), + protocolRenameSpanFromSubstring(aFile.content, "C", { index: 1 }), + ]; + const span = protocolRenameSpanFromSubstring(cFile.content, "C"); + const cLocs: protocol.RenameTextSpan[] = [span]; + assert.deepEqual(response, { + info: { + canRename: true, + displayName: "C", + fileToRename: undefined, + fullDisplayName: '"/users/username/projects/a/c/fc".C', + kind: ScriptElementKind.constElement, + kindModifiers: ScriptElementKindModifier.exportedModifier, + triggerSpan: protocolTextSpanFromSubstring(cFile.content, "C"), + }, + locs: [ + { file: aFc, locs: cLocs }, + { file: aFile.path, locs: abLocs }, + { file: bFc, locs: cLocs }, + { file: bFile.path, locs: abLocs }, + ], + }); + }); + + describe("module resolution when symlinked folder contents change and resolve modules", () => { + const projectRootPath = "/users/username/projects/myproject"; + const packages = `${projectRootPath}/javascript/packages`; + const recognizersDateTime = `${packages}/recognizers-date-time`; + const recognizersText = `${packages}/recognizers-text`; + const recognizersTextDist = `${recognizersText}/dist`; + const moduleName = "@microsoft/recognizers-text"; + const moduleNameInFile = `"${moduleName}"`; + const recognizersDateTimeSrcFile: File = { + path: `${recognizersDateTime}/src/datetime/baseDate.ts`, + content: `import {C} from ${moduleNameInFile}; +new C();` + }; + const recognizerDateTimeTsconfigPath = `${recognizersDateTime}/tsconfig.json`; + const recognizerDateTimeTsconfigWithoutPathMapping: File = { + path: recognizerDateTimeTsconfigPath, + content: JSON.stringify({ + include: ["src"] + }) + }; + const recognizerDateTimeTsconfigWithPathMapping: File = { + path: recognizerDateTimeTsconfigPath, + content: JSON.stringify({ + compilerOptions: { + rootDir: "src", + baseUrl: "./", + paths: { + "@microsoft/*": ["../*"] + } + }, + include: ["src"] + }) + }; + const nodeModulesRecorgnizersText: SymLink = { + path: `${recognizersDateTime}/node_modules/@microsoft/recognizers-text`, + symLink: recognizersText + }; + const recognizerTextSrcFile: File = { + path: `${recognizersText}/src/recognizers-text.ts`, + content: `export class C { method () { return 10; } }` + }; + const recongnizerTextDistTypingFile: File = { + path: `${recognizersTextDist}/types/recognizers-text.d.ts`, + content: `export class C { method(): number; }` + }; + const recongnizerTextPackageJson: File = { + path: `${recognizersText}/package.json`, + content: JSON.stringify({ + typings: "dist/types/recognizers-text.d.ts" + }) + }; + const filesInProjectWithUnresolvedModule = [recognizerDateTimeTsconfigPath, libFile.path, recognizersDateTimeSrcFile.path]; + const filesInProjectWithResolvedModule = [...filesInProjectWithUnresolvedModule, recongnizerTextDistTypingFile.path]; + + function verifyErrors(session: TestSession, semanticErrors: protocol.Diagnostic[]) { + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [recognizersDateTimeSrcFile.path], + } + }); + + const host = session.host; + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: recognizersDateTimeSrcFile.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: recognizersDateTimeSrcFile.path, diagnostics: semanticErrors }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "suggestionDiag", { + file: recognizersDateTimeSrcFile.path, + diagnostics: [], + }); + checkCompleteEvent(session, 2, expectedSequenceId); + } + + function verifyWatchedFilesAndDirectories(host: TestServerHost, files: string[], recursiveDirectories: ReadonlyMap, nonRecursiveDirectories: string[]) { + checkWatchedFilesDetailed(host, files.filter(f => f !== recognizersDateTimeSrcFile.path), 1); + checkWatchedDirectoriesDetailed(host, nonRecursiveDirectories, 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, recursiveDirectories, /*recursive*/ true); + } + + function createSessionAndOpenFile(host: TestServerHost) { + const session = createSession(host, { canUseEvents: true }); + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { + file: recognizersDateTimeSrcFile.path, + projectRootPath + } + }); + return session; + } + + function verifyModuleResolution(withPathMapping: boolean) { + describe(withPathMapping ? "when tsconfig file contains path mapping" : "when tsconfig does not contain path mapping", () => { + const filesWithSources = [libFile, recognizersDateTimeSrcFile, withPathMapping ? recognizerDateTimeTsconfigWithPathMapping : recognizerDateTimeTsconfigWithoutPathMapping, recognizerTextSrcFile, recongnizerTextPackageJson]; + const filesWithNodeModulesSetup = [...filesWithSources, nodeModulesRecorgnizersText]; + const filesAfterCompilation = [...filesWithNodeModulesSetup, recongnizerTextDistTypingFile]; + + const watchedDirectoriesWithResolvedModule = arrayToMap(getTypeRootsFromLocation(recognizersDateTime), k => k, () => 1); + watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/src`, withPathMapping ? 1 : 2); // wild card + failed lookups + if (!withPathMapping) { + watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/node_modules`, 1); // failed lookups + } + const watchedDirectoriesWithUnresolvedModule = cloneMap(watchedDirectoriesWithResolvedModule); + watchedDirectoriesWithUnresolvedModule.set(`${recognizersDateTime}/src`, 2); // wild card + failed lookups + [`${recognizersDateTime}/node_modules`, ...(withPathMapping ? [recognizersText] : emptyArray), ...getNodeModuleDirectories(packages)].forEach(d => { + watchedDirectoriesWithUnresolvedModule.set(d, 1); + }); + const nonRecursiveWatchedDirectories = withPathMapping ? [packages] : emptyArray; + + function verifyProjectWithResolvedModule(session: TestSession) { + const projectService = session.getProjectService(); + const project = projectService.configuredProjects.get(recognizerDateTimeTsconfigPath)!; + checkProjectActualFiles(project, filesInProjectWithResolvedModule); + verifyWatchedFilesAndDirectories(session.host, filesInProjectWithResolvedModule, watchedDirectoriesWithResolvedModule, nonRecursiveWatchedDirectories); + verifyErrors(session, []); + } + + function verifyProjectWithUnresolvedModule(session: TestSession) { + const projectService = session.getProjectService(); + const project = projectService.configuredProjects.get(recognizerDateTimeTsconfigPath)!; + checkProjectActualFiles(project, filesInProjectWithUnresolvedModule); + verifyWatchedFilesAndDirectories(session.host, filesInProjectWithUnresolvedModule, watchedDirectoriesWithUnresolvedModule, nonRecursiveWatchedDirectories); + const startOffset = recognizersDateTimeSrcFile.content.indexOf('"') + 1; + verifyErrors(session, [ + createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + moduleNameInFile.length }, Diagnostics.Cannot_find_module_0, [moduleName]) + ]); + } + + it("when project compiles from sources", () => { + const host = createServerHost(filesWithSources); + const session = createSessionAndOpenFile(host); + verifyProjectWithUnresolvedModule(session); + + host.reloadFS(filesAfterCompilation); + host.runQueuedTimeoutCallbacks(); + + verifyProjectWithResolvedModule(session); + }); + + it("when project has node_modules setup but doesnt have modules in typings folder and then recompiles", () => { + const host = createServerHost(filesWithNodeModulesSetup); + const session = createSessionAndOpenFile(host); + verifyProjectWithUnresolvedModule(session); + + host.reloadFS(filesAfterCompilation); + host.runQueuedTimeoutCallbacks(); + + if (withPathMapping) { + verifyProjectWithResolvedModule(session); + } + else { + // Cannot handle the resolution update + verifyProjectWithUnresolvedModule(session); + } + }); + + it("when project recompiles after deleting generated folders", () => { + const host = createServerHost(filesAfterCompilation); + const session = createSessionAndOpenFile(host); + + verifyProjectWithResolvedModule(session); + + host.deleteFolder(recognizersTextDist, /*recursive*/ true); + host.runQueuedTimeoutCallbacks(); + + verifyProjectWithUnresolvedModule(session); + + host.ensureFileOrFolder(recongnizerTextDistTypingFile); + host.runQueuedTimeoutCallbacks(); + + if (withPathMapping) { + verifyProjectWithResolvedModule(session); + } + else { + // Cannot handle the resolution update + verifyProjectWithUnresolvedModule(session); + } + }); + }); + } + + verifyModuleResolution(/*withPathMapping*/ false); + verifyModuleResolution(/*withPathMapping*/ true); + }); + }); +} From 5c8ef3934d81d77cc9f780419aa8b39128e313c9 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 13:53:51 -0800 Subject: [PATCH 237/322] Move the tests into their own folder for easy scenario search --- src/testRunner/tsconfig.json | 83 ++- .../{ => config}/commandLineParsing.ts | 0 .../{ => config}/configurationExtension.ts | 0 .../convertCompilerOptionsFromJson.ts | 0 .../convertTypeAcquisitionFromJson.ts | 0 .../{ => config}/initializeTSConfig.ts | 0 .../unittests/{ => config}/matchFiles.ts | 0 .../{ => config}/projectReferences.ts | 0 .../unittests/{ => config}/showConfig.ts | 0 .../unittests/{ => config}/tsconfigParsing.ts | 0 .../cancellableLanguageServiceOperations.ts | 0 .../{ => services}/convertToAsyncFunction.ts | 0 .../extract/constants.ts} | 0 .../extract/functions.ts} | 0 .../extract/helpers.ts} | 0 .../extract/ranges.ts} | 0 .../{ => services/extract}/symbolWalker.ts | 2 +- .../{ => services}/hostNewLineSupport.ts | 0 .../{ => services}/languageService.ts | 0 .../{ => services}/organizeImports.ts | 0 .../unittests/{ => services}/textChanges.ts | 0 .../{tscWatchEmit.ts => tscWatch/emit.ts} | 0 .../helpers.ts} | 0 .../unittests/tscWatch/resolutionCache.ts | 448 ++++++++++++ .../unittests/{ => tscWatch}/watchApi.ts | 0 .../unittests/tscWatch/watchEnvironment.ts | 178 +++++ .../cachingFileSystemInformation.ts} | 2 +- .../unittests/{ => tsserver}/compileOnSave.ts | 4 +- .../events/largeFileReferenced.ts} | 2 +- .../events/projectLoading.ts} | 2 +- .../events/projectUpdatedInBackground.ts} | 2 +- .../unittests/tsserver/externalProjects.ts | 300 ++++++++ .../helpers.ts} | 0 .../unittests/{ => tsserver}/projectErrors.ts | 0 src/testRunner/unittests/tsserver/reload.ts | 151 ++++ .../{ => tsserver}/resolutionCache.ts | 449 ------------ .../unittests/{ => tsserver}/session.ts | 0 .../unittests/tsserver/skipLibCheck.ts | 229 ++++++ .../symLinks.ts} | 2 +- .../unittests/{ => tsserver}/telemetry.ts | 0 .../unittests/{ => tsserver}/textStorage.ts | 0 .../{ => tsserver}/typingsInstaller.ts | 0 .../unittests/{ => tsserver}/versionCache.ts | 0 .../unittests/tsserver/watchEnvironment.ts | 135 ++++ .../unittests/tsserverProjectSystem.ts | 677 ------------------ src/testRunner/unittests/watchEnvironment.ts | 316 -------- 46 files changed, 1493 insertions(+), 1489 deletions(-) rename src/testRunner/unittests/{ => config}/commandLineParsing.ts (100%) rename src/testRunner/unittests/{ => config}/configurationExtension.ts (100%) rename src/testRunner/unittests/{ => config}/convertCompilerOptionsFromJson.ts (100%) rename src/testRunner/unittests/{ => config}/convertTypeAcquisitionFromJson.ts (100%) rename src/testRunner/unittests/{ => config}/initializeTSConfig.ts (100%) rename src/testRunner/unittests/{ => config}/matchFiles.ts (100%) rename src/testRunner/unittests/{ => config}/projectReferences.ts (100%) rename src/testRunner/unittests/{ => config}/showConfig.ts (100%) rename src/testRunner/unittests/{ => config}/tsconfigParsing.ts (100%) rename src/testRunner/unittests/{ => services}/cancellableLanguageServiceOperations.ts (100%) rename src/testRunner/unittests/{ => services}/convertToAsyncFunction.ts (100%) rename src/testRunner/unittests/{extractConstants.ts => services/extract/constants.ts} (100%) rename src/testRunner/unittests/{extractFunctions.ts => services/extract/functions.ts} (100%) rename src/testRunner/unittests/{extractTestHelpers.ts => services/extract/helpers.ts} (100%) rename src/testRunner/unittests/{extractRanges.ts => services/extract/ranges.ts} (100%) rename src/testRunner/unittests/{ => services/extract}/symbolWalker.ts (97%) rename src/testRunner/unittests/{ => services}/hostNewLineSupport.ts (100%) rename src/testRunner/unittests/{ => services}/languageService.ts (100%) rename src/testRunner/unittests/{ => services}/organizeImports.ts (100%) rename src/testRunner/unittests/{ => services}/textChanges.ts (100%) rename src/testRunner/unittests/{tscWatchEmit.ts => tscWatch/emit.ts} (100%) rename src/testRunner/unittests/{tscWatchHelpers.ts => tscWatch/helpers.ts} (100%) create mode 100644 src/testRunner/unittests/tscWatch/resolutionCache.ts rename src/testRunner/unittests/{ => tscWatch}/watchApi.ts (100%) create mode 100644 src/testRunner/unittests/tscWatch/watchEnvironment.ts rename src/testRunner/unittests/{tsserverCachingFileSystemInformation.ts => tsserver/cachingFileSystemInformation.ts} (98%) rename src/testRunner/unittests/{ => tsserver}/compileOnSave.ts (97%) rename src/testRunner/unittests/{tsserverLargeFileReferencedEvent.ts => tsserver/events/largeFileReferenced.ts} (95%) rename src/testRunner/unittests/{tsserverProjectLoadingEvents.ts => tsserver/events/projectLoading.ts} (96%) rename src/testRunner/unittests/{tsserverProjectUpdatedInBackgroundEvent.ts => tsserver/events/projectUpdatedInBackground.ts} (97%) create mode 100644 src/testRunner/unittests/tsserver/externalProjects.ts rename src/testRunner/unittests/{tsserverHelpers.ts => tsserver/helpers.ts} (100%) rename src/testRunner/unittests/{ => tsserver}/projectErrors.ts (100%) create mode 100644 src/testRunner/unittests/tsserver/reload.ts rename src/testRunner/unittests/{ => tsserver}/resolutionCache.ts (71%) rename src/testRunner/unittests/{ => tsserver}/session.ts (100%) create mode 100644 src/testRunner/unittests/tsserver/skipLibCheck.ts rename src/testRunner/unittests/{tsserverSymLinks.ts => tsserver/symLinks.ts} (97%) rename src/testRunner/unittests/{ => tsserver}/telemetry.ts (100%) rename src/testRunner/unittests/{ => tsserver}/textStorage.ts (100%) rename src/testRunner/unittests/{ => tsserver}/typingsInstaller.ts (100%) rename src/testRunner/unittests/{ => tsserver}/versionCache.ts (100%) create mode 100644 src/testRunner/unittests/tsserver/watchEnvironment.ts delete mode 100644 src/testRunner/unittests/watchEnvironment.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 8a5aab050c7..a7d82b84464 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -36,74 +36,79 @@ "runner.ts", - "unittests/extractTestHelpers.ts", - "unittests/tscWatchHelpers.ts", - "unittests/tsserverHelpers.ts", + "unittests/services/extract/helpers.ts", + "unittests/tscWatch/helpers.ts", + "unittests/tsserver/helpers.ts", "unittests/asserts.ts", "unittests/base64.ts", "unittests/builder.ts", - "unittests/cancellableLanguageServiceOperations.ts", - "unittests/commandLineParsing.ts", - "unittests/compileOnSave.ts", "unittests/compilerCore.ts", - "unittests/configurationExtension.ts", - "unittests/convertCompilerOptionsFromJson.ts", - "unittests/convertToAsyncFunction.ts", "unittests/convertToBase64.ts", - "unittests/convertTypeAcquisitionFromJson.ts", "unittests/customTransforms.ts", - "unittests/extractConstants.ts", - "unittests/extractFunctions.ts", - "unittests/extractRanges.ts", "unittests/factory.ts", - "unittests/hostNewLineSupport.ts", "unittests/incrementalParser.ts", - "unittests/initializeTSConfig.ts", "unittests/jsDocParsing.ts", - "unittests/languageService.ts", - "unittests/matchFiles.ts", "unittests/moduleResolution.ts", - "unittests/organizeImports.ts", "unittests/parsePseudoBigInt.ts", "unittests/paths.ts", "unittests/printer.ts", "unittests/programApi.ts", - "unittests/projectErrors.ts", - "unittests/projectReferences.ts", "unittests/publicApi.ts", - "unittests/resolutionCache.ts", "unittests/reuseProgramStructure.ts", - "unittests/session.ts", "unittests/semver.ts", - "unittests/showConfig.ts", - "unittests/symbolWalker.ts", - "unittests/telemetry.ts", - "unittests/textChanges.ts", - "unittests/textStorage.ts", "unittests/transform.ts", "unittests/transpile.ts", "unittests/tsbuild.ts", "unittests/tsbuildWatchMode.ts", - "unittests/tsconfigParsing.ts", - "unittests/tscWatchEmit.ts", "unittests/tscWatchMode.ts", - "unittests/tsserverCachingFileSystemInformation.ts", - "unittests/tsserverLargeFileReferencedEvent.ts", - "unittests/tsserverProjectLoadingEvents.ts", "unittests/tsserverProjectSystem.ts", - "unittests/tsserverProjectUpdatedInBackgroundEvent.ts", - "unittests/tsserverSymLinks.ts", - "unittests/typingsInstaller.ts", - "unittests/versionCache.ts", - "unittests/watchEnvironment.ts", - "unittests/watchApi.ts", + "unittests/config/commandLineParsing.ts", + "unittests/config/configurationExtension.ts", + "unittests/config/convertCompilerOptionsFromJson.ts", + "unittests/config/convertTypeAcquisitionFromJson.ts", + "unittests/config/initializeTSConfig.ts", + "unittests/config/matchFiles.ts", + "unittests/config/projectReferences.ts", + "unittests/config/showConfig.ts", + "unittests/config/tsconfigParsing.ts", "unittests/evaluation/asyncArrow.ts", "unittests/evaluation/asyncGenerator.ts", "unittests/evaluation/forAwaitOf.ts", + "unittests/services/cancellableLanguageServiceOperations.ts", "unittests/services/colorization.ts", + "unittests/services/convertToAsyncFunction.ts", "unittests/services/documentRegistry.ts", + "unittests/services/extract/constants.ts", + "unittests/services/extract/functions.ts", + "unittests/services/extract/symbolWalker.ts", + "unittests/services/extract/ranges.ts", + "unittests/services/hostNewLineSupport.ts", + "unittests/services/languageService.ts", + "unittests/services/organizeImports.ts", "unittests/services/patternMatcher.ts", - "unittests/services/preProcessFile.ts" + "unittests/services/preProcessFile.ts", + "unittests/services/textChanges.ts", + "unittests/tscWatch/emit.ts", + "unittests/tscWatch/resolutionCache.ts", + "unittests/tscWatch/watchEnvironment.ts", + "unittests/tscWatch/watchApi.ts", + "unittests/tsserver/cachingFileSystemInformation.ts", + "unittests/tsserver/compileOnSave.ts", + "unittests/tsserver/events/largeFileReferenced.ts", + "unittests/tsserver/events/projectLoading.ts", + "unittests/tsserver/events/projectUpdatedInBackground.ts", + "unittests/tsserver/externalProjects.ts", + "unittests/tsserver/projectErrors.ts", + "unittests/tsserver/reload.ts", + "unittests/tsserver/resolutionCache.ts", + "unittests/tsserver/session.ts", + "unittests/tsserver/skipLibCheck.ts", + "unittests/tsserver/symLinks.ts", + "unittests/tsserver/textStorage.ts", + "unittests/tsserver/telemetry.ts", + "unittests/tsserver/typingsInstaller.ts", + "unittests/tsserver/versionCache.ts", + "unittests/tsserver/watchEnvironment.ts" ] } diff --git a/src/testRunner/unittests/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts similarity index 100% rename from src/testRunner/unittests/commandLineParsing.ts rename to src/testRunner/unittests/config/commandLineParsing.ts diff --git a/src/testRunner/unittests/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts similarity index 100% rename from src/testRunner/unittests/configurationExtension.ts rename to src/testRunner/unittests/config/configurationExtension.ts diff --git a/src/testRunner/unittests/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts similarity index 100% rename from src/testRunner/unittests/convertCompilerOptionsFromJson.ts rename to src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts diff --git a/src/testRunner/unittests/convertTypeAcquisitionFromJson.ts b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts similarity index 100% rename from src/testRunner/unittests/convertTypeAcquisitionFromJson.ts rename to src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts diff --git a/src/testRunner/unittests/initializeTSConfig.ts b/src/testRunner/unittests/config/initializeTSConfig.ts similarity index 100% rename from src/testRunner/unittests/initializeTSConfig.ts rename to src/testRunner/unittests/config/initializeTSConfig.ts diff --git a/src/testRunner/unittests/matchFiles.ts b/src/testRunner/unittests/config/matchFiles.ts similarity index 100% rename from src/testRunner/unittests/matchFiles.ts rename to src/testRunner/unittests/config/matchFiles.ts diff --git a/src/testRunner/unittests/projectReferences.ts b/src/testRunner/unittests/config/projectReferences.ts similarity index 100% rename from src/testRunner/unittests/projectReferences.ts rename to src/testRunner/unittests/config/projectReferences.ts diff --git a/src/testRunner/unittests/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts similarity index 100% rename from src/testRunner/unittests/showConfig.ts rename to src/testRunner/unittests/config/showConfig.ts diff --git a/src/testRunner/unittests/tsconfigParsing.ts b/src/testRunner/unittests/config/tsconfigParsing.ts similarity index 100% rename from src/testRunner/unittests/tsconfigParsing.ts rename to src/testRunner/unittests/config/tsconfigParsing.ts diff --git a/src/testRunner/unittests/cancellableLanguageServiceOperations.ts b/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts similarity index 100% rename from src/testRunner/unittests/cancellableLanguageServiceOperations.ts rename to src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts diff --git a/src/testRunner/unittests/convertToAsyncFunction.ts b/src/testRunner/unittests/services/convertToAsyncFunction.ts similarity index 100% rename from src/testRunner/unittests/convertToAsyncFunction.ts rename to src/testRunner/unittests/services/convertToAsyncFunction.ts diff --git a/src/testRunner/unittests/extractConstants.ts b/src/testRunner/unittests/services/extract/constants.ts similarity index 100% rename from src/testRunner/unittests/extractConstants.ts rename to src/testRunner/unittests/services/extract/constants.ts diff --git a/src/testRunner/unittests/extractFunctions.ts b/src/testRunner/unittests/services/extract/functions.ts similarity index 100% rename from src/testRunner/unittests/extractFunctions.ts rename to src/testRunner/unittests/services/extract/functions.ts diff --git a/src/testRunner/unittests/extractTestHelpers.ts b/src/testRunner/unittests/services/extract/helpers.ts similarity index 100% rename from src/testRunner/unittests/extractTestHelpers.ts rename to src/testRunner/unittests/services/extract/helpers.ts diff --git a/src/testRunner/unittests/extractRanges.ts b/src/testRunner/unittests/services/extract/ranges.ts similarity index 100% rename from src/testRunner/unittests/extractRanges.ts rename to src/testRunner/unittests/services/extract/ranges.ts diff --git a/src/testRunner/unittests/symbolWalker.ts b/src/testRunner/unittests/services/extract/symbolWalker.ts similarity index 97% rename from src/testRunner/unittests/symbolWalker.ts rename to src/testRunner/unittests/services/extract/symbolWalker.ts index 4743b87133b..a027f0f2ce7 100644 --- a/src/testRunner/unittests/symbolWalker.ts +++ b/src/testRunner/unittests/services/extract/symbolWalker.ts @@ -42,4 +42,4 @@ export default function foo(a: number, b: Bar): void {}`, (file, checker) => { assert.equal(stdLibRefSymbols, 1); // Expect 1 stdlib entry symbol - the implicit Array referenced by Bar.history }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/hostNewLineSupport.ts b/src/testRunner/unittests/services/hostNewLineSupport.ts similarity index 100% rename from src/testRunner/unittests/hostNewLineSupport.ts rename to src/testRunner/unittests/services/hostNewLineSupport.ts diff --git a/src/testRunner/unittests/languageService.ts b/src/testRunner/unittests/services/languageService.ts similarity index 100% rename from src/testRunner/unittests/languageService.ts rename to src/testRunner/unittests/services/languageService.ts diff --git a/src/testRunner/unittests/organizeImports.ts b/src/testRunner/unittests/services/organizeImports.ts similarity index 100% rename from src/testRunner/unittests/organizeImports.ts rename to src/testRunner/unittests/services/organizeImports.ts diff --git a/src/testRunner/unittests/textChanges.ts b/src/testRunner/unittests/services/textChanges.ts similarity index 100% rename from src/testRunner/unittests/textChanges.ts rename to src/testRunner/unittests/services/textChanges.ts diff --git a/src/testRunner/unittests/tscWatchEmit.ts b/src/testRunner/unittests/tscWatch/emit.ts similarity index 100% rename from src/testRunner/unittests/tscWatchEmit.ts rename to src/testRunner/unittests/tscWatch/emit.ts diff --git a/src/testRunner/unittests/tscWatchHelpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts similarity index 100% rename from src/testRunner/unittests/tscWatchHelpers.ts rename to src/testRunner/unittests/tscWatch/helpers.ts diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts new file mode 100644 index 00000000000..759c80e93a6 --- /dev/null +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -0,0 +1,448 @@ +namespace ts.tscWatch { + describe("resolutionCache:: tsc-watch module resolution caching", () => { + it("works", () => { + const root = { + path: "/a/d/f0.ts", + content: `import {x} from "f1"` + }; + const imported = { + path: "/a/f1.ts", + content: `foo()` + }; + + const files = [root, imported, libFile]; + const host = createWatchedSystem(files); + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); + const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); + + // ensure that imported file was found + checkOutputErrorsInitial(host, [f1IsNotModule, cannotFindFoo]); + + const originalFileExists = host.fileExists; + { + const newContent = `import {x} from "f1" + var x: string = 1;`; + root.content = newContent; + host.reloadFS(files); + + // patch fileExists to make sure that disk is not touched + host.fileExists = notImplemented; + + // trigger synchronization to make sure that import will be fetched from the cache + host.runQueuedTimeoutCallbacks(); + + // ensure file has correct number of errors after edit + checkOutputErrorsIncremental(host, [ + f1IsNotModule, + getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), + cannotFindFoo + ]); + } + { + let fileExistsIsCalled = false; + host.fileExists = (fileName): boolean => { + if (fileName === "lib.d.ts") { + return false; + } + fileExistsIsCalled = true; + assert.isTrue(fileName.indexOf("/f2.") !== -1); + return originalFileExists.call(host, fileName); + }; + + root.content = `import {x} from "f2"`; + host.reloadFS(files); + + // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + host.runQueuedTimeoutCallbacks(); + + // ensure file has correct number of errors after edit + checkOutputErrorsIncremental(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") + ]); + + assert.isTrue(fileExistsIsCalled); + } + { + let fileExistsCalled = false; + host.fileExists = (fileName): boolean => { + if (fileName === "lib.d.ts") { + return false; + } + fileExistsCalled = true; + assert.isTrue(fileName.indexOf("/f1.") !== -1); + return originalFileExists.call(host, fileName); + }; + + const newContent = `import {x} from "f1"`; + root.content = newContent; + + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + checkOutputErrorsIncremental(host, [f1IsNotModule, cannotFindFoo]); + assert.isTrue(fileExistsCalled); + } + }); + + it("loads missing files from disk", () => { + const root = { + path: `/a/foo.ts`, + content: `import {x} from "bar"` + }; + + const imported = { + path: `/a/bar.d.ts`, + content: `export const y = 1;` + }; + + const files = [root, libFile]; + const host = createWatchedSystem(files); + const originalFileExists = host.fileExists; + + let fileExistsCalledForBar = false; + host.fileExists = fileName => { + if (fileName === "lib.d.ts") { + return false; + } + if (!fileExistsCalledForBar) { + fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; + } + + return originalFileExists.call(host, fileName); + }; + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ]); + + fileExistsCalledForBar = false; + root.content = `import {y} from "bar"`; + host.reloadFS(files.concat(imported)); + + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + }); + + it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { + const root = { + path: `/a/foo.ts`, + content: `import {x} from "bar"` + }; + + const imported = { + path: `/a/bar.d.ts`, + content: `export const y = 1;export const x = 10;` + }; + + const files = [root, libFile]; + const filesWithImported = files.concat(imported); + const host = createWatchedSystem(filesWithImported); + const originalFileExists = host.fileExists; + let fileExistsCalledForBar = false; + host.fileExists = fileName => { + if (fileName === "lib.d.ts") { + return false; + } + if (!fileExistsCalledForBar) { + fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; + } + return originalFileExists.call(host, fileName); + }; + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); + + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); + checkOutputErrorsInitial(host, emptyArray); + + fileExistsCalledForBar = false; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + checkOutputErrorsIncremental(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ]); + + fileExistsCalledForBar = false; + host.reloadFS(filesWithImported); + host.checkTimeoutQueueLengthAndRun(1); + checkOutputErrorsIncremental(host, emptyArray); + assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); + }); + + it("works when module resolution changes to ambient module", () => { + const root = { + path: "/a/b/foo.ts", + content: `import * as fs from "fs";` + }; + + const packageJson = { + path: "/a/b/node_modules/@types/node/package.json", + content: ` +{ + "main": "" +} +` + }; + + const nodeType = { + path: "/a/b/node_modules/@types/node/index.d.ts", + content: ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + } +}` + }; + + const files = [root, libFile]; + const filesWithNodeType = files.concat(packageJson, nodeType); + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { }); + + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ]); + + host.reloadFS(filesWithNodeType); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + }); + + it("works when included file with ambient module changes", () => { + const root = { + path: "/a/b/foo.ts", + content: ` +import * as fs from "fs"; +import * as u from "url"; +` + }; + + const file = { + path: "/a/b/bar.d.ts", + content: ` +declare module "url" { + export interface Url { + href?: string; + } +} +` + }; + + const fileContentWithFS = ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + } +} +`; + + const files = [root, file, libFile]; + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + const watch = createWatchOfFilesAndCompilerOptions([root.path, file.path], host, {}); + + checkOutputErrorsInitial(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ]); + + file.content += fileContentWithFS; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkOutputErrorsIncremental(host, emptyArray); + }); + + it("works when reusing program with files from external library", () => { + interface ExpectedFile { path: string; isExpectedToEmit?: boolean; content?: string; } + const configDir = "/a/b/projects/myProject/src/"; + const file1: File = { + path: configDir + "file1.ts", + content: 'import module1 = require("module1");\nmodule1("hello");' + }; + const file2: File = { + path: configDir + "file2.ts", + content: 'import module11 = require("module1");\nmodule11("hello");' + }; + const module1: File = { + path: "/a/b/projects/myProject/node_modules/module1/index.js", + content: "module.exports = options => { return options.toString(); }" + }; + const configFile: File = { + path: configDir + "tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + allowJs: true, + rootDir: ".", + outDir: "../dist", + moduleResolution: "node", + maxNodeModuleJsDepth: 1 + } + }) + }; + const outDirFolder = "/a/b/projects/myProject/dist/"; + const programFiles = [file1, file2, module1, libFile]; + const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" }); + const watch = createWatchOfConfigFile(configFile.path, host); + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrorsInitial(host, emptyArray); + const expectedFiles: ExpectedFile[] = [ + createExpectedEmittedFile(file1), + createExpectedEmittedFile(file2), + createExpectedToNotEmitFile("index.js"), + createExpectedToNotEmitFile("src/index.js"), + createExpectedToNotEmitFile("src/file1.js"), + createExpectedToNotEmitFile("src/file2.js"), + createExpectedToNotEmitFile("lib.js"), + createExpectedToNotEmitFile("lib.d.ts") + ]; + verifyExpectedFiles(expectedFiles); + + file1.content += "\n;"; + expectedFiles[0].content += ";\n"; // Only emit file1 with this change + expectedFiles[1].isExpectedToEmit = false; + host.reloadFS(programFiles.concat(configFile)); + host.runQueuedTimeoutCallbacks(); + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrorsIncremental(host, emptyArray); + verifyExpectedFiles(expectedFiles); + + + function verifyExpectedFiles(expectedFiles: ExpectedFile[]) { + forEach(expectedFiles, f => { + assert.equal(!!host.fileExists(f.path), f.isExpectedToEmit, "File " + f.path + " is expected to " + (f.isExpectedToEmit ? "emit" : "not emit")); + if (f.isExpectedToEmit) { + assert.equal(host.readFile(f.path), f.content, "Expected contents of " + f.path); + } + }); + } + + function createExpectedToNotEmitFile(fileName: string): ExpectedFile { + return { + path: outDirFolder + fileName, + isExpectedToEmit: false + }; + } + + function createExpectedEmittedFile(file: File): ExpectedFile { + return { + path: removeFileExtension(file.path.replace(configDir, outDirFolder)) + Extension.Js, + isExpectedToEmit: true, + content: '"use strict";\nexports.__esModule = true;\n' + file.content.replace("import", "var") + "\n" + }; + } + }); + + it("works when renaming node_modules folder that already contains @types folder", () => { + const currentDirectory = "/user/username/projects/myproject"; + const file: File = { + path: `${currentDirectory}/a.ts`, + content: `import * as q from "qqq";` + }; + const module: File = { + path: `${currentDirectory}/node_modules2/@types/qqq/index.d.ts`, + content: "export {}" + }; + const files = [file, module, libFile]; + const host = createWatchedSystem(files, { currentDirectory }); + const watch = createWatchOfFilesAndCompilerOptions([file.path], host); + + checkProgramActualFiles(watch(), [file.path, libFile.path]); + checkOutputErrorsInitial(host, [getDiagnosticModuleNotFoundOfFile(watch(), file, "qqq")]); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectories(host, [`${currentDirectory}/node_modules`, `${currentDirectory}/node_modules/@types`], /*recursive*/ true); + + host.renameFolder(`${currentDirectory}/node_modules2`, `${currentDirectory}/node_modules`); + host.runQueuedTimeoutCallbacks(); + checkProgramActualFiles(watch(), [file.path, libFile.path, `${currentDirectory}/node_modules/@types/qqq/index.d.ts`]); + checkOutputErrorsIncremental(host, emptyArray); + }); + + describe("ignores files/folder changes in node_modules that start with '.'", () => { + const projectPath = "/user/username/projects/project"; + const npmCacheFile: File = { + path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, + content: JSON.stringify({ something: 10 }) + }; + const file1: File = { + path: `${projectPath}/test.ts`, + content: `import { x } from "somemodule";` + }; + const file2: File = { + path: `${projectPath}/node_modules/somemodule/index.d.ts`, + content: `export const x = 10;` + }; + const files = [libFile, file1, file2]; + const expectedFiles = files.map(f => f.path); + it("when watching node_modules in inferred project for failed lookup", () => { + const host = createWatchedSystem(files); + const watch = createWatchOfFilesAndCompilerOptions([file1.path], host, {}, /*maxNumberOfFilesToIterateForInvalidation*/ 1); + checkProgramActualFiles(watch(), expectedFiles); + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + it("when watching node_modules as part of wild card directories in config project", () => { + const config: File = { + path: `${projectPath}/tsconfig.json`, + content: "{}" + }; + const host = createWatchedSystem(files.concat(config)); + const watch = createWatchOfConfigFile(config.path, host); + checkProgramActualFiles(watch(), expectedFiles); + host.checkTimeoutQueueLength(0); + + host.ensureFileOrFolder(npmCacheFile); + host.checkTimeoutQueueLength(0); + }); + }); + }); + + describe("resolutionCache:: tsc-watch with modules linked to sibling folder", () => { + const projectRoot = "/user/username/projects/project"; + const mainPackageRoot = `${projectRoot}/main`; + const linkedPackageRoot = `${projectRoot}/linked-package`; + const mainFile: File = { + path: `${mainPackageRoot}/index.ts`, + content: "import { Foo } from '@scoped/linked-package'" + }; + const config: File = { + path: `${mainPackageRoot}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { module: "commonjs", moduleResolution: "node", baseUrl: ".", rootDir: "." }, + files: ["index.ts"] + }) + }; + const linkedPackageInMain: SymLink = { + path: `${mainPackageRoot}/node_modules/@scoped/linked-package`, + symLink: `${linkedPackageRoot}` + }; + const linkedPackageJson: File = { + path: `${linkedPackageRoot}/package.json`, + content: JSON.stringify({ name: "@scoped/linked-package", version: "0.0.1", types: "dist/index.d.ts", main: "dist/index.js" }) + }; + const linkedPackageIndex: File = { + path: `${linkedPackageRoot}/dist/index.d.ts`, + content: "export * from './other';" + }; + const linkedPackageOther: File = { + path: `${linkedPackageRoot}/dist/other.d.ts`, + content: 'export declare const Foo = "BAR";' + }; + + it("verify watched directories", () => { + const files = [libFile, mainFile, config, linkedPackageInMain, linkedPackageJson, linkedPackageIndex, linkedPackageOther]; + const host = createWatchedSystem(files, { currentDirectory: mainPackageRoot }); + createWatchOfConfigFile("tsconfig.json", host); + checkWatchedFilesDetailed(host, [libFile.path, mainFile.path, config.path, linkedPackageIndex.path, linkedPackageOther.path], 1); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, [`${mainPackageRoot}/@scoped`, `${mainPackageRoot}/node_modules`, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); + }); + }); +} diff --git a/src/testRunner/unittests/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts similarity index 100% rename from src/testRunner/unittests/watchApi.ts rename to src/testRunner/unittests/tscWatch/watchApi.ts diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts new file mode 100644 index 00000000000..646fb59ef09 --- /dev/null +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -0,0 +1,178 @@ +namespace ts.tscWatch { + import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; + describe("watchEnvironment:: tsc-watch with different polling/non polling options", () => { + it("watchFile using dynamic priority polling", () => { + const projectFolder = "/a/username/project"; + const file1: File = { + path: `${projectFolder}/typescript.ts`, + content: "var z = 10;" + }; + const files = [file1, libFile]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHFILE", "DynamicPriorityPolling"); + const host = createWatchedSystem(files, { environmentVariables }); + const watch = createWatchOfFilesAndCompilerOptions([file1.path], host); + + const initialProgram = watch(); + verifyProgram(); + + const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; + for (let index = 0; index < mediumPollingIntervalThreshold; index++) { + // Transition libFile and file1 to low priority queue + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), initialProgram); + } + + // Make a change to file + file1.content = "var zz30 = 100;"; + host.reloadFS(files); + + // This should detect change in the file + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), initialProgram); + + // Callbacks: medium priority + high priority queue and scheduled program update + host.checkTimeoutQueueLengthAndRun(3); + // During this timeout the file would be detected as unchanged + let fileUnchangeDetected = 1; + const newProgram = watch(); + assert.notStrictEqual(newProgram, initialProgram); + + verifyProgram(); + const outputFile1 = changeExtension(file1.path, ".js"); + assert.isTrue(host.fileExists(outputFile1)); + assert.equal(host.readFile(outputFile1), file1.content + host.newLine); + + const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; + for (; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { + // For high + Medium/low polling interval + host.checkTimeoutQueueLengthAndRun(2); + assert.deepEqual(watch(), newProgram); + } + + // Everything goes in high polling interval queue + host.checkTimeoutQueueLengthAndRun(1); + assert.deepEqual(watch(), newProgram); + + function verifyProgram() { + checkProgramActualFiles(watch(), files.map(f => f.path)); + checkWatchedFiles(host, []); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, [], /*recursive*/ true); + } + }); + + describe("tsc-watch when watchDirectories implementation", () => { + function verifyRenamingFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { + const projectFolder = "/a/username/project"; + const projectSrcFolder = `${projectFolder}/src`; + const configFile: File = { + path: `${projectFolder}/tsconfig.json`, + content: "{}" + }; + const file: File = { + path: `${projectSrcFolder}/file1.ts`, + content: "" + }; + const programFiles = [file, libFile]; + const files = [file, configFile, libFile]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); + const host = createWatchedSystem(files, { environmentVariables }); + const watch = createWatchOfConfigFile(configFile.path, host); + const projectFolders = [projectFolder, projectSrcFolder, `${projectFolder}/node_modules/@types`]; + // Watching files config file, file, lib file + const expectedWatchedFiles = files.map(f => f.path); + const expectedWatchedDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? projectFolders : emptyArray; + if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) { + expectedWatchedFiles.push(...projectFolders); + } + + verifyProgram(checkOutputErrorsInitial); + + // Rename the file: + file.path = file.path.replace("file1.ts", "file2.ts"); + expectedWatchedFiles[0] = file.path; + host.reloadFS(files); + if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { + // With dynamic polling the fs change would be detected only by running timeouts + host.runQueuedTimeoutCallbacks(); + } + // Delayed update program + host.runQueuedTimeoutCallbacks(); + verifyProgram(checkOutputErrorsIncremental); + + function verifyProgram(checkOutputErrors: (host: WatchedSystem, errors: ReadonlyArray) => void) { + checkProgramActualFiles(watch(), programFiles.map(f => f.path)); + checkOutputErrors(host, emptyArray); + + const outputFile = changeExtension(file.path, ".js"); + assert(host.fileExists(outputFile)); + assert.equal(host.readFile(outputFile), file.content); + + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + + // Watching config file, file, lib file and directories + checkWatchedFilesDetailed(host, expectedWatchedFiles, 1); + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, 1, /*recursive*/ false); + } + } + + it("uses watchFile when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.WatchFile); + }); + + it("uses non recursive watchDirectory when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); + }); + + it("uses non recursive dynamic polling when renaming file in subfolder", () => { + verifyRenamingFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); + }); + + it("when there are symlinks to folders in recursive folders", () => { + const cwd = "/home/user/projects/myproject"; + const file1: File = { + path: `${cwd}/src/file.ts`, + content: `import * as a from "a"` + }; + const tsconfig: File = { + path: `${cwd}/tsconfig.json`, + content: `{ "compilerOptions": { "extendedDiagnostics": true, "traceResolution": true }}` + }; + const realA: File = { + path: `${cwd}/node_modules/reala/index.d.ts`, + content: `export {}` + }; + const realB: File = { + path: `${cwd}/node_modules/realb/index.d.ts`, + content: `export {}` + }; + const symLinkA: SymLink = { + path: `${cwd}/node_modules/a`, + symLink: `${cwd}/node_modules/reala` + }; + const symLinkB: SymLink = { + path: `${cwd}/node_modules/b`, + symLink: `${cwd}/node_modules/realb` + }; + const symLinkBInA: SymLink = { + path: `${cwd}/node_modules/reala/node_modules/b`, + symLink: `${cwd}/node_modules/b` + }; + const symLinkAInB: SymLink = { + path: `${cwd}/node_modules/realb/node_modules/a`, + symLink: `${cwd}/node_modules/a` + }; + const files = [file1, tsconfig, realA, realB, symLinkA, symLinkB, symLinkBInA, symLinkAInB]; + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", Tsc_WatchDirectory.NonRecursiveWatchDirectory); + const host = createWatchedSystem(files, { environmentVariables, currentDirectory: cwd }); + createWatchOfConfigFile("tsconfig.json", host); + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + checkWatchedDirectories(host, [cwd, `${cwd}/node_modules`, `${cwd}/node_modules/@types`, `${cwd}/node_modules/reala`, `${cwd}/node_modules/realb`, + `${cwd}/node_modules/reala/node_modules`, `${cwd}/node_modules/realb/node_modules`, `${cwd}/src`], /*recursive*/ false); + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverCachingFileSystemInformation.ts b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts similarity index 98% rename from src/testRunner/unittests/tsserverCachingFileSystemInformation.ts rename to src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts index 65e1ec564d3..b5132f57c0e 100644 --- a/src/testRunner/unittests/tsserverCachingFileSystemInformation.ts +++ b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts @@ -3,7 +3,7 @@ namespace ts.projectSystem { return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); } - describe("tsserverCachingFileSystemInformation:: tsserverProjectSystem CachingFileSystemInformation", () => { + describe("tsserver:: CachingFileSystemInformation:: tsserverProjectSystem CachingFileSystemInformation", () => { enum CalledMapsWithSingleArg { fileExists = "fileExists", directoryExists = "directoryExists", diff --git a/src/testRunner/unittests/compileOnSave.ts b/src/testRunner/unittests/tsserver/compileOnSave.ts similarity index 97% rename from src/testRunner/unittests/compileOnSave.ts rename to src/testRunner/unittests/tsserver/compileOnSave.ts index 2352ac58c19..310a6e9e33c 100644 --- a/src/testRunner/unittests/compileOnSave.ts +++ b/src/testRunner/unittests/tsserver/compileOnSave.ts @@ -6,7 +6,7 @@ namespace ts.projectSystem { return new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); } - describe("compileOnSave:: affected list", () => { + describe("tsserver:: compileOnSave:: affected list", () => { function sendAffectedFileRequestAndCheckResult(session: server.Session, request: server.protocol.Request, expectedFileList: { projectFileName: string, files: File[] }[]) { const response = session.executeCommand(request).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[]; const actualResult = response.sort((list1, list2) => compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); @@ -552,7 +552,7 @@ namespace ts.projectSystem { }); }); - describe("compileOnSave:: EmitFile test", () => { + describe("tsserver:: compileOnSave:: EmitFile test", () => { it("should respect line endings", () => { test("\n"); test("\r\n"); diff --git a/src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts similarity index 95% rename from src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts rename to src/testRunner/unittests/tsserver/events/largeFileReferenced.ts index f33f32dfe58..ca7f839e1b0 100644 --- a/src/testRunner/unittests/tsserverLargeFileReferencedEvent.ts +++ b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserverLargeFileReferencedEvent:: LargeFileReferencedEvent with large file", () => { + describe("tsserver:: LargeFileReferencedEvent with large file", () => { const projectRoot = "/user/username/projects/project"; function getLargeFile(useLargeTsFile: boolean) { diff --git a/src/testRunner/unittests/tsserverProjectLoadingEvents.ts b/src/testRunner/unittests/tsserver/events/projectLoading.ts similarity index 96% rename from src/testRunner/unittests/tsserverProjectLoadingEvents.ts rename to src/testRunner/unittests/tsserver/events/projectLoading.ts index 0ff256bd692..2de3ab40db6 100644 --- a/src/testRunner/unittests/tsserverProjectLoadingEvents.ts +++ b/src/testRunner/unittests/tsserver/events/projectLoading.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserverProjectLoadingEvents:: ProjectLoadingStart and ProjectLoadingFinish events", () => { + describe("tsserver:: events:: ProjectLoadingStart and ProjectLoadingFinish events", () => { const projectRoot = "/user/username/projects"; const aTs: File = { path: `${projectRoot}/a/a.ts`, diff --git a/src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts similarity index 97% rename from src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts rename to src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts index 3e8382fff58..c818f4d2a8d 100644 --- a/src/testRunner/unittests/tsserverProjectUpdatedInBackgroundEvent.ts +++ b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserverProjectUpdatedInBackgroundEvent:: ProjectsUpdatedInBackground", () => { + describe("tsserver:: ProjectsUpdatedInBackground", () => { function verifyFiles(caption: string, actual: ReadonlyArray, expected: ReadonlyArray) { assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`); const seen = createMap(); diff --git a/src/testRunner/unittests/tsserver/externalProjects.ts b/src/testRunner/unittests/tsserver/externalProjects.ts new file mode 100644 index 00000000000..6c246a2e3bd --- /dev/null +++ b/src/testRunner/unittests/tsserver/externalProjects.ts @@ -0,0 +1,300 @@ +namespace ts.projectSystem { + describe("tsserver:: ExternalProjects", () => { + describe("correctly handling add/remove tsconfig - 1", () => { + function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1;" + }; + const f2 = { + path: "/a/b/lib.ts", + content: "" + }; + const tsconfig = { + path: "/a/b/tsconfig.json", + content: "" + }; + const host = createServerHost([f1, f2]); + const projectService = createProjectService(host); + projectService.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); + + // open external project + const projectName = "/a/b/proj1"; + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, f2.path]), + options: {} + }); + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(projectService.externalProjects[0], [f1.path, f2.path]); + + // rename lib.ts to tsconfig.json + host.reloadFS([f1, tsconfig]); + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, tsconfig.path]), + options: {} + }); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + if (lazyConfiguredProjectsFromExternalProject) { + checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed + projectService.ensureInferredProjectsUpToDate_TestOnly(); + } + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, tsconfig.path]); + + // rename tsconfig.json back to lib.ts + host.reloadFS([f1, f2]); + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, f2.path]), + options: {} + }); + + projectService.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(projectService.externalProjects[0], [f1.path, f2.path]); + } + it("when lazyConfiguredProjectsFromExternalProject not set", () => { + verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ false); + }); + it("when lazyConfiguredProjectsFromExternalProject is set", () => { + verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ true); + }); + }); + + describe("correctly handling add/remove tsconfig - 2", () => { + function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1;" + }; + const cLib = { + path: "/a/b/c/lib.ts", + content: "" + }; + const cTsconfig = { + path: "/a/b/c/tsconfig.json", + content: "{}" + }; + const dLib = { + path: "/a/b/d/lib.ts", + content: "" + }; + const dTsconfig = { + path: "/a/b/d/tsconfig.json", + content: "{}" + }; + const host = createServerHost([f1, cLib, cTsconfig, dLib, dTsconfig]); + const projectService = createProjectService(host); + projectService.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); + + // open external project + const projectName = "/a/b/proj1"; + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path]), + options: {} + }); + + projectService.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(projectService.externalProjects[0], [f1.path]); + + // add two config file as root files + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, cTsconfig.path, dTsconfig.path]), + options: {} + }); + projectService.checkNumberOfProjects({ configuredProjects: 2 }); + if (lazyConfiguredProjectsFromExternalProject) { + checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed + checkProjectActualFiles(configuredProjectAt(projectService, 1), emptyArray); // Configured project created but not loaded till actually needed + projectService.ensureInferredProjectsUpToDate_TestOnly(); + } + checkProjectActualFiles(configuredProjectAt(projectService, 0), [cLib.path, cTsconfig.path]); + checkProjectActualFiles(configuredProjectAt(projectService, 1), [dLib.path, dTsconfig.path]); + + // remove one config file + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, dTsconfig.path]), + options: {} + }); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [dLib.path, dTsconfig.path]); + + // remove second config file + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path]), + options: {} + }); + + projectService.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(projectService.externalProjects[0], [f1.path]); + + // open two config files + // add two config file as root files + projectService.openExternalProject({ + projectFileName: projectName, + rootFiles: toExternalFiles([f1.path, cTsconfig.path, dTsconfig.path]), + options: {} + }); + projectService.checkNumberOfProjects({ configuredProjects: 2 }); + if (lazyConfiguredProjectsFromExternalProject) { + checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed + checkProjectActualFiles(configuredProjectAt(projectService, 1), emptyArray); // Configured project created but not loaded till actually needed + projectService.ensureInferredProjectsUpToDate_TestOnly(); + } + checkProjectActualFiles(configuredProjectAt(projectService, 0), [cLib.path, cTsconfig.path]); + checkProjectActualFiles(configuredProjectAt(projectService, 1), [dLib.path, dTsconfig.path]); + + // close all projects - no projects should be opened + projectService.closeExternalProject(projectName); + projectService.checkNumberOfProjects({}); + } + + it("when lazyConfiguredProjectsFromExternalProject not set", () => { + verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ false); + }); + it("when lazyConfiguredProjectsFromExternalProject is set", () => { + verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ true); + }); + }); + + it("correctly handles changes in lib section of config file", () => { + const libES5 = { + path: "/compiler/lib.es5.d.ts", + content: "declare const eval: any" + }; + const libES2015Promise = { + path: "/compiler/lib.es2015.promise.d.ts", + content: "declare class Promise {}" + }; + const app = { + path: "/src/app.ts", + content: "var x: Promise;" + }; + const config1 = { + path: "/src/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: true, + sourceMap: false, + lib: [ + "es5" + ] + } + }) + }; + const config2 = { + path: config1.path, + content: JSON.stringify( + { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: true, + sourceMap: false, + lib: [ + "es5", + "es2015.promise" + ] + } + }) + }; + const host = createServerHost([libES5, libES2015Promise, app, config1], { executingFilePath: "/compiler/tsc.js" }); + const projectService = createProjectService(host); + projectService.openClientFile(app.path); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [libES5.path, app.path, config1.path]); + + host.reloadFS([libES5, libES2015Promise, app, config2]); + host.checkTimeoutQueueLengthAndRun(2); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [libES5.path, libES2015Promise.path, app.path, config2.path]); + }); + + it("should handle non-existing directories in config file", () => { + const f = { + path: "/a/src/app.ts", + content: "let x = 1;" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: {}, + include: [ + "src/**/*", + "notexistingfolder/*" + ] + }) + }; + const host = createServerHost([f, config]); + const projectService = createProjectService(host); + projectService.openClientFile(f.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + const project = projectService.configuredProjects.get(config.path)!; + assert.isTrue(project.hasOpenRef()); // f + + projectService.closeClientFile(f.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config.path), project); + assert.isFalse(project.hasOpenRef()); // No files + assert.isFalse(project.isClosed()); + + projectService.openClientFile(f.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config.path), project); + assert.isTrue(project.hasOpenRef()); // f + assert.isFalse(project.isClosed()); + }); + + it("handles loads existing configured projects of external projects when lazyConfiguredProjectsFromExternalProject is disabled", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({}) + }; + const projectFileName = "/a/b/project.csproj"; + const host = createServerHost([f1, config]); + const service = createProjectService(host); + service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: true } }); + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([f1.path, config.path]), + options: {} + }); + service.checkNumberOfProjects({ configuredProjects: 1 }); + const project = service.configuredProjects.get(config.path)!; + assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.Full); // External project referenced configured project pending to be reloaded + checkProjectActualFiles(project, emptyArray); + + service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: false } }); + assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project loaded + checkProjectActualFiles(project, [config.path, f1.path]); + + service.closeExternalProject(projectFileName); + service.checkNumberOfProjects({}); + + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([f1.path, config.path]), + options: {} + }); + service.checkNumberOfProjects({ configuredProjects: 1 }); + const project2 = service.configuredProjects.get(config.path)!; + assert.equal(project2.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project loaded + checkProjectActualFiles(project2, [config.path, f1.path]); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverHelpers.ts b/src/testRunner/unittests/tsserver/helpers.ts similarity index 100% rename from src/testRunner/unittests/tsserverHelpers.ts rename to src/testRunner/unittests/tsserver/helpers.ts diff --git a/src/testRunner/unittests/projectErrors.ts b/src/testRunner/unittests/tsserver/projectErrors.ts similarity index 100% rename from src/testRunner/unittests/projectErrors.ts rename to src/testRunner/unittests/tsserver/projectErrors.ts diff --git a/src/testRunner/unittests/tsserver/reload.ts b/src/testRunner/unittests/tsserver/reload.ts new file mode 100644 index 00000000000..80f3e56e437 --- /dev/null +++ b/src/testRunner/unittests/tsserver/reload.ts @@ -0,0 +1,151 @@ +namespace ts.projectSystem { + describe("tsserver:: reload", () => { + it("should work with temp file", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const tmp = { + path: "/a/b/app.tmp", + content: "const y = 42" + }; + const host = createServerHost([f1, tmp]); + const session = createSession(host); + + // send open request + session.executeCommand({ + type: "request", + command: "open", + seq: 1, + arguments: { file: f1.path } + }); + + // reload from tmp file + session.executeCommand({ + type: "request", + command: "reload", + seq: 2, + arguments: { file: f1.path, tmpfile: tmp.path } + }); + + // verify content + const projectServiice = session.getProjectService(); + const snap1 = projectServiice.getScriptInfo(f1.path)!.getSnapshot(); + assert.equal(getSnapshotText(snap1), tmp.content, "content should be equal to the content of temp file"); + + // reload from original file file + session.executeCommand({ + type: "request", + command: "reload", + seq: 2, + arguments: { file: f1.path } + }); + + // verify content + const snap2 = projectServiice.getScriptInfo(f1.path)!.getSnapshot(); + assert.equal(getSnapshotText(snap2), f1.content, "content should be equal to the content of original file"); + + }); + + it("should work when script info doesnt have any project open", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const tmp = { + path: "/a/b/app.tmp", + content: "const y = 42" + }; + const host = createServerHost([f1, tmp, libFile]); + const session = createSession(host); + const openContent = "let z = 1"; + // send open request + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Open, + arguments: { file: f1.path, fileContent: openContent } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const info = projectService.getScriptInfo(f1.path)!; + assert.isDefined(info); + checkScriptInfoContents(openContent, "contents set during open request"); + + // send close request + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Close, + arguments: { file: f1.path } + }); + checkScriptInfoAndProjects(f1.content, "contents of closed file"); + checkInferredProjectIsOrphan(); + + // Can reload contents of the file when its not open and has no project + // reload from temp file + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Reload, + arguments: { file: f1.path, tmpfile: tmp.path } + }); + checkScriptInfoAndProjects(tmp.content, "contents of temp file"); + checkInferredProjectIsOrphan(); + + // reload from own file + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Reload, + arguments: { file: f1.path } + }); + checkScriptInfoAndProjects(f1.content, "contents of closed file"); + checkInferredProjectIsOrphan(); + + // Open file again without setting its content + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Open, + arguments: { file: f1.path } + }); + checkScriptInfoAndProjects(f1.content, "contents of file when opened without specifying contents"); + const snap = info.getSnapshot(); + + // send close request + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Close, + arguments: { file: f1.path } + }); + checkScriptInfoAndProjects(f1.content, "contents of closed file"); + assert.strictEqual(info.getSnapshot(), snap); + checkInferredProjectIsOrphan(); + + // reload from temp file + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Reload, + arguments: { file: f1.path, tmpfile: tmp.path } + }); + checkScriptInfoAndProjects(tmp.content, "contents of temp file"); + assert.notStrictEqual(info.getSnapshot(), snap); + checkInferredProjectIsOrphan(); + + // reload from own file + session.executeCommandSeq({ + command: server.protocol.CommandTypes.Reload, + arguments: { file: f1.path } + }); + checkScriptInfoAndProjects(f1.content, "contents of closed file"); + assert.notStrictEqual(info.getSnapshot(), snap); + checkInferredProjectIsOrphan(); + + function checkInferredProjectIsOrphan() { + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + assert.equal(info.containingProjects.length, 0); + } + + function checkScriptInfoAndProjects(contentsOfInfo: string, captionForContents: string) { + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + assert.strictEqual(projectService.getScriptInfo(f1.path), info); + checkScriptInfoContents(contentsOfInfo, captionForContents); + } + + function checkScriptInfoContents(contentsOfInfo: string, captionForContents: string) { + const snap = info.getSnapshot(); + assert.equal(getSnapshotText(snap), contentsOfInfo, "content should be equal to " + captionForContents); + } + }); + }); +} diff --git a/src/testRunner/unittests/resolutionCache.ts b/src/testRunner/unittests/tsserver/resolutionCache.ts similarity index 71% rename from src/testRunner/unittests/resolutionCache.ts rename to src/testRunner/unittests/tsserver/resolutionCache.ts index d97770e21b5..a07cb7721d4 100644 --- a/src/testRunner/unittests/resolutionCache.ts +++ b/src/testRunner/unittests/tsserver/resolutionCache.ts @@ -1,452 +1,3 @@ -namespace ts.tscWatch { - describe("resolutionCache:: tsc-watch module resolution caching", () => { - it("works", () => { - const root = { - path: "/a/d/f0.ts", - content: `import {x} from "f1"` - }; - const imported = { - path: "/a/f1.ts", - content: `foo()` - }; - - const files = [root, imported, libFile]; - const host = createWatchedSystem(files); - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); - const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); - - // ensure that imported file was found - checkOutputErrorsInitial(host, [f1IsNotModule, cannotFindFoo]); - - const originalFileExists = host.fileExists; - { - const newContent = `import {x} from "f1" - var x: string = 1;`; - root.content = newContent; - host.reloadFS(files); - - // patch fileExists to make sure that disk is not touched - host.fileExists = notImplemented; - - // trigger synchronization to make sure that import will be fetched from the cache - host.runQueuedTimeoutCallbacks(); - - // ensure file has correct number of errors after edit - checkOutputErrorsIncremental(host, [ - f1IsNotModule, - getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), - cannotFindFoo - ]); - } - { - let fileExistsIsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsIsCalled = true; - assert.isTrue(fileName.indexOf("/f2.") !== -1); - return originalFileExists.call(host, fileName); - }; - - root.content = `import {x} from "f2"`; - host.reloadFS(files); - - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk - host.runQueuedTimeoutCallbacks(); - - // ensure file has correct number of errors after edit - checkOutputErrorsIncremental(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") - ]); - - assert.isTrue(fileExistsIsCalled); - } - { - let fileExistsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsCalled = true; - assert.isTrue(fileName.indexOf("/f1.") !== -1); - return originalFileExists.call(host, fileName); - }; - - const newContent = `import {x} from "f1"`; - root.content = newContent; - - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - - checkOutputErrorsIncremental(host, [f1IsNotModule, cannotFindFoo]); - assert.isTrue(fileExistsCalled); - } - }); - - it("loads missing files from disk", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;` - }; - - const files = [root, libFile]; - const host = createWatchedSystem(files); - const originalFileExists = host.fileExists; - - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } - - return originalFileExists.call(host, fileName); - }; - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ]); - - fileExistsCalledForBar = false; - root.content = `import {y} from "bar"`; - host.reloadFS(files.concat(imported)); - - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - }); - - it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;export const x = 10;` - }; - - const files = [root, libFile]; - const filesWithImported = files.concat(imported); - const host = createWatchedSystem(filesWithImported); - const originalFileExists = host.fileExists; - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } - return originalFileExists.call(host, fileName); - }; - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { module: ModuleKind.AMD }); - - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrorsInitial(host, emptyArray); - - fileExistsCalledForBar = false; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputErrorsIncremental(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ]); - - fileExistsCalledForBar = false; - host.reloadFS(filesWithImported); - host.checkTimeoutQueueLengthAndRun(1); - checkOutputErrorsIncremental(host, emptyArray); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - }); - - it("works when module resolution changes to ambient module", () => { - const root = { - path: "/a/b/foo.ts", - content: `import * as fs from "fs";` - }; - - const packageJson = { - path: "/a/b/node_modules/@types/node/package.json", - content: ` -{ - "main": "" -} -` - }; - - const nodeType = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -}` - }; - - const files = [root, libFile]; - const filesWithNodeType = files.concat(packageJson, nodeType); - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - - const watch = createWatchOfFilesAndCompilerOptions([root.path], host, { }); - - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ]); - - host.reloadFS(filesWithNodeType); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - }); - - it("works when included file with ambient module changes", () => { - const root = { - path: "/a/b/foo.ts", - content: ` -import * as fs from "fs"; -import * as u from "url"; -` - }; - - const file = { - path: "/a/b/bar.d.ts", - content: ` -declare module "url" { - export interface Url { - href?: string; - } -} -` - }; - - const fileContentWithFS = ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -} -`; - - const files = [root, file, libFile]; - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - - const watch = createWatchOfFilesAndCompilerOptions([root.path, file.path], host, {}); - - checkOutputErrorsInitial(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ]); - - file.content += fileContentWithFS; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkOutputErrorsIncremental(host, emptyArray); - }); - - it("works when reusing program with files from external library", () => { - interface ExpectedFile { path: string; isExpectedToEmit?: boolean; content?: string; } - const configDir = "/a/b/projects/myProject/src/"; - const file1: File = { - path: configDir + "file1.ts", - content: 'import module1 = require("module1");\nmodule1("hello");' - }; - const file2: File = { - path: configDir + "file2.ts", - content: 'import module11 = require("module1");\nmodule11("hello");' - }; - const module1: File = { - path: "/a/b/projects/myProject/node_modules/module1/index.js", - content: "module.exports = options => { return options.toString(); }" - }; - const configFile: File = { - path: configDir + "tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - allowJs: true, - rootDir: ".", - outDir: "../dist", - moduleResolution: "node", - maxNodeModuleJsDepth: 1 - } - }) - }; - const outDirFolder = "/a/b/projects/myProject/dist/"; - const programFiles = [file1, file2, module1, libFile]; - const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" }); - const watch = createWatchOfConfigFile(configFile.path, host); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrorsInitial(host, emptyArray); - const expectedFiles: ExpectedFile[] = [ - createExpectedEmittedFile(file1), - createExpectedEmittedFile(file2), - createExpectedToNotEmitFile("index.js"), - createExpectedToNotEmitFile("src/index.js"), - createExpectedToNotEmitFile("src/file1.js"), - createExpectedToNotEmitFile("src/file2.js"), - createExpectedToNotEmitFile("lib.js"), - createExpectedToNotEmitFile("lib.d.ts") - ]; - verifyExpectedFiles(expectedFiles); - - file1.content += "\n;"; - expectedFiles[0].content += ";\n"; // Only emit file1 with this change - expectedFiles[1].isExpectedToEmit = false; - host.reloadFS(programFiles.concat(configFile)); - host.runQueuedTimeoutCallbacks(); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrorsIncremental(host, emptyArray); - verifyExpectedFiles(expectedFiles); - - - function verifyExpectedFiles(expectedFiles: ExpectedFile[]) { - forEach(expectedFiles, f => { - assert.equal(!!host.fileExists(f.path), f.isExpectedToEmit, "File " + f.path + " is expected to " + (f.isExpectedToEmit ? "emit" : "not emit")); - if (f.isExpectedToEmit) { - assert.equal(host.readFile(f.path), f.content, "Expected contents of " + f.path); - } - }); - } - - function createExpectedToNotEmitFile(fileName: string): ExpectedFile { - return { - path: outDirFolder + fileName, - isExpectedToEmit: false - }; - } - - function createExpectedEmittedFile(file: File): ExpectedFile { - return { - path: removeFileExtension(file.path.replace(configDir, outDirFolder)) + Extension.Js, - isExpectedToEmit: true, - content: '"use strict";\nexports.__esModule = true;\n' + file.content.replace("import", "var") + "\n" - }; - } - }); - - it("works when renaming node_modules folder that already contains @types folder", () => { - const currentDirectory = "/user/username/projects/myproject"; - const file: File = { - path: `${currentDirectory}/a.ts`, - content: `import * as q from "qqq";` - }; - const module: File = { - path: `${currentDirectory}/node_modules2/@types/qqq/index.d.ts`, - content: "export {}" - }; - const files = [file, module, libFile]; - const host = createWatchedSystem(files, { currentDirectory }); - const watch = createWatchOfFilesAndCompilerOptions([file.path], host); - - checkProgramActualFiles(watch(), [file.path, libFile.path]); - checkOutputErrorsInitial(host, [getDiagnosticModuleNotFoundOfFile(watch(), file, "qqq")]); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectories(host, [`${currentDirectory}/node_modules`, `${currentDirectory}/node_modules/@types`], /*recursive*/ true); - - host.renameFolder(`${currentDirectory}/node_modules2`, `${currentDirectory}/node_modules`); - host.runQueuedTimeoutCallbacks(); - checkProgramActualFiles(watch(), [file.path, libFile.path, `${currentDirectory}/node_modules/@types/qqq/index.d.ts`]); - checkOutputErrorsIncremental(host, emptyArray); - }); - - describe("ignores files/folder changes in node_modules that start with '.'", () => { - const projectPath = "/user/username/projects/project"; - const npmCacheFile: File = { - path: `${projectPath}/node_modules/.cache/babel-loader/89c02171edab901b9926470ba6d5677e.ts`, - content: JSON.stringify({ something: 10 }) - }; - const file1: File = { - path: `${projectPath}/test.ts`, - content: `import { x } from "somemodule";` - }; - const file2: File = { - path: `${projectPath}/node_modules/somemodule/index.d.ts`, - content: `export const x = 10;` - }; - const files = [libFile, file1, file2]; - const expectedFiles = files.map(f => f.path); - it("when watching node_modules in inferred project for failed lookup", () => { - const host = createWatchedSystem(files); - const watch = createWatchOfFilesAndCompilerOptions([file1.path], host, {}, /*maxNumberOfFilesToIterateForInvalidation*/ 1); - checkProgramActualFiles(watch(), expectedFiles); - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - it("when watching node_modules as part of wild card directories in config project", () => { - const config: File = { - path: `${projectPath}/tsconfig.json`, - content: "{}" - }; - const host = createWatchedSystem(files.concat(config)); - const watch = createWatchOfConfigFile(config.path, host); - checkProgramActualFiles(watch(), expectedFiles); - host.checkTimeoutQueueLength(0); - - host.ensureFileOrFolder(npmCacheFile); - host.checkTimeoutQueueLength(0); - }); - }); - }); - - describe("resolutionCache:: tsc-watch with modules linked to sibling folder", () => { - const projectRoot = "/user/username/projects/project"; - const mainPackageRoot = `${projectRoot}/main`; - const linkedPackageRoot = `${projectRoot}/linked-package`; - const mainFile: File = { - path: `${mainPackageRoot}/index.ts`, - content: "import { Foo } from '@scoped/linked-package'" - }; - const config: File = { - path: `${mainPackageRoot}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { module: "commonjs", moduleResolution: "node", baseUrl: ".", rootDir: "." }, - files: ["index.ts"] - }) - }; - const linkedPackageInMain: SymLink = { - path: `${mainPackageRoot}/node_modules/@scoped/linked-package`, - symLink: `${linkedPackageRoot}` - }; - const linkedPackageJson: File = { - path: `${linkedPackageRoot}/package.json`, - content: JSON.stringify({ name: "@scoped/linked-package", version: "0.0.1", types: "dist/index.d.ts", main: "dist/index.js" }) - }; - const linkedPackageIndex: File = { - path: `${linkedPackageRoot}/dist/index.d.ts`, - content: "export * from './other';" - }; - const linkedPackageOther: File = { - path: `${linkedPackageRoot}/dist/other.d.ts`, - content: 'export declare const Foo = "BAR";' - }; - - it("verify watched directories", () => { - const files = [libFile, mainFile, config, linkedPackageInMain, linkedPackageJson, linkedPackageIndex, linkedPackageOther]; - const host = createWatchedSystem(files, { currentDirectory: mainPackageRoot }); - createWatchOfConfigFile("tsconfig.json", host); - checkWatchedFilesDetailed(host, [libFile.path, mainFile.path, config.path, linkedPackageIndex.path, linkedPackageOther.path], 1); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, [`${mainPackageRoot}/@scoped`, `${mainPackageRoot}/node_modules`, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); - }); - }); -} - namespace ts.projectSystem { function createHostModuleResolutionTrace(host: TestServerHost & ModuleResolutionHost) { const resolutionTrace: string[] = []; diff --git a/src/testRunner/unittests/session.ts b/src/testRunner/unittests/tsserver/session.ts similarity index 100% rename from src/testRunner/unittests/session.ts rename to src/testRunner/unittests/tsserver/session.ts diff --git a/src/testRunner/unittests/tsserver/skipLibCheck.ts b/src/testRunner/unittests/tsserver/skipLibCheck.ts new file mode 100644 index 00000000000..463ea439396 --- /dev/null +++ b/src/testRunner/unittests/tsserver/skipLibCheck.ts @@ -0,0 +1,229 @@ +namespace ts.projectSystem { + describe("tsserver:: with skipLibCheck", () => { + it("should be turned on for js-only inferred projects", () => { + const file1 = { + path: "/a/b/file1.js", + content: ` + /// + var x = 1;` + }; + const file2 = { + path: "/a/b/file2.d.ts", + content: ` + interface T { + name: string; + }; + interface T { + name: number; + };` + }; + const host = createServerHost([file1, file2]); + const session = createSession(host); + openFilesForSession([file1, file2], session); + + const file2GetErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: file2.path } + ); + let errorResult = session.executeCommand(file2GetErrRequest).response; + assert.isTrue(errorResult.length === 0); + + const closeFileRequest = makeSessionRequest(CommandNames.Close, { file: file1.path }); + session.executeCommand(closeFileRequest); + errorResult = session.executeCommand(file2GetErrRequest).response; + assert.isTrue(errorResult.length !== 0); + + openFilesForSession([file1], session); + errorResult = session.executeCommand(file2GetErrRequest).response; + assert.isTrue(errorResult.length === 0); + }); + + it("should be turned on for js-only external projects", () => { + const jsFile = { + path: "/a/b/file1.js", + content: "let x =1;" + }; + const dTsFile = { + path: "/a/b/file2.d.ts", + content: ` + interface T { + name: string; + }; + interface T { + name: number; + };` + }; + const host = createServerHost([jsFile, dTsFile]); + const session = createSession(host); + + const openExternalProjectRequest = makeSessionRequest( + CommandNames.OpenExternalProject, + { + projectFileName: "project1", + rootFiles: toExternalFiles([jsFile.path, dTsFile.path]), + options: {} + } + ); + session.executeCommand(openExternalProjectRequest); + + const dTsFileGetErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: dTsFile.path } + ); + const errorResult = session.executeCommand(dTsFileGetErrRequest).response; + assert.isTrue(errorResult.length === 0); + }); + + it("should be turned on for js-only external projects with skipLibCheck=false", () => { + const jsFile = { + path: "/a/b/file1.js", + content: "let x =1;" + }; + const dTsFile = { + path: "/a/b/file2.d.ts", + content: ` + interface T { + name: string; + }; + interface T { + name: number; + };` + }; + const host = createServerHost([jsFile, dTsFile]); + const session = createSession(host); + + const openExternalProjectRequest = makeSessionRequest( + CommandNames.OpenExternalProject, + { + projectFileName: "project1", + rootFiles: toExternalFiles([jsFile.path, dTsFile.path]), + options: { skipLibCheck: false } + } + ); + session.executeCommand(openExternalProjectRequest); + + const dTsFileGetErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: dTsFile.path } + ); + const errorResult = session.executeCommand(dTsFileGetErrRequest).response; + assert.isTrue(errorResult.length === 0); + }); + + it("should not report bind errors for declaration files with skipLibCheck=true", () => { + const jsconfigFile = { + path: "/a/jsconfig.json", + content: "{}" + }; + const jsFile = { + path: "/a/jsFile.js", + content: "let x = 1;" + }; + const dTsFile1 = { + path: "/a/dTsFile1.d.ts", + content: ` + declare var x: number;` + }; + const dTsFile2 = { + path: "/a/dTsFile2.d.ts", + content: ` + declare var x: string;` + }; + const host = createServerHost([jsconfigFile, jsFile, dTsFile1, dTsFile2]); + const session = createSession(host); + openFilesForSession([jsFile], session); + + const dTsFile1GetErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: dTsFile1.path } + ); + const error1Result = session.executeCommand(dTsFile1GetErrRequest).response; + assert.isTrue(error1Result.length === 0); + + const dTsFile2GetErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: dTsFile2.path } + ); + const error2Result = session.executeCommand(dTsFile2GetErrRequest).response; + assert.isTrue(error2Result.length === 0); + }); + + it("should report semantic errors for loose JS files with '// @ts-check' and skipLibCheck=true", () => { + const jsFile = { + path: "/a/jsFile.js", + content: ` + // @ts-check + let x = 1; + x === "string";` + }; + + const host = createServerHost([jsFile]); + const session = createSession(host); + openFilesForSession([jsFile], session); + + const getErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: jsFile.path } + ); + const errorResult = session.executeCommand(getErrRequest).response; + assert.isTrue(errorResult.length === 1); + assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); + }); + + it("should report semantic errors for configured js project with '// @ts-check' and skipLibCheck=true", () => { + const jsconfigFile = { + path: "/a/jsconfig.json", + content: "{}" + }; + + const jsFile = { + path: "/a/jsFile.js", + content: ` + // @ts-check + let x = 1; + x === "string";` + }; + + const host = createServerHost([jsconfigFile, jsFile]); + const session = createSession(host); + openFilesForSession([jsFile], session); + + const getErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: jsFile.path } + ); + const errorResult = session.executeCommand(getErrRequest).response; + assert.isTrue(errorResult.length === 1); + assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); + }); + + it("should report semantic errors for configured js project with checkJs=true and skipLibCheck=true", () => { + const jsconfigFile = { + path: "/a/jsconfig.json", + content: JSON.stringify({ + compilerOptions: { + checkJs: true, + skipLibCheck: true + }, + }) + }; + const jsFile = { + path: "/a/jsFile.js", + content: `let x = 1; + x === "string";` + }; + + const host = createServerHost([jsconfigFile, jsFile]); + const session = createSession(host); + openFilesForSession([jsFile], session); + + const getErrRequest = makeSessionRequest( + CommandNames.SemanticDiagnosticsSync, + { file: jsFile.path } + ); + const errorResult = session.executeCommand(getErrRequest).response; + assert.isTrue(errorResult.length === 1); + assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverSymLinks.ts b/src/testRunner/unittests/tsserver/symLinks.ts similarity index 97% rename from src/testRunner/unittests/tsserverSymLinks.ts rename to src/testRunner/unittests/tsserver/symLinks.ts index c9bad7ea678..d6fa9dca894 100644 --- a/src/testRunner/unittests/tsserverSymLinks.ts +++ b/src/testRunner/unittests/tsserver/symLinks.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserverProjectSystem with symLinks", () => { + describe("tsserver:: symLinks", () => { it("rename in common file renames all project", () => { const projects = "/users/username/projects"; const folderA = `${projects}/a`; diff --git a/src/testRunner/unittests/telemetry.ts b/src/testRunner/unittests/tsserver/telemetry.ts similarity index 100% rename from src/testRunner/unittests/telemetry.ts rename to src/testRunner/unittests/tsserver/telemetry.ts diff --git a/src/testRunner/unittests/textStorage.ts b/src/testRunner/unittests/tsserver/textStorage.ts similarity index 100% rename from src/testRunner/unittests/textStorage.ts rename to src/testRunner/unittests/tsserver/textStorage.ts diff --git a/src/testRunner/unittests/typingsInstaller.ts b/src/testRunner/unittests/tsserver/typingsInstaller.ts similarity index 100% rename from src/testRunner/unittests/typingsInstaller.ts rename to src/testRunner/unittests/tsserver/typingsInstaller.ts diff --git a/src/testRunner/unittests/versionCache.ts b/src/testRunner/unittests/tsserver/versionCache.ts similarity index 100% rename from src/testRunner/unittests/versionCache.ts rename to src/testRunner/unittests/tsserver/versionCache.ts diff --git a/src/testRunner/unittests/tsserver/watchEnvironment.ts b/src/testRunner/unittests/tsserver/watchEnvironment.ts new file mode 100644 index 00000000000..8bce3505626 --- /dev/null +++ b/src/testRunner/unittests/tsserver/watchEnvironment.ts @@ -0,0 +1,135 @@ +namespace ts.projectSystem { + import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; + describe("watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { + function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { + const projectFolder = "/a/username/project"; + const projectSrcFolder = `${projectFolder}/src`; + const configFile: File = { + path: `${projectFolder}/tsconfig.json`, + content: "{}" + }; + const index: File = { + path: `${projectSrcFolder}/index.ts`, + content: `import {} from "./"` + }; + const file1: File = { + path: `${projectSrcFolder}/file1.ts`, + content: "" + }; + + const files = [index, file1, configFile, libFile]; + const fileNames = files.map(file => file.path); + // All closed files(files other than index), project folder, project/src folder and project/node_modules/@types folder + const expectedWatchedFiles = arrayToMap(fileNames.slice(1), s => s, () => 1); + const expectedWatchedDirectories = createMap(); + const mapOfDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? + expectedWatchedDirectories : + tscWatchDirectory === Tsc_WatchDirectory.WatchFile ? + expectedWatchedFiles : + createMap(); + // For failed resolution lookup and tsconfig files => cached so only watched only once + mapOfDirectories.set(projectFolder, 1); + // Through above recursive watches + mapOfDirectories.set(projectSrcFolder, 1); + // node_modules/@types folder + mapOfDirectories.set(`${projectFolder}/${nodeModulesAtTypes}`, 1); + const expectedCompletions = ["file1"]; + const completionPosition = index.content.lastIndexOf('"'); + const environmentVariables = createMap(); + environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); + const host = createServerHost(files, { environmentVariables }); + const projectService = createProjectService(host); + projectService.openClientFile(index.path); + + const project = Debug.assertDefined(projectService.configuredProjects.get(configFile.path)); + verifyProjectAndCompletions(); + + // Add file2 + const file2: File = { + path: `${projectSrcFolder}/file2.ts`, + content: "" + }; + files.push(file2); + fileNames.push(file2.path); + expectedWatchedFiles.set(file2.path, 1); + expectedCompletions.push("file2"); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + assert.equal(projectService.configuredProjects.get(configFile.path), project); + verifyProjectAndCompletions(); + + function verifyProjectAndCompletions() { + const completions = project.getLanguageService().getCompletionsAtPosition(index.path, completionPosition, { includeExternalModuleExports: false, includeInsertTextCompletions: false })!; + checkArray("Completion Entries", completions.entries.map(e => e.name), expectedCompletions); + + checkWatchedDirectories(host, emptyArray, /*recursive*/ true); + + checkWatchedFilesDetailed(host, expectedWatchedFiles); + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ false); + checkProjectActualFiles(project, fileNames); + } + } + + it("uses watchFile when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.WatchFile); + }); + + it("uses non recursive watchDirectory when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); + }); + + it("uses dynamic polling when file is added to subfolder, completion list has new file", () => { + verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); + }); + }); + + describe("watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { + function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { + const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; + const configFile: File = { + path: root + "project/tsconfig.json", + content: "{}" + }; + const file1: File = { + path: root + "project/file1.ts", + content: "let x = 10;" + }; + const file2: File = { + path: root + "project/file2.ts", + content: "let y = 10;" + }; + const files = [configFile, file1, file2, libFile]; + const host = createServerHost(files, { useWindowsStylePaths: true }); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isDefined(project); + const winsowsStyleLibFilePath = "c:/" + libFile.path.substring(1); + checkProjectActualFiles(project, files.map(f => f === libFile ? winsowsStyleLibFilePath : f.path)); + checkWatchedFiles(host, mapDefined(files, f => f === libFile ? winsowsStyleLibFilePath : f === file1 ? undefined : f.path)); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, [ + root + "project", + root + "project/node_modules/@types" + ].concat(useProjectAtRoot ? [] : [root + nodeModulesAtTypes]), /*recursive*/ true); + } + + function verifyRootedDirectoryWatch(rootedPath: string) { + it("When project is in rootFolder of style c:/", () => { + verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ true); + }); + + it("When files at some folder other than root", () => { + verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ false); + }); + } + + describe("for rootFolder of style c:/", () => { + verifyRootedDirectoryWatch("c:/"); + }); + + describe("for rootFolder of style c:/users/username", () => { + verifyRootedDirectoryWatch("c:/users/username/"); + }); + }); +} diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 56493c01e35..85be445171a 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -3280,305 +3280,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem external projects", () => { - describe("correctly handling add/remove tsconfig - 1", () => { - function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1;" - }; - const f2 = { - path: "/a/b/lib.ts", - content: "" - }; - const tsconfig = { - path: "/a/b/tsconfig.json", - content: "" - }; - const host = createServerHost([f1, f2]); - const projectService = createProjectService(host); - projectService.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); - - // open external project - const projectName = "/a/b/proj1"; - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, f2.path]), - options: {} - }); - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(projectService.externalProjects[0], [f1.path, f2.path]); - - // rename lib.ts to tsconfig.json - host.reloadFS([f1, tsconfig]); - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, tsconfig.path]), - options: {} - }); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - if (lazyConfiguredProjectsFromExternalProject) { - checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed - projectService.ensureInferredProjectsUpToDate_TestOnly(); - } - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, tsconfig.path]); - - // rename tsconfig.json back to lib.ts - host.reloadFS([f1, f2]); - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, f2.path]), - options: {} - }); - - projectService.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(projectService.externalProjects[0], [f1.path, f2.path]); - } - it("when lazyConfiguredProjectsFromExternalProject not set", () => { - verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ false); - }); - it("when lazyConfiguredProjectsFromExternalProject is set", () => { - verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ true); - }); - }); - - describe("correctly handling add/remove tsconfig - 2", () => { - function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1;" - }; - const cLib = { - path: "/a/b/c/lib.ts", - content: "" - }; - const cTsconfig = { - path: "/a/b/c/tsconfig.json", - content: "{}" - }; - const dLib = { - path: "/a/b/d/lib.ts", - content: "" - }; - const dTsconfig = { - path: "/a/b/d/tsconfig.json", - content: "{}" - }; - const host = createServerHost([f1, cLib, cTsconfig, dLib, dTsconfig]); - const projectService = createProjectService(host); - projectService.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); - - // open external project - const projectName = "/a/b/proj1"; - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path]), - options: {} - }); - - projectService.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(projectService.externalProjects[0], [f1.path]); - - // add two config file as root files - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, cTsconfig.path, dTsconfig.path]), - options: {} - }); - projectService.checkNumberOfProjects({ configuredProjects: 2 }); - if (lazyConfiguredProjectsFromExternalProject) { - checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed - checkProjectActualFiles(configuredProjectAt(projectService, 1), emptyArray); // Configured project created but not loaded till actually needed - projectService.ensureInferredProjectsUpToDate_TestOnly(); - } - checkProjectActualFiles(configuredProjectAt(projectService, 0), [cLib.path, cTsconfig.path]); - checkProjectActualFiles(configuredProjectAt(projectService, 1), [dLib.path, dTsconfig.path]); - - // remove one config file - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, dTsconfig.path]), - options: {} - }); - - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [dLib.path, dTsconfig.path]); - - // remove second config file - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path]), - options: {} - }); - - projectService.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(projectService.externalProjects[0], [f1.path]); - - // open two config files - // add two config file as root files - projectService.openExternalProject({ - projectFileName: projectName, - rootFiles: toExternalFiles([f1.path, cTsconfig.path, dTsconfig.path]), - options: {} - }); - projectService.checkNumberOfProjects({ configuredProjects: 2 }); - if (lazyConfiguredProjectsFromExternalProject) { - checkProjectActualFiles(configuredProjectAt(projectService, 0), emptyArray); // Configured project created but not loaded till actually needed - checkProjectActualFiles(configuredProjectAt(projectService, 1), emptyArray); // Configured project created but not loaded till actually needed - projectService.ensureInferredProjectsUpToDate_TestOnly(); - } - checkProjectActualFiles(configuredProjectAt(projectService, 0), [cLib.path, cTsconfig.path]); - checkProjectActualFiles(configuredProjectAt(projectService, 1), [dLib.path, dTsconfig.path]); - - // close all projects - no projects should be opened - projectService.closeExternalProject(projectName); - projectService.checkNumberOfProjects({}); - } - - it("when lazyConfiguredProjectsFromExternalProject not set", () => { - verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ false); - }); - it("when lazyConfiguredProjectsFromExternalProject is set", () => { - verifyAddRemoveConfig(/*lazyConfiguredProjectsFromExternalProject*/ true); - }); - }); - - it("correctly handles changes in lib section of config file", () => { - const libES5 = { - path: "/compiler/lib.es5.d.ts", - content: "declare const eval: any" - }; - const libES2015Promise = { - path: "/compiler/lib.es2015.promise.d.ts", - content: "declare class Promise {}" - }; - const app = { - path: "/src/app.ts", - content: "var x: Promise;" - }; - const config1 = { - path: "/src/tsconfig.json", - content: JSON.stringify( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: true, - sourceMap: false, - lib: [ - "es5" - ] - } - }) - }; - const config2 = { - path: config1.path, - content: JSON.stringify( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: true, - sourceMap: false, - lib: [ - "es5", - "es2015.promise" - ] - } - }) - }; - const host = createServerHost([libES5, libES2015Promise, app, config1], { executingFilePath: "/compiler/tsc.js" }); - const projectService = createProjectService(host); - projectService.openClientFile(app.path); - - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [libES5.path, app.path, config1.path]); - - host.reloadFS([libES5, libES2015Promise, app, config2]); - host.checkTimeoutQueueLengthAndRun(2); - - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [libES5.path, libES2015Promise.path, app.path, config2.path]); - }); - - it("should handle non-existing directories in config file", () => { - const f = { - path: "/a/src/app.ts", - content: "let x = 1;" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: {}, - include: [ - "src/**/*", - "notexistingfolder/*" - ] - }) - }; - const host = createServerHost([f, config]); - const projectService = createProjectService(host); - projectService.openClientFile(f.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - const project = projectService.configuredProjects.get(config.path)!; - assert.isTrue(project.hasOpenRef()); // f - - projectService.closeClientFile(f.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config.path), project); - assert.isFalse(project.hasOpenRef()); // No files - assert.isFalse(project.isClosed()); - - projectService.openClientFile(f.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config.path), project); - assert.isTrue(project.hasOpenRef()); // f - assert.isFalse(project.isClosed()); - }); - - it("handles loads existing configured projects of external projects when lazyConfiguredProjectsFromExternalProject is disabled", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({}) - }; - const projectFileName = "/a/b/project.csproj"; - const host = createServerHost([f1, config]); - const service = createProjectService(host); - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: true } }); - service.openExternalProject({ - projectFileName, - rootFiles: toExternalFiles([f1.path, config.path]), - options: {} - }); - service.checkNumberOfProjects({ configuredProjects: 1 }); - const project = service.configuredProjects.get(config.path)!; - assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.Full); // External project referenced configured project pending to be reloaded - checkProjectActualFiles(project, emptyArray); - - service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject: false } }); - assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project loaded - checkProjectActualFiles(project, [config.path, f1.path]); - - service.closeExternalProject(projectFileName); - service.checkNumberOfProjects({}); - - service.openExternalProject({ - projectFileName, - rootFiles: toExternalFiles([f1.path, config.path]), - options: {} - }); - service.checkNumberOfProjects({ configuredProjects: 1 }); - const project2 = service.configuredProjects.get(config.path)!; - assert.equal(project2.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project loaded - checkProjectActualFiles(project2, [config.path, f1.path]); - }); - }); - describe("tsserverProjectSystem prefer typings to js", () => { it("during second resolution pass", () => { const typingsCacheLocation = "/a/typings"; @@ -3770,234 +3471,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem skipLibCheck", () => { - it("should be turned on for js-only inferred projects", () => { - const file1 = { - path: "/a/b/file1.js", - content: ` - /// - var x = 1;` - }; - const file2 = { - path: "/a/b/file2.d.ts", - content: ` - interface T { - name: string; - }; - interface T { - name: number; - };` - }; - const host = createServerHost([file1, file2]); - const session = createSession(host); - openFilesForSession([file1, file2], session); - - const file2GetErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: file2.path } - ); - let errorResult = session.executeCommand(file2GetErrRequest).response; - assert.isTrue(errorResult.length === 0); - - const closeFileRequest = makeSessionRequest(CommandNames.Close, { file: file1.path }); - session.executeCommand(closeFileRequest); - errorResult = session.executeCommand(file2GetErrRequest).response; - assert.isTrue(errorResult.length !== 0); - - openFilesForSession([file1], session); - errorResult = session.executeCommand(file2GetErrRequest).response; - assert.isTrue(errorResult.length === 0); - }); - - it("should be turned on for js-only external projects", () => { - const jsFile = { - path: "/a/b/file1.js", - content: "let x =1;" - }; - const dTsFile = { - path: "/a/b/file2.d.ts", - content: ` - interface T { - name: string; - }; - interface T { - name: number; - };` - }; - const host = createServerHost([jsFile, dTsFile]); - const session = createSession(host); - - const openExternalProjectRequest = makeSessionRequest( - CommandNames.OpenExternalProject, - { - projectFileName: "project1", - rootFiles: toExternalFiles([jsFile.path, dTsFile.path]), - options: {} - } - ); - session.executeCommand(openExternalProjectRequest); - - const dTsFileGetErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: dTsFile.path } - ); - const errorResult = session.executeCommand(dTsFileGetErrRequest).response; - assert.isTrue(errorResult.length === 0); - }); - - it("should be turned on for js-only external projects with skipLibCheck=false", () => { - const jsFile = { - path: "/a/b/file1.js", - content: "let x =1;" - }; - const dTsFile = { - path: "/a/b/file2.d.ts", - content: ` - interface T { - name: string; - }; - interface T { - name: number; - };` - }; - const host = createServerHost([jsFile, dTsFile]); - const session = createSession(host); - - const openExternalProjectRequest = makeSessionRequest( - CommandNames.OpenExternalProject, - { - projectFileName: "project1", - rootFiles: toExternalFiles([jsFile.path, dTsFile.path]), - options: { skipLibCheck: false } - } - ); - session.executeCommand(openExternalProjectRequest); - - const dTsFileGetErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: dTsFile.path } - ); - const errorResult = session.executeCommand(dTsFileGetErrRequest).response; - assert.isTrue(errorResult.length === 0); - }); - - it("should not report bind errors for declaration files with skipLibCheck=true", () => { - const jsconfigFile = { - path: "/a/jsconfig.json", - content: "{}" - }; - const jsFile = { - path: "/a/jsFile.js", - content: "let x = 1;" - }; - const dTsFile1 = { - path: "/a/dTsFile1.d.ts", - content: ` - declare var x: number;` - }; - const dTsFile2 = { - path: "/a/dTsFile2.d.ts", - content: ` - declare var x: string;` - }; - const host = createServerHost([jsconfigFile, jsFile, dTsFile1, dTsFile2]); - const session = createSession(host); - openFilesForSession([jsFile], session); - - const dTsFile1GetErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: dTsFile1.path } - ); - const error1Result = session.executeCommand(dTsFile1GetErrRequest).response; - assert.isTrue(error1Result.length === 0); - - const dTsFile2GetErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: dTsFile2.path } - ); - const error2Result = session.executeCommand(dTsFile2GetErrRequest).response; - assert.isTrue(error2Result.length === 0); - }); - - it("should report semantic errors for loose JS files with '// @ts-check' and skipLibCheck=true", () => { - const jsFile = { - path: "/a/jsFile.js", - content: ` - // @ts-check - let x = 1; - x === "string";` - }; - - const host = createServerHost([jsFile]); - const session = createSession(host); - openFilesForSession([jsFile], session); - - const getErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: jsFile.path } - ); - const errorResult = session.executeCommand(getErrRequest).response; - assert.isTrue(errorResult.length === 1); - assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); - }); - - it("should report semantic errors for configured js project with '// @ts-check' and skipLibCheck=true", () => { - const jsconfigFile = { - path: "/a/jsconfig.json", - content: "{}" - }; - - const jsFile = { - path: "/a/jsFile.js", - content: ` - // @ts-check - let x = 1; - x === "string";` - }; - - const host = createServerHost([jsconfigFile, jsFile]); - const session = createSession(host); - openFilesForSession([jsFile], session); - - const getErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: jsFile.path } - ); - const errorResult = session.executeCommand(getErrRequest).response; - assert.isTrue(errorResult.length === 1); - assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); - }); - - it("should report semantic errors for configured js project with checkJs=true and skipLibCheck=true", () => { - const jsconfigFile = { - path: "/a/jsconfig.json", - content: JSON.stringify({ - compilerOptions: { - checkJs: true, - skipLibCheck: true - }, - }) - }; - const jsFile = { - path: "/a/jsFile.js", - content: `let x = 1; - x === "string";` - }; - - const host = createServerHost([jsconfigFile, jsFile]); - const session = createSession(host); - openFilesForSession([jsFile], session); - - const getErrRequest = makeSessionRequest( - CommandNames.SemanticDiagnosticsSync, - { file: jsFile.path } - ); - const errorResult = session.executeCommand(getErrRequest).response; - assert.isTrue(errorResult.length === 1); - assert.equal(errorResult[0].code, Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code); - }); - }); - describe("tsserverProjectSystem non-existing directories listed in config file input array", () => { it("should be tolerated without crashing the server", () => { const configFile = { @@ -4079,156 +3552,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem reload", () => { - it("should work with temp file", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const tmp = { - path: "/a/b/app.tmp", - content: "const y = 42" - }; - const host = createServerHost([f1, tmp]); - const session = createSession(host); - - // send open request - session.executeCommand({ - type: "request", - command: "open", - seq: 1, - arguments: { file: f1.path } - }); - - // reload from tmp file - session.executeCommand({ - type: "request", - command: "reload", - seq: 2, - arguments: { file: f1.path, tmpfile: tmp.path } - }); - - // verify content - const projectServiice = session.getProjectService(); - const snap1 = projectServiice.getScriptInfo(f1.path)!.getSnapshot(); - assert.equal(getSnapshotText(snap1), tmp.content, "content should be equal to the content of temp file"); - - // reload from original file file - session.executeCommand({ - type: "request", - command: "reload", - seq: 2, - arguments: { file: f1.path } - }); - - // verify content - const snap2 = projectServiice.getScriptInfo(f1.path)!.getSnapshot(); - assert.equal(getSnapshotText(snap2), f1.content, "content should be equal to the content of original file"); - - }); - - it("should work when script info doesnt have any project open", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const tmp = { - path: "/a/b/app.tmp", - content: "const y = 42" - }; - const host = createServerHost([f1, tmp, libFile]); - const session = createSession(host); - const openContent = "let z = 1"; - // send open request - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Open, - arguments: { file: f1.path, fileContent: openContent } - }); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const info = projectService.getScriptInfo(f1.path)!; - assert.isDefined(info); - checkScriptInfoContents(openContent, "contents set during open request"); - - // send close request - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Close, - arguments: { file: f1.path } - }); - checkScriptInfoAndProjects(f1.content, "contents of closed file"); - checkInferredProjectIsOrphan(); - - // Can reload contents of the file when its not open and has no project - // reload from temp file - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Reload, - arguments: { file: f1.path, tmpfile: tmp.path } - }); - checkScriptInfoAndProjects(tmp.content, "contents of temp file"); - checkInferredProjectIsOrphan(); - - // reload from own file - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Reload, - arguments: { file: f1.path } - }); - checkScriptInfoAndProjects(f1.content, "contents of closed file"); - checkInferredProjectIsOrphan(); - - // Open file again without setting its content - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Open, - arguments: { file: f1.path } - }); - checkScriptInfoAndProjects(f1.content, "contents of file when opened without specifying contents"); - const snap = info.getSnapshot(); - - // send close request - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Close, - arguments: { file: f1.path } - }); - checkScriptInfoAndProjects(f1.content, "contents of closed file"); - assert.strictEqual(info.getSnapshot(), snap); - checkInferredProjectIsOrphan(); - - // reload from temp file - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Reload, - arguments: { file: f1.path, tmpfile: tmp.path } - }); - checkScriptInfoAndProjects(tmp.content, "contents of temp file"); - assert.notStrictEqual(info.getSnapshot(), snap); - checkInferredProjectIsOrphan(); - - // reload from own file - session.executeCommandSeq({ - command: server.protocol.CommandTypes.Reload, - arguments: { file: f1.path } - }); - checkScriptInfoAndProjects(f1.content, "contents of closed file"); - assert.notStrictEqual(info.getSnapshot(), snap); - checkInferredProjectIsOrphan(); - - function checkInferredProjectIsOrphan() { - assert.isTrue(projectService.inferredProjects[0].isOrphan()); - assert.equal(info.containingProjects.length, 0); - } - - function checkScriptInfoAndProjects(contentsOfInfo: string, captionForContents: string) { - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - assert.strictEqual(projectService.getScriptInfo(f1.path), info); - checkScriptInfoContents(contentsOfInfo, captionForContents); - } - - function checkScriptInfoContents(contentsOfInfo: string, captionForContents: string) { - const snap = info.getSnapshot(); - assert.equal(getSnapshotText(snap), contentsOfInfo, "content should be equal to " + captionForContents); - } - }); - }); - describe("tsserverProjectSystem Inferred projects", () => { it("should support files without extensions", () => { const f = { diff --git a/src/testRunner/unittests/watchEnvironment.ts b/src/testRunner/unittests/watchEnvironment.ts deleted file mode 100644 index 74a6637d6fc..00000000000 --- a/src/testRunner/unittests/watchEnvironment.ts +++ /dev/null @@ -1,316 +0,0 @@ -namespace ts { - import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; - - export namespace tscWatch { - describe("watchEnvironment:: tsc-watch with different polling/non polling options", () => { - it("watchFile using dynamic priority polling", () => { - const projectFolder = "/a/username/project"; - const file1: File = { - path: `${projectFolder}/typescript.ts`, - content: "var z = 10;" - }; - const files = [file1, libFile]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHFILE", "DynamicPriorityPolling"); - const host = createWatchedSystem(files, { environmentVariables }); - const watch = createWatchOfFilesAndCompilerOptions([file1.path], host); - - const initialProgram = watch(); - verifyProgram(); - - const mediumPollingIntervalThreshold = unchangedPollThresholds[PollingInterval.Medium]; - for (let index = 0; index < mediumPollingIntervalThreshold; index++) { - // Transition libFile and file1 to low priority queue - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), initialProgram); - } - - // Make a change to file - file1.content = "var zz30 = 100;"; - host.reloadFS(files); - - // This should detect change in the file - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), initialProgram); - - // Callbacks: medium priority + high priority queue and scheduled program update - host.checkTimeoutQueueLengthAndRun(3); - // During this timeout the file would be detected as unchanged - let fileUnchangeDetected = 1; - const newProgram = watch(); - assert.notStrictEqual(newProgram, initialProgram); - - verifyProgram(); - const outputFile1 = changeExtension(file1.path, ".js"); - assert.isTrue(host.fileExists(outputFile1)); - assert.equal(host.readFile(outputFile1), file1.content + host.newLine); - - const newThreshold = unchangedPollThresholds[PollingInterval.Low] + mediumPollingIntervalThreshold; - for (; fileUnchangeDetected < newThreshold; fileUnchangeDetected++) { - // For high + Medium/low polling interval - host.checkTimeoutQueueLengthAndRun(2); - assert.deepEqual(watch(), newProgram); - } - - // Everything goes in high polling interval queue - host.checkTimeoutQueueLengthAndRun(1); - assert.deepEqual(watch(), newProgram); - - function verifyProgram() { - checkProgramActualFiles(watch(), files.map(f => f.path)); - checkWatchedFiles(host, []); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, [], /*recursive*/ true); - } - }); - - describe("tsc-watch when watchDirectories implementation", () => { - function verifyRenamingFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { - const projectFolder = "/a/username/project"; - const projectSrcFolder = `${projectFolder}/src`; - const configFile: File = { - path: `${projectFolder}/tsconfig.json`, - content: "{}" - }; - const file: File = { - path: `${projectSrcFolder}/file1.ts`, - content: "" - }; - const programFiles = [file, libFile]; - const files = [file, configFile, libFile]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); - const host = createWatchedSystem(files, { environmentVariables }); - const watch = createWatchOfConfigFile(configFile.path, host); - const projectFolders = [projectFolder, projectSrcFolder, `${projectFolder}/node_modules/@types`]; - // Watching files config file, file, lib file - const expectedWatchedFiles = files.map(f => f.path); - const expectedWatchedDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? projectFolders : emptyArray; - if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) { - expectedWatchedFiles.push(...projectFolders); - } - - verifyProgram(checkOutputErrorsInitial); - - // Rename the file: - file.path = file.path.replace("file1.ts", "file2.ts"); - expectedWatchedFiles[0] = file.path; - host.reloadFS(files); - if (tscWatchDirectory === Tsc_WatchDirectory.DynamicPolling) { - // With dynamic polling the fs change would be detected only by running timeouts - host.runQueuedTimeoutCallbacks(); - } - // Delayed update program - host.runQueuedTimeoutCallbacks(); - verifyProgram(checkOutputErrorsIncremental); - - function verifyProgram(checkOutputErrors: (host: WatchedSystem, errors: ReadonlyArray) => void) { - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrors(host, emptyArray); - - const outputFile = changeExtension(file.path, ".js"); - assert(host.fileExists(outputFile)); - assert.equal(host.readFile(outputFile), file.content); - - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - - // Watching config file, file, lib file and directories - checkWatchedFilesDetailed(host, expectedWatchedFiles, 1); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, 1, /*recursive*/ false); - } - } - - it("uses watchFile when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.WatchFile); - }); - - it("uses non recursive watchDirectory when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); - }); - - it("uses non recursive dynamic polling when renaming file in subfolder", () => { - verifyRenamingFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); - }); - - it("when there are symlinks to folders in recursive folders", () => { - const cwd = "/home/user/projects/myproject"; - const file1: File = { - path: `${cwd}/src/file.ts`, - content: `import * as a from "a"` - }; - const tsconfig: File = { - path: `${cwd}/tsconfig.json`, - content: `{ "compilerOptions": { "extendedDiagnostics": true, "traceResolution": true }}` - }; - const realA: File = { - path: `${cwd}/node_modules/reala/index.d.ts`, - content: `export {}` - }; - const realB: File = { - path: `${cwd}/node_modules/realb/index.d.ts`, - content: `export {}` - }; - const symLinkA: SymLink = { - path: `${cwd}/node_modules/a`, - symLink: `${cwd}/node_modules/reala` - }; - const symLinkB: SymLink = { - path: `${cwd}/node_modules/b`, - symLink: `${cwd}/node_modules/realb` - }; - const symLinkBInA: SymLink = { - path: `${cwd}/node_modules/reala/node_modules/b`, - symLink: `${cwd}/node_modules/b` - }; - const symLinkAInB: SymLink = { - path: `${cwd}/node_modules/realb/node_modules/a`, - symLink: `${cwd}/node_modules/a` - }; - const files = [file1, tsconfig, realA, realB, symLinkA, symLinkB, symLinkBInA, symLinkAInB]; - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", Tsc_WatchDirectory.NonRecursiveWatchDirectory); - const host = createWatchedSystem(files, { environmentVariables, currentDirectory: cwd }); - createWatchOfConfigFile("tsconfig.json", host); - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - checkWatchedDirectories(host, [cwd, `${cwd}/node_modules`, `${cwd}/node_modules/@types`, `${cwd}/node_modules/reala`, `${cwd}/node_modules/realb`, - `${cwd}/node_modules/reala/node_modules`, `${cwd}/node_modules/realb/node_modules`, `${cwd}/src`], /*recursive*/ false); - }); - }); - }); - } - - export namespace projectSystem { - describe("watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { - function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { - const projectFolder = "/a/username/project"; - const projectSrcFolder = `${projectFolder}/src`; - const configFile: File = { - path: `${projectFolder}/tsconfig.json`, - content: "{}" - }; - const index: File = { - path: `${projectSrcFolder}/index.ts`, - content: `import {} from "./"` - }; - const file1: File = { - path: `${projectSrcFolder}/file1.ts`, - content: "" - }; - - const files = [index, file1, configFile, libFile]; - const fileNames = files.map(file => file.path); - // All closed files(files other than index), project folder, project/src folder and project/node_modules/@types folder - const expectedWatchedFiles = arrayToMap(fileNames.slice(1), s => s, () => 1); - const expectedWatchedDirectories = createMap(); - const mapOfDirectories = tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory ? - expectedWatchedDirectories : - tscWatchDirectory === Tsc_WatchDirectory.WatchFile ? - expectedWatchedFiles : - createMap(); - // For failed resolution lookup and tsconfig files => cached so only watched only once - mapOfDirectories.set(projectFolder, 1); - // Through above recursive watches - mapOfDirectories.set(projectSrcFolder, 1); - // node_modules/@types folder - mapOfDirectories.set(`${projectFolder}/${nodeModulesAtTypes}`, 1); - const expectedCompletions = ["file1"]; - const completionPosition = index.content.lastIndexOf('"'); - const environmentVariables = createMap(); - environmentVariables.set("TSC_WATCHDIRECTORY", tscWatchDirectory); - const host = createServerHost(files, { environmentVariables }); - const projectService = createProjectService(host); - projectService.openClientFile(index.path); - - const project = Debug.assertDefined(projectService.configuredProjects.get(configFile.path)); - verifyProjectAndCompletions(); - - // Add file2 - const file2: File = { - path: `${projectSrcFolder}/file2.ts`, - content: "" - }; - files.push(file2); - fileNames.push(file2.path); - expectedWatchedFiles.set(file2.path, 1); - expectedCompletions.push("file2"); - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - assert.equal(projectService.configuredProjects.get(configFile.path), project); - verifyProjectAndCompletions(); - - function verifyProjectAndCompletions() { - const completions = project.getLanguageService().getCompletionsAtPosition(index.path, completionPosition, { includeExternalModuleExports: false, includeInsertTextCompletions: false })!; - checkArray("Completion Entries", completions.entries.map(e => e.name), expectedCompletions); - - checkWatchedDirectories(host, emptyArray, /*recursive*/ true); - - checkWatchedFilesDetailed(host, expectedWatchedFiles); - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ false); - checkProjectActualFiles(project, fileNames); - } - } - - it("uses watchFile when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.WatchFile); - }); - - it("uses non recursive watchDirectory when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.NonRecursiveWatchDirectory); - }); - - it("uses dynamic polling when file is added to subfolder, completion list has new file", () => { - verifyCompletionListWithNewFileInSubFolder(Tsc_WatchDirectory.DynamicPolling); - }); - }); - - describe("watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { - function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { - const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; - const configFile: File = { - path: root + "project/tsconfig.json", - content: "{}" - }; - const file1: File = { - path: root + "project/file1.ts", - content: "let x = 10;" - }; - const file2: File = { - path: root + "project/file2.ts", - content: "let y = 10;" - }; - const files = [configFile, file1, file2, libFile]; - const host = createServerHost(files, { useWindowsStylePaths: true }); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - const project = projectService.configuredProjects.get(configFile.path)!; - assert.isDefined(project); - const winsowsStyleLibFilePath = "c:/" + libFile.path.substring(1); - checkProjectActualFiles(project, files.map(f => f === libFile ? winsowsStyleLibFilePath : f.path)); - checkWatchedFiles(host, mapDefined(files, f => f === libFile ? winsowsStyleLibFilePath : f === file1 ? undefined : f.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, [ - root + "project", - root + "project/node_modules/@types" - ].concat(useProjectAtRoot ? [] : [root + nodeModulesAtTypes]), /*recursive*/ true); - } - - function verifyRootedDirectoryWatch(rootedPath: string) { - it("When project is in rootFolder of style c:/", () => { - verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ true); - }); - - it("When files at some folder other than root", () => { - verifyWatchedDirectories(rootedPath, /*useProjectAtRoot*/ false); - }); - } - - describe("for rootFolder of style c:/", () => { - verifyRootedDirectoryWatch("c:/"); - }); - - describe("for rootFolder of style c:/users/username", () => { - verifyRootedDirectoryWatch("c:/users/username/"); - }); - }); - } -} From 53e2507f603836e6ff268d1a5e2e87ba2265e4c4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 7 Dec 2018 16:04:49 -0800 Subject: [PATCH 238/322] More scenarios in their own test --- src/testRunner/tsconfig.json | 26 +- .../unittests/config/commandLineParsing.ts | 4 +- .../config/configurationExtension.ts | 2 +- .../config/convertCompilerOptionsFromJson.ts | 2 +- .../config/convertTypeAcquisitionFromJson.ts | 2 +- .../unittests/config/initializeTSConfig.ts | 4 +- src/testRunner/unittests/config/matchFiles.ts | 2 +- .../unittests/config/projectReferences.ts | 12 +- src/testRunner/unittests/config/showConfig.ts | 2 +- .../unittests/config/tsconfigParsing.ts | 2 +- .../unittests/evaluation/asyncArrow.ts | 4 +- .../unittests/evaluation/asyncGenerator.ts | 4 +- .../unittests/evaluation/forAwaitOf.ts | 2 +- .../cancellableLanguageServiceOperations.ts | 2 +- .../unittests/services/colorization.ts | 2 +- .../services/convertToAsyncFunction.ts | 2 +- .../unittests/services/documentRegistry.ts | 2 +- .../unittests/services/extract/constants.ts | 2 +- .../unittests/services/extract/functions.ts | 2 +- .../unittests/services/extract/ranges.ts | 4 +- .../services/extract/symbolWalker.ts | 2 +- .../unittests/services/hostNewLineSupport.ts | 4 +- .../unittests/services/languageService.ts | 4 +- .../unittests/services/organizeImports.ts | 2 +- .../unittests/services/patternMatcher.ts | 2 +- .../unittests/services/preProcessFile.ts | 2 +- .../unittests/services/textChanges.ts | 4 +- .../unittests/{ => services}/transpile.ts | 2 +- src/testRunner/unittests/tscWatch/emit.ts | 8 +- src/testRunner/unittests/tscWatch/helpers.ts | 9 + .../unittests/tscWatch/resolutionCache.ts | 4 +- src/testRunner/unittests/tscWatch/watchApi.ts | 2 +- .../unittests/tscWatch/watchEnvironment.ts | 2 +- src/testRunner/unittests/tscWatchMode.ts | 9 - .../unittests/tsserver/cancellationToken.ts | 271 ++ .../unittests/tsserver/completions.ts | 122 + .../unittests/tsserver/configFileSearch.ts | 174 + .../unittests/tsserver/declarationFileMaps.ts | 566 +++ .../unittests/tsserver/documentRegistry.ts | 94 + .../unittests/tsserver/duplicatePackages.ts | 54 + .../forceConsistentCasingInFileNames.ts | 45 + .../unittests/tsserver/formatSettings.ts | 39 + .../tsserver/getEditsForFileRename.ts | 105 + src/testRunner/unittests/tsserver/helpers.ts | 58 +- .../unittests/tsserver/importHelpers.ts | 18 + .../unittests/tsserver/inferredProjects.ts | 229 ++ .../unittests/tsserver/languageService.ts | 19 + .../tsserver/maxNodeModuleJsDepth.ts | 55 + .../unittests/tsserver/metadataInResponse.ts | 99 + src/testRunner/unittests/tsserver/navTo.ts | 30 + .../unittests/tsserver/occurences.ts | 47 + src/testRunner/unittests/tsserver/openFile.ts | 108 + .../unittests/tsserver/projectReferences.ts | 658 ++++ .../unittests/tsserver/refactors.ts | 120 + src/testRunner/unittests/tsserver/rename.ts | 53 + .../unittests/tsserver/resolutionCache.ts | 10 +- .../unittests/tsserver/syntaxOperations.ts | 98 + .../unittests/tsserver/telemetry.ts | 2 +- .../unittests/tsserver/textStorage.ts | 2 +- .../unittests/tsserver/typeAquisition.ts | 52 + .../tsserver/typeReferenceDirectives.ts | 87 + .../unittests/tsserver/typingsInstaller.ts | 20 +- .../unittests/tsserver/untitledFiles.ts | 45 + .../unittests/tsserver/versionCache.ts | 6 +- .../unittests/tsserver/watchEnvironment.ts | 4 +- .../unittests/tsserverProjectSystem.ts | 3185 +---------------- 66 files changed, 3308 insertions(+), 3307 deletions(-) rename src/testRunner/unittests/{ => services}/transpile.ts (97%) create mode 100644 src/testRunner/unittests/tsserver/cancellationToken.ts create mode 100644 src/testRunner/unittests/tsserver/completions.ts create mode 100644 src/testRunner/unittests/tsserver/configFileSearch.ts create mode 100644 src/testRunner/unittests/tsserver/declarationFileMaps.ts create mode 100644 src/testRunner/unittests/tsserver/documentRegistry.ts create mode 100644 src/testRunner/unittests/tsserver/duplicatePackages.ts create mode 100644 src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts create mode 100644 src/testRunner/unittests/tsserver/formatSettings.ts create mode 100644 src/testRunner/unittests/tsserver/getEditsForFileRename.ts create mode 100644 src/testRunner/unittests/tsserver/importHelpers.ts create mode 100644 src/testRunner/unittests/tsserver/inferredProjects.ts create mode 100644 src/testRunner/unittests/tsserver/languageService.ts create mode 100644 src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts create mode 100644 src/testRunner/unittests/tsserver/metadataInResponse.ts create mode 100644 src/testRunner/unittests/tsserver/navTo.ts create mode 100644 src/testRunner/unittests/tsserver/occurences.ts create mode 100644 src/testRunner/unittests/tsserver/openFile.ts create mode 100644 src/testRunner/unittests/tsserver/projectReferences.ts create mode 100644 src/testRunner/unittests/tsserver/refactors.ts create mode 100644 src/testRunner/unittests/tsserver/rename.ts create mode 100644 src/testRunner/unittests/tsserver/syntaxOperations.ts create mode 100644 src/testRunner/unittests/tsserver/typeAquisition.ts create mode 100644 src/testRunner/unittests/tsserver/typeReferenceDirectives.ts create mode 100644 src/testRunner/unittests/tsserver/untitledFiles.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index a7d82b84464..4d200c4b8f9 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -58,7 +58,6 @@ "unittests/reuseProgramStructure.ts", "unittests/semver.ts", "unittests/transform.ts", - "unittests/transpile.ts", "unittests/tsbuild.ts", "unittests/tsbuildWatchMode.ts", "unittests/tscWatchMode.ts", @@ -89,25 +88,50 @@ "unittests/services/patternMatcher.ts", "unittests/services/preProcessFile.ts", "unittests/services/textChanges.ts", + "unittests/services/transpile.ts", "unittests/tscWatch/emit.ts", "unittests/tscWatch/resolutionCache.ts", "unittests/tscWatch/watchEnvironment.ts", "unittests/tscWatch/watchApi.ts", "unittests/tsserver/cachingFileSystemInformation.ts", + "unittests/tsserver/cancellationToken.ts", "unittests/tsserver/compileOnSave.ts", + "unittests/tsserver/completions.ts", + "unittests/tsserver/configFileSearch.ts", + "unittests/tsserver/declarationFileMaps.ts", + "unittests/tsserver/documentRegistry.ts", + "unittests/tsserver/duplicatePackages.ts", "unittests/tsserver/events/largeFileReferenced.ts", "unittests/tsserver/events/projectLoading.ts", "unittests/tsserver/events/projectUpdatedInBackground.ts", "unittests/tsserver/externalProjects.ts", + "unittests/tsserver/forceConsistentCasingInFileNames.ts", + "unittests/tsserver/formatSettings.ts", + "unittests/tsserver/getEditsForFileRename.ts", + "unittests/tsserver/importHelpers.ts", + "unittests/tsserver/inferredProjects.ts", + "unittests/tsserver/languageService.ts", + "unittests/tsserver/maxNodeModuleJsDepth.ts", + "unittests/tsserver/metadataInResponse.ts", + "unittests/tsserver/navTo.ts", + "unittests/tsserver/occurences.ts", + "unittests/tsserver/openFile.ts", "unittests/tsserver/projectErrors.ts", + "unittests/tsserver/projectReferences.ts", + "unittests/tsserver/refactors.ts", "unittests/tsserver/reload.ts", + "unittests/tsserver/rename.ts", "unittests/tsserver/resolutionCache.ts", "unittests/tsserver/session.ts", "unittests/tsserver/skipLibCheck.ts", "unittests/tsserver/symLinks.ts", + "unittests/tsserver/syntaxOperations.ts", "unittests/tsserver/textStorage.ts", "unittests/tsserver/telemetry.ts", + "unittests/tsserver/typeAquisition.ts", + "unittests/tsserver/typeReferenceDirectives.ts", "unittests/tsserver/typingsInstaller.ts", + "unittests/tsserver/untitledFiles.ts", "unittests/tsserver/versionCache.ts", "unittests/tsserver/watchEnvironment.ts" ] diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 7e8ba8f84bb..be7f6dca3c5 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("commandLineParsing:: parseCommandLine", () => { + describe("config:: commandLineParsing:: parseCommandLine", () => { function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine) { const parsed = parseCommandLine(commandLine); @@ -367,7 +367,7 @@ namespace ts { }); }); - describe("commandLineParsing:: parseBuildOptions", () => { + describe("config:: commandLineParsing:: parseBuildOptions", () => { function assertParseResult(commandLine: string[], expectedParsedBuildCommand: ParsedBuildCommand) { const parsed = parseBuildCommand(commandLine); const parsedBuildOptions = JSON.stringify(parsed.buildOptions); diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index 57c899eb5a8..0e7cd0821c4 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -208,7 +208,7 @@ namespace ts { } } - describe("configurationExtension", () => { + describe("config:: configurationExtension", () => { forEach<[string, string, fakes.ParseConfigHost], void>([ ["under a case insensitive host", caseInsensitiveBasePath, caseInsensitiveHost], ["under a case sensitive host", caseSensitiveBasePath, caseSensitiveHost] diff --git a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts index 7b8af54f930..4a3a42ce216 100644 --- a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts +++ b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts @@ -1,5 +1,5 @@ namespace ts { - describe("convertCompilerOptionsFromJson", () => { + describe("config:: convertCompilerOptionsFromJson", () => { const formatDiagnosticHost: FormatDiagnosticsHost = { getCurrentDirectory: () => "/apath/", getCanonicalFileName: createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ true), diff --git a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts index b46d37f0428..0998b0b0d7a 100644 --- a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts +++ b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts @@ -1,6 +1,6 @@ namespace ts { interface ExpectedResult { typeAcquisition: TypeAcquisition; errors: Diagnostic[]; } - describe("convertTypeAcquisitionFromJson", () => { + describe("config:: convertTypeAcquisitionFromJson", () => { function assertTypeAcquisition(json: any, configFileName: string, expectedResult: ExpectedResult) { assertTypeAcquisitionWithJson(json, configFileName, expectedResult); assertTypeAcquisitionWithJsonNode(json, configFileName, expectedResult); diff --git a/src/testRunner/unittests/config/initializeTSConfig.ts b/src/testRunner/unittests/config/initializeTSConfig.ts index 679eecf71b1..09d80c7f5c2 100644 --- a/src/testRunner/unittests/config/initializeTSConfig.ts +++ b/src/testRunner/unittests/config/initializeTSConfig.ts @@ -1,5 +1,5 @@ namespace ts { - describe("initTSConfig", () => { + describe("config:: initTSConfig", () => { function initTSConfigCorrectly(name: string, commandLinesArgs: string[]) { describe(name, () => { const commandLine = parseCommandLine(commandLinesArgs); @@ -30,4 +30,4 @@ namespace ts { initTSConfigCorrectly("Initialized TSConfig with advanced options", ["--init", "--declaration", "--declarationDir", "lib", "--skipLibCheck", "--noErrorTruncation"]); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/config/matchFiles.ts b/src/testRunner/unittests/config/matchFiles.ts index 5ece71245bb..9155cb26a1c 100644 --- a/src/testRunner/unittests/config/matchFiles.ts +++ b/src/testRunner/unittests/config/matchFiles.ts @@ -143,7 +143,7 @@ namespace ts { return createFileDiagnostic(file, start, length, diagnosticMessage, arg0); } - describe("matchFiles", () => { + describe("config:: matchFiles", () => { it("with defaults", () => { const json = {}; const expected: ParsedCommandLine = { diff --git a/src/testRunner/unittests/config/projectReferences.ts b/src/testRunner/unittests/config/projectReferences.ts index f67faa4609b..be8e0be6206 100644 --- a/src/testRunner/unittests/config/projectReferences.ts +++ b/src/testRunner/unittests/config/projectReferences.ts @@ -96,7 +96,7 @@ namespace ts { checkResult(prog, host); } - describe("project-references meta check", () => { + describe("config:: project-references meta check", () => { it("default setup was created correctly", () => { const spec: TestSpecification = { "/primary": { @@ -118,7 +118,7 @@ namespace ts { /** * Validate that we enforce the basic settings constraints for referenced projects */ - describe("project-references constraint checking for settings", () => { + describe("config:: project-references constraint checking for settings", () => { it("errors when declaration = false", () => { const spec: TestSpecification = { "/primary": { @@ -248,7 +248,7 @@ namespace ts { /** * Path mapping behavior */ - describe("project-references path mapping", () => { + describe("config:: project-references path mapping", () => { it("redirects to the output .d.ts file", () => { const spec: TestSpecification = { "/alpha": { @@ -268,7 +268,7 @@ namespace ts { }); }); - describe("project-references nice-behavior", () => { + describe("config:: project-references nice-behavior", () => { it("issues a nice error when the input file is missing", () => { const spec: TestSpecification = { "/alpha": { @@ -289,7 +289,7 @@ namespace ts { /** * 'composite' behavior */ - describe("project-references behavior changes under composite: true", () => { + describe("config:: project-references behavior changes under composite: true", () => { it("doesn't infer the rootDir from source paths", () => { const spec: TestSpecification = { "/alpha": { @@ -308,7 +308,7 @@ namespace ts { }); }); - describe("project-references errors when a file in a composite project occurs outside the root", () => { + describe("config:: project-references errors when a file in a composite project occurs outside the root", () => { it("Errors when a file is outside the rootdir", () => { const spec: TestSpecification = { "/alpha": { diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index 4040e6563a8..f86b37970f5 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -1,5 +1,5 @@ namespace ts { - describe("showConfig", () => { + describe("config:: showConfig", () => { function showTSConfigCorrectly(name: string, commandLinesArgs: string[], configJson?: object) { describe(name, () => { const outputFileName = `showConfig/${name.replace(/[^a-z0-9\-./ ]/ig, "")}/tsconfig.json`; diff --git a/src/testRunner/unittests/config/tsconfigParsing.ts b/src/testRunner/unittests/config/tsconfigParsing.ts index 909af429d6e..cc617a0d151 100644 --- a/src/testRunner/unittests/config/tsconfigParsing.ts +++ b/src/testRunner/unittests/config/tsconfigParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("tsconfigParsing:: parseConfigFileTextToJson", () => { + describe("config:: tsconfigParsing:: parseConfigFileTextToJson", () => { function assertParseResult(jsonText: string, expectedConfigObject: { config?: any; error?: Diagnostic[] }) { const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); assert.equal(JSON.stringify(parsed), JSON.stringify(expectedConfigObject)); diff --git a/src/testRunner/unittests/evaluation/asyncArrow.ts b/src/testRunner/unittests/evaluation/asyncArrow.ts index 994fe8a84be..01959ca150f 100644 --- a/src/testRunner/unittests/evaluation/asyncArrow.ts +++ b/src/testRunner/unittests/evaluation/asyncArrow.ts @@ -1,4 +1,4 @@ -describe("asyncArrowEvaluation", () => { +describe("evaluation:: asyncArrowEvaluation", () => { // https://github.com/Microsoft/TypeScript/issues/24722 it("this capture (es5)", async () => { const result = evaluator.evaluateTypeScript(` @@ -15,4 +15,4 @@ describe("asyncArrowEvaluation", () => { await result.main(); assert.instanceOf(result.output[0].a(), result.A); }); -}); \ No newline at end of file +}); diff --git a/src/testRunner/unittests/evaluation/asyncGenerator.ts b/src/testRunner/unittests/evaluation/asyncGenerator.ts index 9963ea921fa..cb630d28724 100644 --- a/src/testRunner/unittests/evaluation/asyncGenerator.ts +++ b/src/testRunner/unittests/evaluation/asyncGenerator.ts @@ -1,4 +1,4 @@ -describe("asyncGeneratorEvaluation", () => { +describe("evaluation:: asyncGeneratorEvaluation", () => { it("return (es5)", async () => { const result = evaluator.evaluateTypeScript(` async function * g() { @@ -27,4 +27,4 @@ describe("asyncGeneratorEvaluation", () => { { value: 0, done: true } ]); }); -}); \ No newline at end of file +}); diff --git a/src/testRunner/unittests/evaluation/forAwaitOf.ts b/src/testRunner/unittests/evaluation/forAwaitOf.ts index 20ab5eed0cc..7e7ee41e2f1 100644 --- a/src/testRunner/unittests/evaluation/forAwaitOf.ts +++ b/src/testRunner/unittests/evaluation/forAwaitOf.ts @@ -1,4 +1,4 @@ -describe("forAwaitOfEvaluation", () => { +describe("evaluation:: forAwaitOfEvaluation", () => { it("sync (es5)", async () => { const result = evaluator.evaluateTypeScript(` let i = 0; diff --git a/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts b/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts index 37f829d67a7..1d7e12d9825 100644 --- a/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts +++ b/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts @@ -1,5 +1,5 @@ namespace ts { - describe("cancellableLanguageServiceOperations", () => { + describe("services:: cancellableLanguageServiceOperations", () => { const file = ` function foo(): void; function foo(x: T): T; diff --git a/src/testRunner/unittests/services/colorization.ts b/src/testRunner/unittests/services/colorization.ts index e3295e6fee8..54ea98dd563 100644 --- a/src/testRunner/unittests/services/colorization.ts +++ b/src/testRunner/unittests/services/colorization.ts @@ -6,7 +6,7 @@ interface ClassificationEntry { position?: number; } -describe("Colorization", () => { +describe("services:: Colorization", () => { // Use the shim adapter to ensure test coverage of the shim layer for the classifier const languageServiceAdapter = new Harness.LanguageService.ShimLanguageServiceAdapter(/*preprocessToResolve*/ false); const classifier = languageServiceAdapter.getClassifier(); diff --git a/src/testRunner/unittests/services/convertToAsyncFunction.ts b/src/testRunner/unittests/services/convertToAsyncFunction.ts index 21c6a29f8e4..e8d857f2ee0 100644 --- a/src/testRunner/unittests/services/convertToAsyncFunction.ts +++ b/src/testRunner/unittests/services/convertToAsyncFunction.ts @@ -343,7 +343,7 @@ interface Array {}` } } - describe("convertToAsyncFunctions", () => { + describe("services:: convertToAsyncFunctions", () => { _testConvertToAsyncFunction("convertToAsyncFunction_basic", ` function [#|f|](): Promise{ return fetch('https://typescriptlang.org').then(result => { console.log(result) }); diff --git a/src/testRunner/unittests/services/documentRegistry.ts b/src/testRunner/unittests/services/documentRegistry.ts index a3dad56f42b..96f2aaff76b 100644 --- a/src/testRunner/unittests/services/documentRegistry.ts +++ b/src/testRunner/unittests/services/documentRegistry.ts @@ -1,4 +1,4 @@ -describe("DocumentRegistry", () => { +describe("services:: DocumentRegistry", () => { it("documents are shared between projects", () => { const documentRegistry = ts.createDocumentRegistry(); const defaultCompilerOptions = ts.getDefaultCompilerOptions(); diff --git a/src/testRunner/unittests/services/extract/constants.ts b/src/testRunner/unittests/services/extract/constants.ts index e0ef305812c..1ca5a719a82 100644 --- a/src/testRunner/unittests/services/extract/constants.ts +++ b/src/testRunner/unittests/services/extract/constants.ts @@ -1,5 +1,5 @@ namespace ts { - describe("extractConstants", () => { + describe("services:: extract:: extractConstants", () => { testExtractConstant("extractConstant_TopLevel", `let x = [#|1|];`); diff --git a/src/testRunner/unittests/services/extract/functions.ts b/src/testRunner/unittests/services/extract/functions.ts index 1f90e1cc600..21c5e8e9001 100644 --- a/src/testRunner/unittests/services/extract/functions.ts +++ b/src/testRunner/unittests/services/extract/functions.ts @@ -1,5 +1,5 @@ namespace ts { - describe("extractFunctions", () => { + describe("services:: extract:: extractFunctions", () => { testExtractFunction("extractFunction1", `namespace A { let x = 1; diff --git a/src/testRunner/unittests/services/extract/ranges.ts b/src/testRunner/unittests/services/extract/ranges.ts index 9cd76dd49e9..dc62618e0c6 100644 --- a/src/testRunner/unittests/services/extract/ranges.ts +++ b/src/testRunner/unittests/services/extract/ranges.ts @@ -42,7 +42,7 @@ namespace ts { } } - describe("extractRanges", () => { + describe("services:: extract:: extractRanges", () => { it("get extract range from selection", () => { testExtractRange(` [#| @@ -418,4 +418,4 @@ switch (x) { testExtractRangeFailed("extract-method-not-for-token-expression-statement", `[#|a|]`, [refactor.extractSymbol.Messages.cannotExtractIdentifier.message]); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/services/extract/symbolWalker.ts b/src/testRunner/unittests/services/extract/symbolWalker.ts index a027f0f2ce7..9d323a7544a 100644 --- a/src/testRunner/unittests/services/extract/symbolWalker.ts +++ b/src/testRunner/unittests/services/extract/symbolWalker.ts @@ -1,5 +1,5 @@ namespace ts { - describe("Symbol Walker", () => { + describe("services:: extract:: Symbol Walker", () => { function test(description: string, source: string, verifier: (file: SourceFile, checker: TypeChecker) => void) { it(description, () => { const result = Harness.Compiler.compileFiles([{ diff --git a/src/testRunner/unittests/services/hostNewLineSupport.ts b/src/testRunner/unittests/services/hostNewLineSupport.ts index abd79210086..2f00c7b08e5 100644 --- a/src/testRunner/unittests/services/hostNewLineSupport.ts +++ b/src/testRunner/unittests/services/hostNewLineSupport.ts @@ -1,5 +1,5 @@ namespace ts { - describe("hostNewLineSupport", () => { + describe("services:: hostNewLineSupport", () => { function testLSWithFiles(settings: CompilerOptions, files: Harness.Compiler.TestFile[]) { function snapFor(path: string): IScriptSnapshot | undefined { if (path === "lib.d.ts") { @@ -46,4 +46,4 @@ namespace ts { `); }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/services/languageService.ts b/src/testRunner/unittests/services/languageService.ts index ce8fa93d1f9..332d59ca68a 100644 --- a/src/testRunner/unittests/services/languageService.ts +++ b/src/testRunner/unittests/services/languageService.ts @@ -1,5 +1,5 @@ namespace ts { - describe("languageService", () => { + describe("services:: languageService", () => { const files: {[index: string]: string} = { "foo.ts": `import Vue from "./vue"; import Component from "./vue-class-component"; @@ -43,4 +43,4 @@ export function Component(x: Config): any;` expect(definitions).to.exist; // tslint:disable-line no-unused-expression }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/services/organizeImports.ts b/src/testRunner/unittests/services/organizeImports.ts index 355292c6d89..a45c7548394 100644 --- a/src/testRunner/unittests/services/organizeImports.ts +++ b/src/testRunner/unittests/services/organizeImports.ts @@ -1,5 +1,5 @@ namespace ts { - describe("Organize imports", () => { + describe("services:: Organize imports", () => { describe("Sort imports", () => { it("Sort - non-relative vs non-relative", () => { assertSortsBefore( diff --git a/src/testRunner/unittests/services/patternMatcher.ts b/src/testRunner/unittests/services/patternMatcher.ts index 5e35d2020db..304a9225e0d 100644 --- a/src/testRunner/unittests/services/patternMatcher.ts +++ b/src/testRunner/unittests/services/patternMatcher.ts @@ -1,4 +1,4 @@ -describe("PatternMatcher", () => { +describe("services:: PatternMatcher", () => { describe("BreakIntoCharacterSpans", () => { it("EmptyIdentifier", () => { verifyBreakIntoCharacterSpans(""); diff --git a/src/testRunner/unittests/services/preProcessFile.ts b/src/testRunner/unittests/services/preProcessFile.ts index a89b6337c84..caf412d6403 100644 --- a/src/testRunner/unittests/services/preProcessFile.ts +++ b/src/testRunner/unittests/services/preProcessFile.ts @@ -1,4 +1,4 @@ -describe("PreProcessFile:", () => { +describe("services:: PreProcessFile:", () => { function test(sourceText: string, readImportFile: boolean, detectJavaScriptImports: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { const resultPreProcess = ts.preProcessFile(sourceText, readImportFile, detectJavaScriptImports); diff --git a/src/testRunner/unittests/services/textChanges.ts b/src/testRunner/unittests/services/textChanges.ts index 164073207b3..fa5e723419a 100644 --- a/src/testRunner/unittests/services/textChanges.ts +++ b/src/testRunner/unittests/services/textChanges.ts @@ -2,7 +2,7 @@ // tslint:disable trim-trailing-whitespace namespace ts { - describe("textChanges", () => { + describe("services:: textChanges", () => { function findChild(name: string, n: Node) { return find(n)!; @@ -753,4 +753,4 @@ let x = foo }); } }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/transpile.ts b/src/testRunner/unittests/services/transpile.ts similarity index 97% rename from src/testRunner/unittests/transpile.ts rename to src/testRunner/unittests/services/transpile.ts index b545b76c3db..533f07884f4 100644 --- a/src/testRunner/unittests/transpile.ts +++ b/src/testRunner/unittests/services/transpile.ts @@ -1,5 +1,5 @@ namespace ts { - describe("Transpile", () => { + describe("services:: Transpile", () => { interface TranspileTestSettings { options?: TranspileOptions; diff --git a/src/testRunner/unittests/tscWatch/emit.ts b/src/testRunner/unittests/tscWatch/emit.ts index e0e9abe516c..2f7a70bd2c6 100644 --- a/src/testRunner/unittests/tscWatch/emit.ts +++ b/src/testRunner/unittests/tscWatch/emit.ts @@ -38,7 +38,7 @@ namespace ts.tscWatch { checkOutputDoesNotContain(host, expectedNonAffectedFiles); } - describe("tsc-watch emit with outFile or out setting", () => { + describe("tsc-watch:: emit with outFile or out setting", () => { function createWatchForOut(out?: string, outFile?: string) { const host = createWatchedSystem([]); const config: FileOrFolderEmit = { @@ -161,7 +161,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch emit for configured projects", () => { + describe("tsc-watch:: emit for configured projects", () => { const file1Consumer1Path = "/a/b/file1Consumer1.ts"; const moduleFile1Path = "/a/b/moduleFile1.ts"; const configFilePath = "/a/b/tsconfig.json"; @@ -495,7 +495,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch emit file content", () => { + describe("tsc-watch:: emit file content", () => { interface EmittedFile extends File { shouldBeWritten: boolean; } @@ -676,7 +676,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch with when module emit is specified as node", () => { + describe("tsc-watch:: emit with when module emit is specified as node", () => { it("when instead of filechanged recursive directory watcher is invoked", () => { const configFile: File = { path: "/a/rootFolder/project/tsconfig.json", diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index f51ecc4e64d..46dc94e20e8 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -12,6 +12,15 @@ namespace ts.tscWatch { export import checkOutputContains = TestFSWithWatch.checkOutputContains; export import checkOutputDoesNotContain = TestFSWithWatch.checkOutputDoesNotContain; + export const commonFile1: File = { + path: "/a/b/commonFile1.ts", + content: "let x = 1" + }; + export const commonFile2: File = { + path: "/a/b/commonFile2.ts", + content: "let y = 1" + }; + export function checkProgramActualFiles(program: Program, expectedFiles: ReadonlyArray) { checkArray(`Program actual files`, program.getSourceFiles().map(file => file.fileName), expectedFiles); } diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index 759c80e93a6..e7b546edcd9 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -1,5 +1,5 @@ namespace ts.tscWatch { - describe("resolutionCache:: tsc-watch module resolution caching", () => { + describe("tsc-watch:: resolutionCache:: tsc-watch module resolution caching", () => { it("works", () => { const root = { path: "/a/d/f0.ts", @@ -404,7 +404,7 @@ declare module "fs" { }); }); - describe("resolutionCache:: tsc-watch with modules linked to sibling folder", () => { + describe("tsc-watch:: resolutionCache:: tsc-watch with modules linked to sibling folder", () => { const projectRoot = "/user/username/projects/project"; const mainPackageRoot = `${projectRoot}/main`; const linkedPackageRoot = `${projectRoot}/linked-package`; diff --git a/src/testRunner/unittests/tscWatch/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts index 60072e24730..334b353f1d5 100644 --- a/src/testRunner/unittests/tscWatch/watchApi.ts +++ b/src/testRunner/unittests/tscWatch/watchApi.ts @@ -1,5 +1,5 @@ namespace ts.tscWatch { - describe("watchAPI:: tsc-watch with custom module resolution", () => { + describe("tsc-watch:: watchAPI:: tsc-watch with custom module resolution", () => { const projectRoot = "/user/username/projects/project"; const configFileJson: any = { compilerOptions: { module: "commonjs", resolveJsonModule: true }, diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index 646fb59ef09..3d09e2a38f6 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -1,6 +1,6 @@ namespace ts.tscWatch { import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; - describe("watchEnvironment:: tsc-watch with different polling/non polling options", () => { + describe("tsc-watch:: watchEnvironment:: tsc-watch with different polling/non polling options", () => { it("watchFile using dynamic priority polling", () => { const projectFolder = "/a/username/project"; const file1: File = { diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index 29726b12424..4d71599a1b5 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -25,15 +25,6 @@ namespace ts.tscWatch { } describe("tsc-watch program updates", () => { - const commonFile1: File = { - path: "/a/b/commonFile1.ts", - content: "let x = 1" - }; - const commonFile2: File = { - path: "/a/b/commonFile2.ts", - content: "let y = 1" - }; - it("create watch without config file", () => { const appFile: File = { path: "/a/b/c/app.ts", diff --git a/src/testRunner/unittests/tsserver/cancellationToken.ts b/src/testRunner/unittests/tsserver/cancellationToken.ts new file mode 100644 index 00000000000..5d9cd5527e6 --- /dev/null +++ b/src/testRunner/unittests/tsserver/cancellationToken.ts @@ -0,0 +1,271 @@ +namespace ts.projectSystem { + describe("tsserver:: cancellationToken", () => { + // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test + let oldPrepare: AnyFunction; + before(() => { + oldPrepare = (Error as any).prepareStackTrace; + delete (Error as any).prepareStackTrace; + }); + + after(() => { + (Error as any).prepareStackTrace = oldPrepare; + }); + + it("is attached to request", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let xyz = 1;" + }; + const host = createServerHost([f1]); + let expectedRequestId: number; + const cancellationToken: server.ServerCancellationToken = { + isCancellationRequested: () => false, + setRequest: requestId => { + if (expectedRequestId === undefined) { + assert.isTrue(false, "unexpected call"); + } + assert.equal(requestId, expectedRequestId); + }, + resetRequest: noop + }; + + const session = createSession(host, { cancellationToken }); + + expectedRequestId = session.getNextSeq(); + session.executeCommandSeq({ + command: "open", + arguments: { file: f1.path } + }); + + expectedRequestId = session.getNextSeq(); + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + + expectedRequestId = session.getNextSeq(); + session.executeCommandSeq({ + command: "occurrences", + arguments: { file: f1.path, line: 1, offset: 6 } + }); + + expectedRequestId = 2; + host.runQueuedImmediateCallbacks(); + expectedRequestId = 2; + host.runQueuedImmediateCallbacks(); + }); + + it("Geterr is cancellable", () => { + const f1 = { + path: "/a/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: {} + }) + }; + + const cancellationToken = new TestServerCancellationToken(); + const host = createServerHost([f1, config]); + const session = createSession(host, { + canUseEvents: true, + eventHandler: noop, + cancellationToken + }); + { + session.executeCommandSeq({ + command: "open", + arguments: { file: f1.path } + }); + // send geterr for missing file + session.executeCommandSeq({ + command: "geterr", + arguments: { files: ["/a/missing"] } + }); + // no files - expect 'completed' event + assert.equal(host.getOutput().length, 1, "expect 1 message"); + verifyRequestCompleted(session.getSeq(), 0); + } + { + const getErrId = session.getNextSeq(); + // send geterr for a valid file + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + + assert.equal(host.getOutput().length, 0, "expect 0 messages"); + + // run new request + session.executeCommandSeq({ + command: "projectInfo", + arguments: { file: f1.path } + }); + session.clearMessages(); + + // cancel previously issued Geterr + cancellationToken.setRequestToCancel(getErrId); + host.runQueuedTimeoutCallbacks(); + + assert.equal(host.getOutput().length, 1, "expect 1 message"); + verifyRequestCompleted(getErrId, 0); + + cancellationToken.resetToken(); + } + { + const getErrId = session.getNextSeq(); + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + assert.equal(host.getOutput().length, 0, "expect 0 messages"); + + // run first step + host.runQueuedTimeoutCallbacks(); + assert.equal(host.getOutput().length, 1, "expect 1 message"); + const e1 = getMessage(0); + assert.equal(e1.event, "syntaxDiag"); + session.clearMessages(); + + cancellationToken.setRequestToCancel(getErrId); + host.runQueuedImmediateCallbacks(); + assert.equal(host.getOutput().length, 1, "expect 1 message"); + verifyRequestCompleted(getErrId, 0); + + cancellationToken.resetToken(); + } + { + const getErrId = session.getNextSeq(); + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + assert.equal(host.getOutput().length, 0, "expect 0 messages"); + + // run first step + host.runQueuedTimeoutCallbacks(); + assert.equal(host.getOutput().length, 1, "expect 1 message"); + const e1 = getMessage(0); + assert.equal(e1.event, "syntaxDiag"); + session.clearMessages(); + + // the semanticDiag message + host.runQueuedImmediateCallbacks(); + assert.equal(host.getOutput().length, 1); + const e2 = getMessage(0); + assert.equal(e2.event, "semanticDiag"); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + assert.equal(host.getOutput().length, 2); + const e3 = getMessage(0); + assert.equal(e3.event, "suggestionDiag"); + verifyRequestCompleted(getErrId, 1); + + cancellationToken.resetToken(); + } + { + const getErr1 = session.getNextSeq(); + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + assert.equal(host.getOutput().length, 0, "expect 0 messages"); + // run first step + host.runQueuedTimeoutCallbacks(); + assert.equal(host.getOutput().length, 1, "expect 1 message"); + const e1 = getMessage(0); + assert.equal(e1.event, "syntaxDiag"); + session.clearMessages(); + + session.executeCommandSeq({ + command: "geterr", + arguments: { files: [f1.path] } + }); + // make sure that getErr1 is completed + verifyRequestCompleted(getErr1, 0); + } + + function verifyRequestCompleted(expectedSeq: number, n: number) { + const event = getMessage(n); + assert.equal(event.event, "requestCompleted"); + assert.equal(event.body.request_seq, expectedSeq, "expectedSeq"); + session.clearMessages(); + } + + function getMessage(n: number) { + return JSON.parse(server.extractMessage(host.getOutput()[n])); + } + }); + + it("Lower priority tasks are cancellable", () => { + const f1 = { + path: "/a/app.ts", + content: `{ let x = 1; } var foo = "foo"; var bar = "bar"; var fooBar = "fooBar";` + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: {} + }) + }; + const cancellationToken = new TestServerCancellationToken(/*cancelAfterRequest*/ 3); + const host = createServerHost([f1, config]); + const session = createSession(host, { + canUseEvents: true, + eventHandler: noop, + cancellationToken, + throttleWaitMilliseconds: 0 + }); + { + session.executeCommandSeq({ + command: "open", + arguments: { file: f1.path } + }); + + // send navbar request (normal priority) + session.executeCommandSeq({ + command: "navbar", + arguments: { file: f1.path } + }); + + // ensure the nav bar request can be canceled + verifyExecuteCommandSeqIsCancellable({ + command: "navbar", + arguments: { file: f1.path } + }); + + // send outlining spans request (normal priority) + session.executeCommandSeq({ + command: "outliningSpans", + arguments: { file: f1.path } + }); + + // ensure the outlining spans request can be canceled + verifyExecuteCommandSeqIsCancellable({ + command: "outliningSpans", + arguments: { file: f1.path } + }); + } + + function verifyExecuteCommandSeqIsCancellable(request: Partial) { + // Set the next request to be cancellable + // The cancellation token will cancel the request the third time + // isCancellationRequested() is called. + cancellationToken.setRequestToCancel(session.getNextSeq()); + let operationCanceledExceptionThrown = false; + + try { + session.executeCommandSeq(request); + } + catch (e) { + assert(e instanceof OperationCanceledException); + operationCanceledExceptionThrown = true; + } + assert(operationCanceledExceptionThrown, "Operation Canceled Exception not thrown for request: " + JSON.stringify(request)); + } + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/completions.ts b/src/testRunner/unittests/tsserver/completions.ts new file mode 100644 index 00000000000..ed020bae0ba --- /dev/null +++ b/src/testRunner/unittests/tsserver/completions.ts @@ -0,0 +1,122 @@ +namespace ts.projectSystem { + describe("tsserver:: completions", () => { + it("works", () => { + const aTs: File = { + path: "/a.ts", + content: "export const foo = 0;", + }; + const bTs: File = { + path: "/b.ts", + content: "foo", + }; + const tsconfig: File = { + path: "/tsconfig.json", + content: "{}", + }; + + const session = createSession(createServerHost([aTs, bTs, tsconfig])); + openFilesForSession([aTs, bTs], session); + + const requestLocation: protocol.FileLocationRequestArgs = { + file: bTs.path, + line: 1, + offset: 3, + }; + + const response = executeSessionRequest(session, protocol.CommandTypes.CompletionInfo, { + ...requestLocation, + includeExternalModuleExports: true, + prefix: "foo", + }); + const entry: protocol.CompletionEntry = { + hasAction: true, + insertText: undefined, + isRecommended: undefined, + kind: ScriptElementKind.constElement, + kindModifiers: ScriptElementKindModifier.exportedModifier, + name: "foo", + replacementSpan: undefined, + sortText: "0", + source: "/a", + }; + assert.deepEqual(response, { + isGlobalCompletion: true, + isMemberCompletion: false, + isNewIdentifierLocation: false, + entries: [entry], + }); + + const detailsRequestArgs: protocol.CompletionDetailsRequestArgs = { + ...requestLocation, + entryNames: [{ name: "foo", source: "/a" }], + }; + + const detailsResponse = executeSessionRequest(session, protocol.CommandTypes.CompletionDetails, detailsRequestArgs); + const detailsCommon: protocol.CompletionEntryDetails & CompletionEntryDetails = { + displayParts: [ + keywordPart(SyntaxKind.ConstKeyword), + spacePart(), + displayPart("foo", SymbolDisplayPartKind.localName), + punctuationPart(SyntaxKind.ColonToken), + spacePart(), + displayPart("0", SymbolDisplayPartKind.stringLiteral), + ], + documentation: emptyArray, + kind: ScriptElementKind.constElement, + kindModifiers: ScriptElementKindModifier.exportedModifier, + name: "foo", + source: [{ text: "./a", kind: "text" }], + tags: undefined, + }; + assert.deepEqual | undefined>(detailsResponse, [ + { + codeActions: [ + { + description: `Import 'foo' from module "./a"`, + changes: [ + { + fileName: "/b.ts", + textChanges: [ + { + start: { line: 1, offset: 1 }, + end: { line: 1, offset: 1 }, + newText: 'import { foo } from "./a";\n\n', + }, + ], + }, + ], + commands: undefined, + }, + ], + ...detailsCommon, + }, + ]); + + interface CompletionDetailsFullRequest extends protocol.FileLocationRequest { + readonly command: protocol.CommandTypes.CompletionDetailsFull; + readonly arguments: protocol.CompletionDetailsRequestArgs; + } + interface CompletionDetailsFullResponse extends protocol.Response { + readonly body?: ReadonlyArray; + } + const detailsFullResponse = executeSessionRequest(session, protocol.CommandTypes.CompletionDetailsFull, detailsRequestArgs); + assert.deepEqual | undefined>(detailsFullResponse, [ + { + codeActions: [ + { + description: `Import 'foo' from module "./a"`, + changes: [ + { + fileName: "/b.ts", + textChanges: [createTextChange(createTextSpan(0, 0), 'import { foo } from "./a";\n\n')], + }, + ], + commands: undefined, + } + ], + ...detailsCommon, + } + ]); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/configFileSearch.ts b/src/testRunner/unittests/tsserver/configFileSearch.ts new file mode 100644 index 00000000000..4d0b0c0efdd --- /dev/null +++ b/src/testRunner/unittests/tsserver/configFileSearch.ts @@ -0,0 +1,174 @@ +namespace ts.projectSystem { + describe("tsserver:: searching for config file", () => { + it("should stop at projectRootPath if given", () => { + const f1 = { + path: "/a/file1.ts", + content: "" + }; + const configFile = { + path: "/tsconfig.json", + content: "{}" + }; + const host = createServerHost([f1, configFile]); + const service = createProjectService(host); + service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, "/a"); + + checkNumberOfConfiguredProjects(service, 0); + checkNumberOfInferredProjects(service, 1); + + service.closeClientFile(f1.path); + service.openClientFile(f1.path); + checkNumberOfConfiguredProjects(service, 1); + checkNumberOfInferredProjects(service, 0); + }); + + it("should use projectRootPath when searching for inferred project again", () => { + const projectDir = "/a/b/projects/project"; + const configFileLocation = `${projectDir}/src`; + const f1 = { + path: `${configFileLocation}/file1.ts`, + content: "" + }; + const configFile = { + path: `${configFileLocation}/tsconfig.json`, + content: "{}" + }; + const configFile2 = { + path: "/a/b/projects/tsconfig.json", + content: "{}" + }; + const host = createServerHost([f1, libFile, configFile, configFile2]); + const service = createProjectService(host); + service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectDir); + checkNumberOfProjects(service, { configuredProjects: 1 }); + assert.isDefined(service.configuredProjects.get(configFile.path)); + checkWatchedFiles(host, [libFile.path, configFile.path]); + checkWatchedDirectories(host, [], /*recursive*/ false); + const typeRootLocations = getTypeRootsFromLocation(configFileLocation); + checkWatchedDirectories(host, typeRootLocations.concat(configFileLocation), /*recursive*/ true); + + // Delete config file - should create inferred project and not configured project + host.reloadFS([f1, libFile, configFile2]); + host.runQueuedTimeoutCallbacks(); + checkNumberOfProjects(service, { inferredProjects: 1 }); + checkWatchedFiles(host, [libFile.path, configFile.path, `${configFileLocation}/jsconfig.json`, `${projectDir}/tsconfig.json`, `${projectDir}/jsconfig.json`]); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, typeRootLocations, /*recursive*/ true); + }); + + it("should use projectRootPath when searching for inferred project again 2", () => { + const projectDir = "/a/b/projects/project"; + const configFileLocation = `${projectDir}/src`; + const f1 = { + path: `${configFileLocation}/file1.ts`, + content: "" + }; + const configFile = { + path: `${configFileLocation}/tsconfig.json`, + content: "{}" + }; + const configFile2 = { + path: "/a/b/projects/tsconfig.json", + content: "{}" + }; + const host = createServerHost([f1, libFile, configFile, configFile2]); + const service = createProjectService(host, { useSingleInferredProject: true }, { useInferredProjectPerProjectRoot: true }); + service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectDir); + checkNumberOfProjects(service, { configuredProjects: 1 }); + assert.isDefined(service.configuredProjects.get(configFile.path)); + checkWatchedFiles(host, [libFile.path, configFile.path]); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, getTypeRootsFromLocation(configFileLocation).concat(configFileLocation), /*recursive*/ true); + + // Delete config file - should create inferred project with project root path set + host.reloadFS([f1, libFile, configFile2]); + host.runQueuedTimeoutCallbacks(); + checkNumberOfProjects(service, { inferredProjects: 1 }); + assert.equal(service.inferredProjects[0].projectRootPath, projectDir); + checkWatchedFiles(host, [libFile.path, configFile.path, `${configFileLocation}/jsconfig.json`, `${projectDir}/tsconfig.json`, `${projectDir}/jsconfig.json`]); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, getTypeRootsFromLocation(projectDir), /*recursive*/ true); + }); + + describe("when the opened file is not from project root", () => { + const projectRoot = "/a/b/projects/project"; + const file: File = { + path: `${projectRoot}/src/index.ts`, + content: "let y = 10" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: "{}" + }; + const files = [file, libFile]; + const filesWithConfig = files.concat(tsconfig); + const dirOfFile = getDirectoryPath(file.path); + + function openClientFile(files: File[]) { + const host = createServerHost(files); + const projectService = createProjectService(host); + + projectService.openClientFile(file.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, "/a/b/projects/proj"); + return { host, projectService }; + } + + function verifyConfiguredProject(host: TestServerHost, projectService: TestProjectService, orphanInferredProject?: boolean) { + projectService.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: orphanInferredProject ? 1 : 0 }); + const project = Debug.assertDefined(projectService.configuredProjects.get(tsconfig.path)); + + if (orphanInferredProject) { + const inferredProject = projectService.inferredProjects[0]; + assert.isTrue(inferredProject.isOrphan()); + } + + checkProjectActualFiles(project, [file.path, libFile.path, tsconfig.path]); + checkWatchedFiles(host, [libFile.path, tsconfig.path]); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectories(host, (orphanInferredProject ? [projectRoot, `${dirOfFile}/node_modules/@types`] : [projectRoot]).concat(getTypeRootsFromLocation(projectRoot)), /*recursive*/ true); + } + + function verifyInferredProject(host: TestServerHost, projectService: TestProjectService) { + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + const project = projectService.inferredProjects[0]; + assert.isDefined(project); + + const filesToWatch = [libFile.path]; + forEachAncestorDirectory(dirOfFile, ancestor => { + filesToWatch.push(combinePaths(ancestor, "tsconfig.json")); + filesToWatch.push(combinePaths(ancestor, "jsconfig.json")); + }); + + checkProjectActualFiles(project, [file.path, libFile.path]); + checkWatchedFiles(host, filesToWatch); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectories(host, getTypeRootsFromLocation(dirOfFile), /*recursive*/ true); + } + + it("tsconfig for the file exists", () => { + const { host, projectService } = openClientFile(filesWithConfig); + verifyConfiguredProject(host, projectService); + + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyInferredProject(host, projectService); + + host.reloadFS(filesWithConfig); + host.runQueuedTimeoutCallbacks(); + verifyConfiguredProject(host, projectService, /*orphanInferredProject*/ true); + }); + + it("tsconfig for the file does not exist", () => { + const { host, projectService } = openClientFile(files); + verifyInferredProject(host, projectService); + + host.reloadFS(filesWithConfig); + host.runQueuedTimeoutCallbacks(); + verifyConfiguredProject(host, projectService, /*orphanInferredProject*/ true); + + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyInferredProject(host, projectService); + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/declarationFileMaps.ts b/src/testRunner/unittests/tsserver/declarationFileMaps.ts new file mode 100644 index 00000000000..334af82ca48 --- /dev/null +++ b/src/testRunner/unittests/tsserver/declarationFileMaps.ts @@ -0,0 +1,566 @@ +namespace ts.projectSystem { + function protocolFileSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): protocol.FileSpan { + return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring, options) }; + } + + function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan { + return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) }; + } + + function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { + return documentSpanFromSubstring(file, substring, options); + } + + function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { + return { + ...protocolFileSpanFromSubstring(file, text, options), + isDefinition, + isWriteAccess: isDefinition, + lineText, + }; + } + + function makeReferenceEntry(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): ReferenceEntry { + return { + ...documentSpanFromSubstring(file, text, options), + isDefinition, + isWriteAccess: isDefinition, + isInString: undefined, + }; + } + + function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray): void { + openFilesForSession([file], session); + const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false)); + const program = project.getCurrentProgram()!; + const output = getFileEmitOutput(program, Debug.assertDefined(program.getSourceFile(file.path)), /*emitOnlyDtsFiles*/ true); + closeFilesForSession([file], session); + + Debug.assert(!output.emitSkipped); + assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false }))); + } + + describe("tsserver:: with declaration file maps:: project references", () => { + const aTs: File = { + path: "/a/a.ts", + content: "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};", + }; + const compilerOptions: CompilerOptions = { + outDir: "bin", + declaration: true, + declarationMap: true, + composite: true, + }; + const configContent = JSON.stringify({ compilerOptions }); + const aTsconfig: File = { path: "/a/tsconfig.json", content: configContent }; + + const aDtsMapContent: RawSourceMap = { + version: 3, + file: "a.d.ts", + sourceRoot: "", + sources: ["../a.ts"], + names: [], + mappings: "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" + }; + const aDtsMap: File = { + path: "/a/bin/a.d.ts.map", + content: JSON.stringify(aDtsMapContent), + }; + const aDts: File = { + path: "/a/bin/a.d.ts", + // Need to mangle the sourceMappingURL part or it breaks the build + content: `export declare function fnA(): void;\nexport interface IfaceA {\n}\nexport declare const instanceA: IfaceA;\n//# source${""}MappingURL=a.d.ts.map`, + }; + + const bTs: File = { + path: "/b/b.ts", + content: "export function fnB() {}", + }; + const bTsconfig: File = { path: "/b/tsconfig.json", content: configContent }; + + const bDtsMapContent: RawSourceMap = { + version: 3, + file: "b.d.ts", + sourceRoot: "", + sources: ["../b.ts"], + names: [], + mappings: "AAAA,wBAAgB,GAAG,SAAK", + }; + const bDtsMap: File = { + path: "/b/bin/b.d.ts.map", + content: JSON.stringify(bDtsMapContent), + }; + const bDts: File = { + // Need to mangle the sourceMappingURL part or it breaks the build + path: "/b/bin/b.d.ts", + content: `export declare function fnB(): void;\n//# source${""}MappingURL=b.d.ts.map`, + }; + + const dummyFile: File = { + path: "/dummy/dummy.ts", + content: "let a = 10;" + }; + + const userTs: File = { + path: "/user/user.ts", + content: 'import * as a from "../a/bin/a";\nimport * as b from "../b/bin/b";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }', + }; + + const userTsForConfigProject: File = { + path: "/user/user.ts", + content: 'import * as a from "../a/a";\nimport * as b from "../b/b";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }', + }; + + const userTsconfig: File = { + path: "/user/tsconfig.json", + content: JSON.stringify({ + file: ["user.ts"], + references: [{ path: "../a" }, { path: "../b" }] + }) + }; + + function makeSampleProjects(addUserTsConfig?: boolean) { + const host = createServerHost([aTs, aTsconfig, aDtsMap, aDts, bTsconfig, bTs, bDtsMap, bDts, ...(addUserTsConfig ? [userTsForConfigProject, userTsconfig] : [userTs]), dummyFile]); + const session = createSession(host); + + checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); + checkDeclarationFiles(bTs, session, [bDtsMap, bDts]); + + // Testing what happens if we delete the original sources. + host.deleteFile(bTs.path); + + openFilesForSession([userTs], session); + const service = session.getProjectService(); + checkNumberOfProjects(service, addUserTsConfig ? { configuredProjects: 1 } : { inferredProjects: 1 }); + return session; + } + + function verifyInferredProjectUnchanged(session: TestSession) { + checkProjectActualFiles(session.getProjectService().inferredProjects[0], [userTs.path, aDts.path, bDts.path]); + } + + function verifyDummyProject(session: TestSession) { + checkProjectActualFiles(session.getProjectService().inferredProjects[0], [dummyFile.path]); + } + + function verifyOnlyOrphanInferredProject(session: TestSession) { + openFilesForSession([dummyFile], session); + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); + verifyDummyProject(session); + } + + function verifySingleInferredProject(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); + verifyInferredProjectUnchanged(session); + + // Close user file should close all the projects after opening dummy file + closeFilesForSession([userTs], session); + verifyOnlyOrphanInferredProject(session); + } + + function verifyATsConfigProject(session: TestSession) { + checkProjectActualFiles(session.getProjectService().configuredProjects.get(aTsconfig.path)!, [aTs.path, aTsconfig.path]); + } + + function verifyATsConfigOriginalProject(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyInferredProjectUnchanged(session); + verifyATsConfigProject(session); + // Close user file should close all the projects + closeFilesForSession([userTs], session); + verifyOnlyOrphanInferredProject(session); + } + + function verifyATsConfigWhenOpened(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyInferredProjectUnchanged(session); + verifyATsConfigProject(session); + + closeFilesForSession([userTs], session); + openFilesForSession([dummyFile], session); + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyDummyProject(session); + verifyATsConfigProject(session); // ATsConfig should still be alive + } + + function verifyUserTsConfigProject(session: TestSession) { + checkProjectActualFiles(session.getProjectService().configuredProjects.get(userTsconfig.path)!, [userTs.path, aDts.path, userTsconfig.path]); + } + + it("goToDefinition", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.Definition, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); + verifySingleInferredProject(session); + }); + + it("getDefinitionAndBoundSpan", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, { + textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), + definitions: [protocolFileSpanFromSubstring(aTs, "fnA")], + }); + verifySingleInferredProject(session); + }); + + it("getDefinitionAndBoundSpan with file navigation", () => { + const session = makeSampleProjects(/*addUserTsConfig*/ true); + const response = executeSessionRequest(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, { + textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), + definitions: [protocolFileSpanFromSubstring(aTs, "fnA")], + }); + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); + verifyUserTsConfigProject(session); + + // Navigate to the definition + closeFilesForSession([userTs], session); + openFilesForSession([aTs], session); + + // UserTs configured project should be alive + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 2 }); + verifyUserTsConfigProject(session); + verifyATsConfigProject(session); + + closeFilesForSession([aTs], session); + verifyOnlyOrphanInferredProject(session); + }); + + it("goToType", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.TypeDefinition, protocolFileLocationFromSubstring(userTs, "instanceA")); + assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "IfaceA")]); + verifySingleInferredProject(session); + }); + + it("goToImplementation", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.Implementation, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); + verifySingleInferredProject(session); + }); + + it("goToDefinition -- target does not exist", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, CommandNames.Definition, protocolFileLocationFromSubstring(userTs, "fnB()")); + // bTs does not exist, so stick with bDts + assert.deepEqual(response, [protocolFileSpanFromSubstring(bDts, "fnB")]); + verifySingleInferredProject(session); + }); + + it("navigateTo", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, CommandNames.Navto, { file: userTs.path, searchValue: "fn" }); + assert.deepEqual | undefined>(response, [ + { + ...protocolFileSpanFromSubstring(bDts, "export declare function fnB(): void;"), + name: "fnB", + matchKind: "prefix", + isCaseSensitive: true, + kind: ScriptElementKind.functionElement, + kindModifiers: "export,declare", + }, + { + ...protocolFileSpanFromSubstring(userTs, "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), + name: "fnUser", + matchKind: "prefix", + isCaseSensitive: true, + kind: ScriptElementKind.functionElement, + kindModifiers: "export", + }, + { + ...protocolFileSpanFromSubstring(aTs, "export function fnA() {}"), + name: "fnA", + matchKind: "prefix", + isCaseSensitive: true, + kind: ScriptElementKind.functionElement, + kindModifiers: "export", + }, + ]); + + verifyATsConfigOriginalProject(session); + }); + + const referenceATs = (aTs: File): protocol.ReferencesResponseItem => makeReferenceItem(aTs, /*isDefinition*/ true, "fnA", "export function fnA() {}"); + const referencesUserTs = (userTs: File): ReadonlyArray => [ + makeReferenceItem(userTs, /*isDefinition*/ false, "fnA", "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), + ]; + + it("findAllReferences", () => { + const session = makeSampleProjects(); + + const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, { + refs: [...referencesUserTs(userTs), referenceATs(aTs)], + symbolName: "fnA", + symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnA()").offset, + symbolDisplayString: "function fnA(): void", + }); + + verifyATsConfigOriginalProject(session); + }); + + it("findAllReferences -- starting at definition", () => { + const session = makeSampleProjects(); + openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. + const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(aTs, "fnA")); + assert.deepEqual(response, { + refs: [referenceATs(aTs), ...referencesUserTs(userTs)], + symbolName: "fnA", + symbolStartOffset: protocolLocationFromSubstring(aTs.content, "fnA").offset, + symbolDisplayString: "function fnA(): void", + }); + verifyATsConfigWhenOpened(session); + }); + + interface ReferencesFullRequest extends protocol.FileLocationRequest { readonly command: protocol.CommandTypes.ReferencesFull; } + interface ReferencesFullResponse extends protocol.Response { readonly body: ReadonlyArray; } + + it("findAllReferencesFull", () => { + const session = makeSampleProjects(); + + const responseFull = executeSessionRequest(session, protocol.CommandTypes.ReferencesFull, protocolFileLocationFromSubstring(userTs, "fnA()")); + + assert.deepEqual>(responseFull, [ + { + definition: { + ...documentSpanFromSubstring(aTs, "fnA"), + kind: ScriptElementKind.functionElement, + name: "function fnA(): void", + containerKind: ScriptElementKind.unknown, + containerName: "", + displayParts: [ + keywordPart(SyntaxKind.FunctionKeyword), + spacePart(), + displayPart("fnA", SymbolDisplayPartKind.functionName), + punctuationPart(SyntaxKind.OpenParenToken), + punctuationPart(SyntaxKind.CloseParenToken), + punctuationPart(SyntaxKind.ColonToken), + spacePart(), + keywordPart(SyntaxKind.VoidKeyword), + ], + }, + references: [ + makeReferenceEntry(userTs, /*isDefinition*/ false, "fnA"), + makeReferenceEntry(aTs, /*isDefinition*/ true, "fnA"), + ], + }, + ]); + verifyATsConfigOriginalProject(session); + }); + + it("findAllReferencesFull definition is in mapped file", () => { + const aTs: File = { path: "/a/a.ts", content: `function f() {}` }; + const aTsconfig: File = { + path: "/a/tsconfig.json", + content: JSON.stringify({ compilerOptions: { declaration: true, declarationMap: true, outFile: "../bin/a.js" } }), + }; + const bTs: File = { path: "/b/b.ts", content: `f();` }; + const bTsconfig: File = { path: "/b/tsconfig.json", content: JSON.stringify({ references: [{ path: "../a" }] }) }; + const aDts: File = { path: "/bin/a.d.ts", content: `declare function f(): void;\n//# sourceMappingURL=a.d.ts.map` }; + const aDtsMap: File = { + path: "/bin/a.d.ts.map", + content: JSON.stringify({ version: 3, file: "a.d.ts", sourceRoot: "", sources: ["../a/a.ts"], names: [], mappings: "AAAA,iBAAS,CAAC,SAAK" }), + }; + + const session = createSession(createServerHost([aTs, aTsconfig, bTs, bTsconfig, aDts, aDtsMap])); + checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); + openFilesForSession([bTs], session); + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); + + const responseFull = executeSessionRequest(session, protocol.CommandTypes.ReferencesFull, protocolFileLocationFromSubstring(bTs, "f()")); + + assert.deepEqual>(responseFull, [ + { + definition: { + containerKind: ScriptElementKind.unknown, + containerName: "", + displayParts: [ + keywordPart(SyntaxKind.FunctionKeyword), + spacePart(), + displayPart("f", SymbolDisplayPartKind.functionName), + punctuationPart(SyntaxKind.OpenParenToken), + punctuationPart(SyntaxKind.CloseParenToken), + punctuationPart(SyntaxKind.ColonToken), + spacePart(), + keywordPart(SyntaxKind.VoidKeyword), + ], + fileName: aTs.path, + kind: ScriptElementKind.functionElement, + name: "function f(): void", + textSpan: { start: 9, length: 1 }, + }, + references: [ + { + fileName: bTs.path, + isDefinition: false, + isInString: undefined, + isWriteAccess: false, + textSpan: { start: 0, length: 1 }, + }, + { + fileName: aTs.path, + isDefinition: true, + isInString: undefined, + isWriteAccess: true, + textSpan: { start: 9, length: 1 }, + }, + ], + } + ]); + }); + + it("findAllReferences -- target does not exist", () => { + const session = makeSampleProjects(); + + const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnB()")); + assert.deepEqual(response, { + refs: [ + makeReferenceItem(bDts, /*isDefinition*/ true, "fnB", "export declare function fnB(): void;"), + makeReferenceItem(userTs, /*isDefinition*/ false, "fnB", "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), + ], + symbolName: "fnB", + symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnB()").offset, + symbolDisplayString: "function fnB(): void", + }); + verifySingleInferredProject(session); + }); + + const renameATs = (aTs: File): protocol.SpanGroup => ({ + file: aTs.path, + locs: [protocolRenameSpanFromSubstring(aTs.content, "fnA")], + }); + const renameUserTs = (userTs: File): protocol.SpanGroup => ({ + file: userTs.path, + locs: [protocolRenameSpanFromSubstring(userTs.content, "fnA")], + }); + + it("renameLocations", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual(response, { + info: { + canRename: true, + displayName: "fnA", + fileToRename: undefined, + fullDisplayName: '"/a/bin/a".fnA', // Ideally this would use the original source's path instead of the declaration file's path. + kind: ScriptElementKind.functionElement, + kindModifiers: [ScriptElementKindModifier.exportedModifier, ScriptElementKindModifier.ambientModifier].join(","), + triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), + }, + locs: [renameUserTs(userTs), renameATs(aTs)], + }); + verifyATsConfigOriginalProject(session); + }); + + it("renameLocations -- starting at definition", () => { + const session = makeSampleProjects(); + openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "fnA")); + assert.deepEqual(response, { + info: { + canRename: true, + displayName: "fnA", + fileToRename: undefined, + fullDisplayName: '"/a/a".fnA', + kind: ScriptElementKind.functionElement, + kindModifiers: ScriptElementKindModifier.exportedModifier, + triggerSpan: protocolTextSpanFromSubstring(aTs.content, "fnA"), + }, + locs: [renameATs(aTs), renameUserTs(userTs)], + }); + verifyATsConfigWhenOpened(session); + }); + + it("renameLocationsFull", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()")); + assert.deepEqual>(response, [ + renameLocation(userTs, "fnA"), + renameLocation(aTs, "fnA"), + ]); + verifyATsConfigOriginalProject(session); + }); + + it("renameLocations -- target does not exist", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnB()")); + assert.deepEqual(response, { + info: { + canRename: true, + displayName: "fnB", + fileToRename: undefined, + fullDisplayName: '"/b/bin/b".fnB', + kind: ScriptElementKind.functionElement, + kindModifiers: [ScriptElementKindModifier.exportedModifier, ScriptElementKindModifier.ambientModifier].join(","), + triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnB"), + }, + locs: [ + { + file: bDts.path, + locs: [protocolRenameSpanFromSubstring(bDts.content, "fnB")], + }, + { + file: userTs.path, + locs: [protocolRenameSpanFromSubstring(userTs.content, "fnB")], + }, + ], + }); + verifySingleInferredProject(session); + }); + + it("getEditsForFileRename", () => { + const session = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.GetEditsForFileRename, { + oldFilePath: aTs.path, + newFilePath: "/a/aNew.ts", + }); + assert.deepEqual>(response, [ + { + fileName: userTs.path, + textChanges: [ + { ...protocolTextSpanFromSubstring(userTs.content, "../a/bin/a"), newText: "../a/bin/aNew" }, + ], + }, + ]); + verifySingleInferredProject(session); + }); + + it("getEditsForFileRename when referencing project doesnt include file and its renamed", () => { + const aTs: File = { path: "/a/src/a.ts", content: "" }; + const aTsconfig: File = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + composite: true, + declaration: true, + declarationMap: true, + outDir: "./build", + } + }), + }; + const bTs: File = { path: "/b/src/b.ts", content: "" }; + const bTsconfig: File = { + path: "/b/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { + composite: true, + outDir: "./build", + }, + include: ["./src"], + references: [{ path: "../a" }], + }), + }; + + const host = createServerHost([aTs, aTsconfig, bTs, bTsconfig]); + const session = createSession(host); + openFilesForSession([aTs, bTs], session); + const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { + oldFilePath: aTs.path, + newFilePath: "/a/src/a1.ts", + }); + assert.deepEqual>(response, []); // Should not change anything + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/documentRegistry.ts b/src/testRunner/unittests/tsserver/documentRegistry.ts new file mode 100644 index 00000000000..0fd812a89d2 --- /dev/null +++ b/src/testRunner/unittests/tsserver/documentRegistry.ts @@ -0,0 +1,94 @@ +namespace ts.projectSystem { + describe("tsserver:: document registry in project service", () => { + const projectRootPath = "/user/username/projects/project"; + const importModuleContent = `import {a} from "./module1"`; + const file: File = { + path: `${projectRootPath}/index.ts`, + content: importModuleContent + }; + const moduleFile: File = { + path: `${projectRootPath}/module1.d.ts`, + content: "export const a: number;" + }; + const configFile: File = { + path: `${projectRootPath}/tsconfig.json`, + content: JSON.stringify({ files: ["index.ts"] }) + }; + + function getProject(service: TestProjectService) { + return service.configuredProjects.get(configFile.path)!; + } + + function checkProject(service: TestProjectService, moduleIsOrphan: boolean) { + // Update the project + const project = getProject(service); + project.getLanguageService(); + checkProjectActualFiles(project, [file.path, libFile.path, configFile.path, ...(moduleIsOrphan ? [] : [moduleFile.path])]); + const moduleInfo = service.getScriptInfo(moduleFile.path)!; + assert.isDefined(moduleInfo); + assert.equal(moduleInfo.isOrphan(), moduleIsOrphan); + const key = service.documentRegistry.getKeyForCompilationSettings(project.getCompilationSettings()); + assert.deepEqual(service.documentRegistry.getLanguageServiceRefCounts(moduleInfo.path), [[key, moduleIsOrphan ? undefined : 1]]); + } + + function createServiceAndHost() { + const host = createServerHost([file, moduleFile, libFile, configFile]); + const service = createProjectService(host); + service.openClientFile(file.path); + checkProject(service, /*moduleIsOrphan*/ false); + return { host, service }; + } + + function changeFileToNotImportModule(service: TestProjectService) { + const info = service.getScriptInfo(file.path)!; + service.applyChangesToFile(info, [{ span: { start: 0, length: importModuleContent.length }, newText: "" }]); + checkProject(service, /*moduleIsOrphan*/ true); + } + + function changeFileToImportModule(service: TestProjectService) { + const info = service.getScriptInfo(file.path)!; + service.applyChangesToFile(info, [{ span: { start: 0, length: 0 }, newText: importModuleContent }]); + checkProject(service, /*moduleIsOrphan*/ false); + } + + it("Caches the source file if script info is orphan", () => { + const { service } = createServiceAndHost(); + const project = getProject(service); + + const moduleInfo = service.getScriptInfo(moduleFile.path)!; + const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; + assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); + + // edit file + changeFileToNotImportModule(service); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); + + // write content back + changeFileToImportModule(service); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); + assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); + }); + + it("Caches the source file if script info is orphan, and orphan script info changes", () => { + const { host, service } = createServiceAndHost(); + const project = getProject(service); + + const moduleInfo = service.getScriptInfo(moduleFile.path)!; + const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; + assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); + + // edit file + changeFileToNotImportModule(service); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); + + const updatedModuleContent = moduleFile.content + "\nexport const b: number;"; + host.writeFile(moduleFile.path, updatedModuleContent); + + // write content back + changeFileToImportModule(service); + assert.notEqual(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); + assert.equal(project.getSourceFile(moduleInfo.path), moduleInfo.cacheSourceFile!.sourceFile); + assert.equal(moduleInfo.cacheSourceFile!.sourceFile.text, updatedModuleContent); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/duplicatePackages.ts b/src/testRunner/unittests/tsserver/duplicatePackages.ts new file mode 100644 index 00000000000..f8a282ee7d2 --- /dev/null +++ b/src/testRunner/unittests/tsserver/duplicatePackages.ts @@ -0,0 +1,54 @@ +namespace ts.projectSystem { + describe("tsserver:: duplicate packages", () => { + // Tests that 'moduleSpecifiers.ts' will import from the redirecting file, and not from the file it redirects to, if that can provide a global module specifier. + it("works with import fixes", () => { + const packageContent = "export const foo: number;"; + const packageJsonContent = JSON.stringify({ name: "foo", version: "1.2.3" }); + const aFooIndex: File = { path: "/a/node_modules/foo/index.d.ts", content: packageContent }; + const aFooPackage: File = { path: "/a/node_modules/foo/package.json", content: packageJsonContent }; + const bFooIndex: File = { path: "/b/node_modules/foo/index.d.ts", content: packageContent }; + const bFooPackage: File = { path: "/b/node_modules/foo/package.json", content: packageJsonContent }; + + const userContent = 'import("foo");\nfoo'; + const aUser: File = { path: "/a/user.ts", content: userContent }; + const bUser: File = { path: "/b/user.ts", content: userContent }; + const tsconfig: File = { + path: "/tsconfig.json", + content: "{}", + }; + + const host = createServerHost([aFooIndex, aFooPackage, bFooIndex, bFooPackage, aUser, bUser, tsconfig]); + const session = createSession(host); + + openFilesForSession([aUser, bUser], session); + + for (const user of [aUser, bUser]) { + const response = executeSessionRequest(session, protocol.CommandTypes.GetCodeFixes, { + file: user.path, + startLine: 2, + startOffset: 1, + endLine: 2, + endOffset: 4, + errorCodes: [Diagnostics.Cannot_find_name_0.code], + }); + assert.deepEqual | undefined>(response, [ + { + description: `Import 'foo' from module "foo"`, + fixName: "import", + fixId: "fixMissingImport", + fixAllDescription: "Add all missing imports", + changes: [{ + fileName: user.path, + textChanges: [{ + start: { line: 1, offset: 1 }, + end: { line: 1, offset: 1 }, + newText: 'import { foo } from "foo";\n\n', + }], + }], + commands: undefined, + }, + ]); + } + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts b/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts new file mode 100644 index 00000000000..d790a1aa25a --- /dev/null +++ b/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts @@ -0,0 +1,45 @@ +namespace ts.projectSystem { + describe("tsserver:: forceConsistentCasingInFileNames", () => { + it("works when extends is specified with a case insensitive file system", () => { + const rootPath = "/Users/username/dev/project"; + const file1: File = { + path: `${rootPath}/index.ts`, + content: 'import {x} from "file2";', + }; + const file2: File = { + path: `${rootPath}/file2.js`, + content: "", + }; + const file2Dts: File = { + path: `${rootPath}/types/file2/index.d.ts`, + content: "export declare const x: string;", + }; + const tsconfigAll: File = { + path: `${rootPath}/tsconfig.all.json`, + content: JSON.stringify({ + compilerOptions: { + baseUrl: ".", + paths: { file2: ["./file2.js"] }, + typeRoots: ["./types"], + forceConsistentCasingInFileNames: true, + }, + }), + }; + const tsconfig: File = { + path: `${rootPath}/tsconfig.json`, + content: JSON.stringify({ extends: "./tsconfig.all.json" }), + }; + + const host = createServerHost([file1, file2, file2Dts, libFile, tsconfig, tsconfigAll], { useCaseSensitiveFileNames: false }); + const session = createSession(host); + + openFilesForSession([file1], session); + const projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + const diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/formatSettings.ts b/src/testRunner/unittests/tsserver/formatSettings.ts new file mode 100644 index 00000000000..4e3e2ebd418 --- /dev/null +++ b/src/testRunner/unittests/tsserver/formatSettings.ts @@ -0,0 +1,39 @@ +namespace ts.projectSystem { + describe("tsserver:: format settings", () => { + it("can be set globally", () => { + const f1 = { + path: "/a/b/app.ts", + content: "let x;" + }; + const host = createServerHost([f1]); + const projectService = createProjectService(host); + projectService.openClientFile(f1.path); + + const defaultSettings = projectService.getFormatCodeOptions(f1.path as server.NormalizedPath); + + // set global settings + const newGlobalSettings1 = { ...defaultSettings, placeOpenBraceOnNewLineForControlBlocks: !defaultSettings.placeOpenBraceOnNewLineForControlBlocks }; + projectService.setHostConfiguration({ formatOptions: newGlobalSettings1 }); + + // get format options for file - should be equal to new global settings + const s1 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); + assert.deepEqual(s1, newGlobalSettings1, "file settings should be the same with global settings"); + + // set per file format options + const newPerFileSettings = { ...defaultSettings, insertSpaceAfterCommaDelimiter: !defaultSettings.insertSpaceAfterCommaDelimiter }; + projectService.setHostConfiguration({ formatOptions: newPerFileSettings, file: f1.path }); + + // get format options for file - should be equal to new per-file settings + const s2 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); + assert.deepEqual(s2, newPerFileSettings, "file settings should be the same with per-file settings"); + + // set new global settings - they should not affect ones that were set per-file + const newGlobalSettings2 = { ...defaultSettings, insertSpaceAfterSemicolonInForStatements: !defaultSettings.insertSpaceAfterSemicolonInForStatements }; + projectService.setHostConfiguration({ formatOptions: newGlobalSettings2 }); + + // get format options for file - should be equal to new per-file settings + const s3 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); + assert.deepEqual(s3, newPerFileSettings, "file settings should still be the same with per-file settings"); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/getEditsForFileRename.ts b/src/testRunner/unittests/tsserver/getEditsForFileRename.ts new file mode 100644 index 00000000000..3fadf99c3f8 --- /dev/null +++ b/src/testRunner/unittests/tsserver/getEditsForFileRename.ts @@ -0,0 +1,105 @@ +namespace ts.projectSystem { + describe("tsserver:: getEditsForFileRename", () => { + it("works for host implementing 'resolveModuleNames' and 'getResolvedModuleWithFailedLookupLocationsFromCache'", () => { + const userTs: File = { + path: "/user.ts", + content: 'import { x } from "./old";', + }; + const newTs: File = { + path: "/new.ts", + content: "export const x = 0;", + }; + const tsconfig: File = { + path: "/tsconfig.json", + content: "{}", + }; + + const host = createServerHost([userTs, newTs, tsconfig]); + const projectService = createProjectService(host); + projectService.openClientFile(userTs.path); + const project = projectService.configuredProjects.get(tsconfig.path)!; + + Debug.assert(!!project.resolveModuleNames); + + const edits = project.getLanguageService().getEditsForFileRename("/old.ts", "/new.ts", testFormatSettings, emptyOptions); + assert.deepEqual>(edits, [{ + fileName: "/user.ts", + textChanges: [{ + span: textSpanFromSubstring(userTs.content, "./old"), + newText: "./new", + }], + }]); + }); + + it("works with multiple projects", () => { + const aUserTs: File = { + path: "/a/user.ts", + content: 'import { x } from "./old";', + }; + const aOldTs: File = { + path: "/a/old.ts", + content: "export const x = 0;", + }; + const aTsconfig: File = { + path: "/a/tsconfig.json", + content: JSON.stringify({ files: ["./old.ts", "./user.ts"] }), + }; + const bUserTs: File = { + path: "/b/user.ts", + content: 'import { x } from "../a/old";', + }; + const bTsconfig: File = { + path: "/b/tsconfig.json", + content: "{}", + }; + + const host = createServerHost([aUserTs, aOldTs, aTsconfig, bUserTs, bTsconfig]); + const session = createSession(host); + openFilesForSession([aUserTs, bUserTs], session); + + const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { + oldFilePath: aOldTs.path, + newFilePath: "/a/new.ts", + }); + assert.deepEqual>(response, [ + { + fileName: aTsconfig.path, + textChanges: [{ ...protocolTextSpanFromSubstring(aTsconfig.content, "./old.ts"), newText: "new.ts" }], + }, + { + fileName: aUserTs.path, + textChanges: [{ ...protocolTextSpanFromSubstring(aUserTs.content, "./old"), newText: "./new" }], + }, + { + fileName: bUserTs.path, + textChanges: [{ ...protocolTextSpanFromSubstring(bUserTs.content, "../a/old"), newText: "../a/new" }], + }, + ]); + }); + + it("works with file moved to inferred project", () => { + const aTs: File = { path: "/a.ts", content: 'import {} from "./b";' }; + const cTs: File = { path: "/c.ts", content: "export {};" }; + const tsconfig: File = { path: "/tsconfig.json", content: JSON.stringify({ files: ["./a.ts", "./b.ts"] }) }; + + const host = createServerHost([aTs, cTs, tsconfig]); + const session = createSession(host); + openFilesForSession([aTs, cTs], session); + + const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { + oldFilePath: "/b.ts", + newFilePath: cTs.path, + }); + assert.deepEqual>(response, [ + { + fileName: "/tsconfig.json", + textChanges: [{ ...protocolTextSpanFromSubstring(tsconfig.content, "./b.ts"), newText: "c.ts" }], + }, + { + fileName: "/a.ts", + textChanges: [{ ...protocolTextSpanFromSubstring(aTs.content, "./b"), newText: "./c" }], + }, + ]); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/helpers.ts b/src/testRunner/unittests/tsserver/helpers.ts index 86dfddf3bb3..1db6a9b36c8 100644 --- a/src/testRunner/unittests/tsserver/helpers.ts +++ b/src/testRunner/unittests/tsserver/helpers.ts @@ -15,6 +15,9 @@ namespace ts.projectSystem { export import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; export import checkWatchedDirectoriesDetailed = TestFSWithWatch.checkWatchedDirectoriesDetailed; + export import commonFile1 = tscWatch.commonFile1; + export import commonFile2 = tscWatch.commonFile2; + const outputEventRegex = /Content\-Length: [\d]+\r\n\r\n/; export function mapOutputToJson(s: string) { return convertToObject( @@ -459,9 +462,13 @@ namespace ts.projectSystem { return getRootsToWatchWithAncestorDirectory(currentDirectory, nodeModulesAtTypes); } - //function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { - // checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); - //} + export function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { + checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); + } + + export function checkScriptInfos(projectService: server.ProjectService, expectedFiles: ReadonlyArray) { + checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles); + } export function protocolLocationFromSubstring(str: string, substring: string): protocol.Location { const start = str.indexOf(substring); @@ -497,18 +504,10 @@ namespace ts.projectSystem { Debug.assert(start !== -1); return createTextSpan(start, substring.length); } - //function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { - // return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; - //} - //function protocolFileSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): protocol.FileSpan { - // return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring, options) }; - //} - //function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan { - // return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) }; - //} - //function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { - // return documentSpanFromSubstring(file, substring, options); - //} + + export function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { + return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; + } export interface SpanFromSubstringOptions { readonly index: number; @@ -648,33 +647,4 @@ namespace ts.projectSystem { assert.strictEqual(outputs.length, index + 1, JSON.stringify(outputs)); } } - - //function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { - // return { - // ...protocolFileSpanFromSubstring(file, text, options), - // isDefinition, - // isWriteAccess: isDefinition, - // lineText, - // }; - //} - - //function makeReferenceEntry(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): ReferenceEntry { - // return { - // ...documentSpanFromSubstring(file, text, options), - // isDefinition, - // isWriteAccess: isDefinition, - // isInString: undefined, - // }; - //} - - //function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray): void { - // openFilesForSession([file], session); - // const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false)); - // const program = project.getCurrentProgram()!; - // const output = getFileEmitOutput(program, Debug.assertDefined(program.getSourceFile(file.path)), /*emitOnlyDtsFiles*/ true); - // closeFilesForSession([file], session); - - // Debug.assert(!output.emitSkipped); - // assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false }))); - //} } diff --git a/src/testRunner/unittests/tsserver/importHelpers.ts b/src/testRunner/unittests/tsserver/importHelpers.ts new file mode 100644 index 00000000000..42e38aed122 --- /dev/null +++ b/src/testRunner/unittests/tsserver/importHelpers.ts @@ -0,0 +1,18 @@ +namespace ts.projectSystem { + describe("tsserver:: import helpers", () => { + it("should not crash in tsserver", () => { + const f1 = { + path: "/a/app.ts", + content: "export async function foo() { return 100; }" + }; + const tslib = { + path: "/a/node_modules/tslib/index.d.ts", + content: "" + }; + const host = createServerHost([f1, tslib]); + const service = createProjectService(host); + service.openExternalProject({ projectFileName: "p", rootFiles: [toExternalFile(f1.path)], options: { importHelpers: true } }); + service.checkNumberOfProjects({ externalProjects: 1 }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/inferredProjects.ts b/src/testRunner/unittests/tsserver/inferredProjects.ts new file mode 100644 index 00000000000..b22413c6ab3 --- /dev/null +++ b/src/testRunner/unittests/tsserver/inferredProjects.ts @@ -0,0 +1,229 @@ +namespace ts.projectSystem { + describe("tsserver:: Inferred projects", () => { + it("should support files without extensions", () => { + const f = { + path: "/a/compile", + content: "let x = 1" + }; + const host = createServerHost([f]); + const session = createSession(host); + session.executeCommand({ + seq: 1, + type: "request", + command: "compilerOptionsForInferredProjects", + arguments: { + options: { + allowJs: true + } + } + }); + session.executeCommand({ + seq: 2, + type: "request", + command: "open", + arguments: { + file: f.path, + fileContent: f.content, + scriptKindName: "JS" + } + }); + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [f.path]); + }); + + it("inferred projects per project root", () => { + const file1 = { path: "/a/file1.ts", content: "let x = 1;", projectRootPath: "/a" }; + const file2 = { path: "/a/file2.ts", content: "let y = 2;", projectRootPath: "/a" }; + const file3 = { path: "/b/file2.ts", content: "let x = 3;", projectRootPath: "/b" }; + const file4 = { path: "/c/file3.ts", content: "let z = 4;" }; + const host = createServerHost([file1, file2, file3, file4]); + const session = createSession(host, { + useSingleInferredProject: true, + useInferredProjectPerProjectRoot: true + }); + session.executeCommand({ + seq: 1, + type: "request", + command: CommandNames.CompilerOptionsForInferredProjects, + arguments: { + options: { + allowJs: true, + target: ScriptTarget.ESNext + } + } + }); + session.executeCommand({ + seq: 2, + type: "request", + command: CommandNames.CompilerOptionsForInferredProjects, + arguments: { + options: { + allowJs: true, + target: ScriptTarget.ES2015 + }, + projectRootPath: "/b" + } + }); + session.executeCommand({ + seq: 3, + type: "request", + command: CommandNames.Open, + arguments: { + file: file1.path, + fileContent: file1.content, + scriptKindName: "JS", + projectRootPath: file1.projectRootPath + } + }); + session.executeCommand({ + seq: 4, + type: "request", + command: CommandNames.Open, + arguments: { + file: file2.path, + fileContent: file2.content, + scriptKindName: "JS", + projectRootPath: file2.projectRootPath + } + }); + session.executeCommand({ + seq: 5, + type: "request", + command: CommandNames.Open, + arguments: { + file: file3.path, + fileContent: file3.content, + scriptKindName: "JS", + projectRootPath: file3.projectRootPath + } + }); + session.executeCommand({ + seq: 6, + type: "request", + command: CommandNames.Open, + arguments: { + file: file4.path, + fileContent: file4.content, + scriptKindName: "JS" + } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 3 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file4.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file1.path, file2.path]); + checkProjectActualFiles(projectService.inferredProjects[2], [file3.path]); + assert.equal(projectService.inferredProjects[0].getCompilationSettings().target, ScriptTarget.ESNext); + assert.equal(projectService.inferredProjects[1].getCompilationSettings().target, ScriptTarget.ESNext); + assert.equal(projectService.inferredProjects[2].getCompilationSettings().target, ScriptTarget.ES2015); + }); + + function checkInferredProject(inferredProject: server.InferredProject, actualFiles: File[], target: ScriptTarget) { + checkProjectActualFiles(inferredProject, actualFiles.map(f => f.path)); + assert.equal(inferredProject.getCompilationSettings().target, target); + } + + function verifyProjectRootWithCaseSensitivity(useCaseSensitiveFileNames: boolean) { + const files: [File, File, File, File] = [ + { path: "/a/file1.ts", content: "let x = 1;" }, + { path: "/A/file2.ts", content: "let y = 2;" }, + { path: "/b/file2.ts", content: "let x = 3;" }, + { path: "/c/file3.ts", content: "let z = 4;" } + ]; + const host = createServerHost(files, { useCaseSensitiveFileNames }); + const projectService = createProjectService(host, { useSingleInferredProject: true, }, { useInferredProjectPerProjectRoot: true }); + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ESNext + }); + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ES2015 + }, "/a"); + + openClientFiles(["/a", "/a", "/b", undefined]); + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2015], + [[files[2]], ScriptTarget.ESNext] + ]); + closeClientFiles(); + + openClientFiles(["/a", "/A", "/b", undefined]); + if (useCaseSensitiveFileNames) { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0]], ScriptTarget.ES2015], + [[files[1]], ScriptTarget.ESNext], + [[files[2]], ScriptTarget.ESNext] + ]); + } + else { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2015], + [[files[2]], ScriptTarget.ESNext] + ]); + } + closeClientFiles(); + + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ES2017 + }, "/A"); + + openClientFiles(["/a", "/a", "/b", undefined]); + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], useCaseSensitiveFileNames ? ScriptTarget.ES2015 : ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + closeClientFiles(); + + openClientFiles(["/a", "/A", "/b", undefined]); + if (useCaseSensitiveFileNames) { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0]], ScriptTarget.ES2015], + [[files[1]], ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + } + else { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + } + closeClientFiles(); + + function openClientFiles(projectRoots: [string | undefined, string | undefined, string | undefined, string | undefined]) { + files.forEach((file, index) => { + projectService.openClientFile(file.path, file.content, ScriptKind.JS, projectRoots[index]); + }); + } + + function closeClientFiles() { + files.forEach(file => projectService.closeClientFile(file.path)); + } + + function verifyInferredProjectsState(expected: [File[], ScriptTarget][]) { + checkNumberOfProjects(projectService, { inferredProjects: expected.length }); + projectService.inferredProjects.forEach((p, index) => { + const [actualFiles, target] = expected[index]; + checkInferredProject(p, actualFiles, target); + }); + } + } + + it("inferred projects per project root with case sensitive system", () => { + verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ true); + }); + + it("inferred projects per project root with case insensitive system", () => { + verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ false); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/languageService.ts b/src/testRunner/unittests/tsserver/languageService.ts new file mode 100644 index 00000000000..6ee68e74c15 --- /dev/null +++ b/src/testRunner/unittests/tsserver/languageService.ts @@ -0,0 +1,19 @@ +namespace ts.projectSystem { + describe("tsserver:: Language service", () => { + it("should work correctly on case-sensitive file systems", () => { + const lib = { + path: "/a/Lib/lib.d.ts", + content: "let x: number" + }; + const f = { + path: "/a/b/app.ts", + content: "let x = 1;" + }; + const host = createServerHost([lib, f], { executingFilePath: "/a/Lib/tsc.js", useCaseSensitiveFileNames: true }); + const projectService = createProjectService(host); + projectService.openClientFile(f.path); + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + projectService.inferredProjects[0].getLanguageService().getProgram(); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts b/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts new file mode 100644 index 00000000000..dd0b954824d --- /dev/null +++ b/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts @@ -0,0 +1,55 @@ +namespace ts.projectSystem { + describe("tsserver:: maxNodeModuleJsDepth for inferred projects", () => { + it("should be set to 2 if the project has js root files", () => { + const file1: File = { + path: "/a/b/file1.js", + content: `var t = require("test"); t.` + }; + const moduleFile: File = { + path: "/a/b/node_modules/test/index.js", + content: `var v = 10; module.exports = v;` + }; + + const host = createServerHost([file1, moduleFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + + let project = projectService.inferredProjects[0]; + let options = project.getCompilationSettings(); + assert.isTrue(options.maxNodeModuleJsDepth === 2); + + // Assert the option sticks + projectService.setCompilerOptionsForInferredProjects({ target: ScriptTarget.ES2016 }); + project = projectService.inferredProjects[0]; + options = project.getCompilationSettings(); + assert.isTrue(options.maxNodeModuleJsDepth === 2); + }); + + it("should return to normal state when all js root files are removed from project", () => { + const file1 = { + path: "/a/file1.ts", + content: "let x =1;" + }; + const file2 = { + path: "/a/file2.js", + content: "let x =1;" + }; + + const host = createServerHost([file1, file2, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + + projectService.openClientFile(file1.path); + checkNumberOfInferredProjects(projectService, 1); + let project = projectService.inferredProjects[0]; + assert.isUndefined(project.getCompilationSettings().maxNodeModuleJsDepth); + + projectService.openClientFile(file2.path); + project = projectService.inferredProjects[0]; + assert.isTrue(project.getCompilationSettings().maxNodeModuleJsDepth === 2); + + projectService.closeClientFile(file2.path); + project = projectService.inferredProjects[0]; + assert.isUndefined(project.getCompilationSettings().maxNodeModuleJsDepth); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/metadataInResponse.ts b/src/testRunner/unittests/tsserver/metadataInResponse.ts new file mode 100644 index 00000000000..783fce4dd16 --- /dev/null +++ b/src/testRunner/unittests/tsserver/metadataInResponse.ts @@ -0,0 +1,99 @@ +namespace ts.projectSystem { + describe("tsserver:: with metadata in response", () => { + const metadata = "Extra Info"; + function verifyOutput(host: TestServerHost, expectedResponse: protocol.Response) { + const output = host.getOutput().map(mapOutputToJson); + assert.deepEqual(output, [expectedResponse]); + host.clearOutput(); + } + + function verifyCommandWithMetadata(session: TestSession, host: TestServerHost, command: Partial, expectedResponseBody: U) { + command.seq = session.getSeq(); + command.type = "request"; + session.onMessage(JSON.stringify(command)); + verifyOutput(host, expectedResponseBody ? + { seq: 0, type: "response", command: command.command!, request_seq: command.seq, success: true, body: expectedResponseBody, metadata } : + { seq: 0, type: "response", command: command.command!, request_seq: command.seq, success: false, message: "No content available." } + ); + } + + const aTs: File = { path: "/a.ts", content: `class c { prop = "hello"; foo() { return this.prop; } }` }; + const tsconfig: File = { + path: "/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { plugins: [{ name: "myplugin" }] } + }) + }; + function createHostWithPlugin(files: ReadonlyArray) { + const host = createServerHost(files); + host.require = (_initialPath, moduleName) => { + assert.equal(moduleName, "myplugin"); + return { + module: () => ({ + create(info: server.PluginCreateInfo) { + const proxy = Harness.LanguageService.makeDefaultProxy(info); + proxy.getCompletionsAtPosition = (filename, position, options) => { + const result = info.languageService.getCompletionsAtPosition(filename, position, options); + if (result) { + result.metadata = metadata; + } + return result; + }; + return proxy; + } + }), + error: undefined + }; + }; + return host; + } + + describe("With completion requests", () => { + const completionRequestArgs: protocol.CompletionsRequestArgs = { + file: aTs.path, + line: 1, + offset: aTs.content.indexOf("this.") + 1 + "this.".length + }; + const expectedCompletionEntries: ReadonlyArray = [ + { name: "foo", kind: ScriptElementKind.memberFunctionElement, kindModifiers: "", sortText: "0" }, + { name: "prop", kind: ScriptElementKind.memberVariableElement, kindModifiers: "", sortText: "0" } + ]; + + it("can pass through metadata when the command returns array", () => { + const host = createHostWithPlugin([aTs, tsconfig]); + const session = createSession(host); + openFilesForSession([aTs], session); + verifyCommandWithMetadata>(session, host, { + command: protocol.CommandTypes.Completions, + arguments: completionRequestArgs + }, expectedCompletionEntries); + }); + + it("can pass through metadata when the command returns object", () => { + const host = createHostWithPlugin([aTs, tsconfig]); + const session = createSession(host); + openFilesForSession([aTs], session); + verifyCommandWithMetadata(session, host, { + command: protocol.CommandTypes.CompletionInfo, + arguments: completionRequestArgs + }, { + isGlobalCompletion: false, + isMemberCompletion: true, + isNewIdentifierLocation: false, + entries: expectedCompletionEntries + }); + }); + + it("returns undefined correctly", () => { + const aTs: File = { path: "/a.ts", content: `class c { prop = "hello"; foo() { const x = 0; } }` }; + const host = createHostWithPlugin([aTs, tsconfig]); + const session = createSession(host); + openFilesForSession([aTs], session); + verifyCommandWithMetadata(session, host, { + command: protocol.CommandTypes.Completions, + arguments: { file: aTs.path, line: 1, offset: aTs.content.indexOf("x") + 1 } + }, /*expectedResponseBody*/ undefined); + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/navTo.ts b/src/testRunner/unittests/tsserver/navTo.ts new file mode 100644 index 00000000000..5d45e537ede --- /dev/null +++ b/src/testRunner/unittests/tsserver/navTo.ts @@ -0,0 +1,30 @@ +namespace ts.projectSystem { + describe("tsserver:: navigate-to for javascript project", () => { + function containsNavToItem(items: protocol.NavtoItem[], itemName: string, itemKind: string) { + return find(items, item => item.name === itemName && item.kind === itemKind) !== undefined; + } + + it("should not include type symbols", () => { + const file1: File = { + path: "/a/b/file1.js", + content: "function foo() {}" + }; + const configFile: File = { + path: "/a/b/jsconfig.json", + content: "{}" + }; + const host = createServerHost([file1, configFile, libFile]); + const session = createSession(host); + openFilesForSession([file1], session); + + // Try to find some interface type defined in lib.d.ts + const libTypeNavToRequest = makeSessionRequest(CommandNames.Navto, { searchValue: "Document", file: file1.path, projectFileName: configFile.path }); + const items = session.executeCommand(libTypeNavToRequest).response as protocol.NavtoItem[]; + assert.isFalse(containsNavToItem(items, "Document", "interface"), `Found lib.d.ts symbol in JavaScript project nav to request result.`); + + const localFunctionNavToRequst = makeSessionRequest(CommandNames.Navto, { searchValue: "foo", file: file1.path, projectFileName: configFile.path }); + const items2 = session.executeCommand(localFunctionNavToRequst).response as protocol.NavtoItem[]; + assert.isTrue(containsNavToItem(items2, "foo", "function"), `Cannot find function symbol "foo".`); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/occurences.ts b/src/testRunner/unittests/tsserver/occurences.ts new file mode 100644 index 00000000000..bcdadd3872c --- /dev/null +++ b/src/testRunner/unittests/tsserver/occurences.ts @@ -0,0 +1,47 @@ +namespace ts.projectSystem { + describe("tsserver:: occurence highlight on string", () => { + it("should be marked if only on string values", () => { + const file1: File = { + path: "/a/b/file1.ts", + content: `let t1 = "div";\nlet t2 = "div";\nlet t3 = { "div": 123 };\nlet t4 = t3["div"];` + }; + + const host = createServerHost([file1]); + const session = createSession(host); + const projectService = session.getProjectService(); + + projectService.openClientFile(file1.path); + { + const highlightRequest = makeSessionRequest( + CommandNames.Occurrences, + { file: file1.path, line: 1, offset: 11 } + ); + const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; + const firstOccurence = highlightResponse[0]; + assert.isTrue(firstOccurence.isInString, "Highlights should be marked with isInString"); + } + + { + const highlightRequest = makeSessionRequest( + CommandNames.Occurrences, + { file: file1.path, line: 3, offset: 13 } + ); + const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; + assert.isTrue(highlightResponse.length === 2); + const firstOccurence = highlightResponse[0]; + assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on property name"); + } + + { + const highlightRequest = makeSessionRequest( + CommandNames.Occurrences, + { file: file1.path, line: 4, offset: 14 } + ); + const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; + assert.isTrue(highlightResponse.length === 2); + const firstOccurence = highlightResponse[0]; + assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on indexer"); + } + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/openFile.ts b/src/testRunner/unittests/tsserver/openFile.ts new file mode 100644 index 00000000000..187b5043fcc --- /dev/null +++ b/src/testRunner/unittests/tsserver/openFile.ts @@ -0,0 +1,108 @@ +namespace ts.projectSystem { + describe("tsserver:: Open-file", () => { + it("can be reloaded with empty content", () => { + const f = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const projectFileName = "externalProject"; + const host = createServerHost([f]); + const projectService = createProjectService(host); + // create a project + projectService.openExternalProject({ projectFileName, rootFiles: [toExternalFile(f.path)], options: {} }); + projectService.checkNumberOfProjects({ externalProjects: 1 }); + + const p = projectService.externalProjects[0]; + // force to load the content of the file + p.updateGraph(); + + const scriptInfo = p.getScriptInfo(f.path)!; + checkSnapLength(scriptInfo.getSnapshot(), f.content.length); + + // open project and replace its content with empty string + projectService.openClientFile(f.path, ""); + checkSnapLength(scriptInfo.getSnapshot(), 0); + }); + function checkSnapLength(snap: IScriptSnapshot, expectedLength: number) { + assert.equal(snap.getLength(), expectedLength, "Incorrect snapshot size"); + } + + function verifyOpenFileWorks(useCaseSensitiveFileNames: boolean) { + const file1: File = { + path: "/a/b/src/app.ts", + content: "let x = 10;" + }; + const file2: File = { + path: "/a/B/lib/module2.ts", + content: "let z = 10;" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: "" + }; + const configFile2: File = { + path: "/a/tsconfig.json", + content: "" + }; + const host = createServerHost([file1, file2, configFile, configFile2], { + useCaseSensitiveFileNames + }); + const service = createProjectService(host); + + // Open file1 -> configFile + verifyConfigFileName(file1, "/a", configFile); + verifyConfigFileName(file1, "/a/b", configFile); + verifyConfigFileName(file1, "/a/B", configFile); + + // Open file2 use root "/a/b" + verifyConfigFileName(file2, "/a", useCaseSensitiveFileNames ? configFile2 : configFile); + verifyConfigFileName(file2, "/a/b", useCaseSensitiveFileNames ? configFile2 : configFile); + verifyConfigFileName(file2, "/a/B", useCaseSensitiveFileNames ? undefined : configFile); + + function verifyConfigFileName(file: File, projectRoot: string, expectedConfigFile: File | undefined) { + const { configFileName } = service.openClientFile(file.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectRoot); + assert.equal(configFileName, expectedConfigFile && expectedConfigFile.path); + service.closeClientFile(file.path); + } + } + it("works when project root is used with case-sensitive system", () => { + verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ true); + }); + + it("works when project root is used with case-insensitive system", () => { + verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ false); + }); + + it("uses existing project even if project refresh is pending", () => { + 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); + service.openClientFile(aFile.path, /*fileContent*/ undefined, ScriptKind.TS, projectFolder); + verifyProject(); + + const bFile: File = { + path: `${projectFolder}/src/b.ts`, + content: `export {}; declare module "./a" { export const y: number; }` + }; + files.push(bFile); + host.reloadFS(files); + service.openClientFile(bFile.path, /*fileContent*/ undefined, ScriptKind.TS, projectFolder); + verifyProject(); + + function verifyProject() { + assert.isDefined(service.configuredProjects.get(configFile.path)); + const project = service.configuredProjects.get(configFile.path)!; + checkProjectActualFiles(project, files.map(f => f.path)); + } + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/projectReferences.ts b/src/testRunner/unittests/tsserver/projectReferences.ts new file mode 100644 index 00000000000..c7a42d6b813 --- /dev/null +++ b/src/testRunner/unittests/tsserver/projectReferences.ts @@ -0,0 +1,658 @@ +namespace ts.projectSystem { + describe("tsserver:: with project references and tsbuild", () => { + function createHost(files: ReadonlyArray, rootNames: ReadonlyArray) { + const host = createServerHost(files); + + // ts build should succeed + const solutionBuilder = tscWatch.createSolutionBuilder(host, rootNames, {}); + solutionBuilder.buildAllProjects(); + assert.equal(host.getOutput().length, 0); + + return host; + } + + describe("with container project", () => { + function getProjectFiles(project: string): [File, File] { + return [ + TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json"), + TestFSWithWatch.getTsBuildProjectFile(project, "index.ts"), + ]; + } + + const project = "container"; + const containerLib = getProjectFiles("container/lib"); + const containerExec = getProjectFiles("container/exec"); + const containerCompositeExec = getProjectFiles("container/compositeExec"); + const containerConfig = TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json"); + const files = [libFile, ...containerLib, ...containerExec, ...containerCompositeExec, containerConfig]; + + it("does not error on container only project", () => { + const host = createHost(files, [containerConfig.path]); + + // Open external project for the folder + const session = createSession(host); + const service = session.getProjectService(); + service.openExternalProjects([{ + projectFileName: TestFSWithWatch.getTsBuildProjectFilePath(project, project), + rootFiles: files.map(f => ({ fileName: f.path })), + options: {} + }]); + checkNumberOfProjects(service, { configuredProjects: 4 }); + files.forEach(f => { + const args: protocol.FileRequestArgs = { + file: f.path, + projectFileName: endsWith(f.path, "tsconfig.json") ? f.path : undefined + }; + const syntaxDiagnostics = session.executeCommandSeq({ + command: protocol.CommandTypes.SyntacticDiagnosticsSync, + arguments: args + }).response; + assert.deepEqual(syntaxDiagnostics, []); + const semanticDiagnostics = session.executeCommandSeq({ + command: protocol.CommandTypes.SemanticDiagnosticsSync, + arguments: args + }).response; + assert.deepEqual(semanticDiagnostics, []); + }); + const containerProject = service.configuredProjects.get(containerConfig.path)!; + checkProjectActualFiles(containerProject, [containerConfig.path]); + const optionsDiagnostics = session.executeCommandSeq({ + command: protocol.CommandTypes.CompilerOptionsDiagnosticsFull, + arguments: { projectFileName: containerProject.projectName } + }).response; + assert.deepEqual(optionsDiagnostics, []); + }); + + it("can successfully find references with --out options", () => { + const host = createHost(files, [containerConfig.path]); + const session = createSession(host); + openFilesForSession([containerCompositeExec[1]], session); + const service = session.getProjectService(); + checkNumberOfProjects(service, { configuredProjects: 1 }); + const locationOfMyConst = protocolLocationFromSubstring(containerCompositeExec[1].content, "myConst"); + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.Rename, + arguments: { + file: containerCompositeExec[1].path, + ...locationOfMyConst + } + }).response as protocol.RenameResponseBody; + + + const myConstLen = "myConst".length; + const locationOfMyConstInLib = protocolLocationFromSubstring(containerLib[1].content, "myConst"); + assert.deepEqual(response.locs, [ + { file: containerCompositeExec[1].path, locs: [{ start: locationOfMyConst, end: { line: locationOfMyConst.line, offset: locationOfMyConst.offset + myConstLen } }] }, + { file: containerLib[1].path, locs: [{ start: locationOfMyConstInLib, end: { line: locationOfMyConstInLib.line, offset: locationOfMyConstInLib.offset + myConstLen } }] } + ]); + }); + }); + + describe("with main and depedency project", () => { + const projectLocation = "/user/username/projects/myproject"; + const dependecyLocation = `${projectLocation}/dependency`; + const mainLocation = `${projectLocation}/main`; + const dependencyTs: File = { + path: `${dependecyLocation}/FnS.ts`, + content: `export function fn1() { } +export function fn2() { } +export function fn3() { } +export function fn4() { } +export function fn5() { } +` + }; + const dependencyConfig: File = { + path: `${dependecyLocation}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { composite: true, declarationMap: true } }) + }; + + const mainTs: File = { + path: `${mainLocation}/main.ts`, + content: `import { + fn1, + fn2, + fn3, + fn4, + fn5 +} from '../dependency/fns' + +fn1(); +fn2(); +fn3(); +fn4(); +fn5(); +` + }; + const mainConfig: File = { + path: `${mainLocation}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { composite: true, declarationMap: true }, + references: [{ path: "../dependency" }] + }) + }; + + const randomFile: File = { + path: `${projectLocation}/random/random.ts`, + content: "let a = 10;" + }; + const randomConfig: File = { + path: `${projectLocation}/random/tsconfig.json`, + content: "{}" + }; + const dtsLocation = `${dependecyLocation}/FnS.d.ts`; + const dtsPath = dtsLocation.toLowerCase() as Path; + const dtsMapLocation = `${dtsLocation}.map`; + const dtsMapPath = dtsMapLocation.toLowerCase() as Path; + + const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; + + function verifyScriptInfos(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + checkScriptInfos(session.getProjectService(), openInfos.concat(closedInfos)); + checkWatchedFiles(host, closedInfos.concat(otherWatchedFiles).map(f => f.toLowerCase())); + } + + function verifyInfosWithRandom(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { + verifyScriptInfos(session, host, openInfos.concat(randomFile.path), closedInfos, otherWatchedFiles.concat(randomConfig.path)); + } + + function verifyOnlyRandomInfos(session: TestSession, host: TestServerHost) { + verifyScriptInfos(session, host, [randomFile.path], [libFile.path], [randomConfig.path]); + } + + // Returns request and expected Response, expected response when no map file + interface SessionAction { + reqName: string; + request: Partial; + expectedResponse: Response; + expectedResponseNoMap?: Response; + expectedResponseNoDts?: Response; + } + function gotoDefintinionFromMainTs(fn: number): SessionAction { + const textSpan = usageSpan(fn); + const definition: protocol.FileSpan = { file: dependencyTs.path, ...definitionSpan(fn) }; + const declareSpaceLength = "declare ".length; + return { + reqName: "goToDef", + request: { + command: protocol.CommandTypes.DefinitionAndBoundSpan, + arguments: { file: mainTs.path, ...textSpan.start } + }, + expectedResponse: { + // To dependency + definitions: [definition], + textSpan + }, + expectedResponseNoMap: { + // To the dts + definitions: [{ file: dtsPath, start: { line: fn, offset: definition.start.offset + declareSpaceLength }, end: { line: fn, offset: definition.end.offset + declareSpaceLength } }], + textSpan + }, + expectedResponseNoDts: { + // To import declaration + definitions: [{ file: mainTs.path, ...importSpan(fn) }], + textSpan + } + }; + } + + function definitionSpan(fn: number): protocol.TextSpan { + return { start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; + } + function importSpan(fn: number): protocol.TextSpan { + return { start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 } }; + } + function usageSpan(fn: number): protocol.TextSpan { + return { start: { line: fn + 8, offset: 1 }, end: { line: fn + 8, offset: 4 } }; + } + + function renameFromDependencyTs(fn: number): SessionAction { + const triggerSpan = definitionSpan(fn); + return { + reqName: "rename", + request: { + command: protocol.CommandTypes.Rename, + arguments: { file: dependencyTs.path, ...triggerSpan.start } + }, + expectedResponse: { + info: { + canRename: true, + fileToRename: undefined, + displayName: `fn${fn}`, + fullDisplayName: `"${dependecyLocation}/FnS".fn${fn}`, + kind: ScriptElementKind.functionElement, + kindModifiers: "export", + triggerSpan + }, + locs: [ + { file: dependencyTs.path, locs: [triggerSpan] } + ] + } + }; + } + + function renameFromDependencyTsWithBothProjectsOpen(fn: number): SessionAction { + const { reqName, request, expectedResponse } = renameFromDependencyTs(fn); + const { info, locs } = expectedResponse; + return { + reqName, + request, + expectedResponse: { + info, + locs: [ + locs[0], + { + file: mainTs.path, + locs: [ + importSpan(fn), + usageSpan(fn) + ] + } + ] + }, + // Only dependency result + expectedResponseNoMap: expectedResponse, + expectedResponseNoDts: expectedResponse + }; + } + + // Returns request and expected Response + type SessionActionGetter = (fn: number) => SessionAction; + // Open File, expectedProjectActualFiles, actionGetter, openFileLastLine + interface DocumentPositionMapperVerifier { + openFile: File; + expectedProjectActualFiles: ReadonlyArray; + actionGetter: SessionActionGetter; + openFileLastLine: number; + } + function verifyDocumentPositionMapperUpdates( + mainScenario: string, + verifier: ReadonlyArray, + closedInfos: ReadonlyArray) { + + const openFiles = verifier.map(v => v.openFile); + const expectedProjectActualFiles = verifier.map(v => v.expectedProjectActualFiles); + const actionGetters = verifier.map(v => v.actionGetter); + const openFileLastLines = verifier.map(v => v.openFileLastLine); + + const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); + const openInfos = openFiles.map(f => f.path); + // When usage and dependency are used, dependency config is part of closedInfo so ignore + const otherWatchedFiles = verifier.length > 1 ? [configFiles[0]] : configFiles; + function openTsFile(onHostCreate?: (host: TestServerHost) => void) { + const host = createHost(files, [mainConfig.path]); + if (onHostCreate) { + onHostCreate(host); + } + const session = createSession(host); + openFilesForSession([...openFiles, randomFile], session); + return { host, session }; + } + + function checkProject(session: TestSession, noDts?: true) { + const service = session.getProjectService(); + checkNumberOfProjects(service, { configuredProjects: 1 + verifier.length }); + configFiles.forEach((configFile, index) => { + checkProjectActualFiles( + service.configuredProjects.get(configFile)!, + noDts ? + expectedProjectActualFiles[index].filter(f => f.toLowerCase() !== dtsPath) : + expectedProjectActualFiles[index] + ); + }); + } + + function verifyInfos(session: TestSession, host: TestServerHost) { + verifyInfosWithRandom(session, host, openInfos, closedInfos, otherWatchedFiles); + } + + function verifyInfosWhenNoMapFile(session: TestSession, host: TestServerHost, dependencyTsOK?: true) { + const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); + verifyInfosWithRandom( + session, + host, + openInfos, + closedInfos.filter(f => f !== dtsMapClosedInfo && (dependencyTsOK || f !== dependencyTs.path)), + dtsMapClosedInfo ? otherWatchedFiles.concat(dtsMapClosedInfo) : otherWatchedFiles + ); + } + + function verifyInfosWhenNoDtsFile(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { + const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); + const dtsClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsPath ? f : undefined); + verifyInfosWithRandom( + session, + host, + openInfos, + closedInfos.filter(f => (dependencyTsAndMapOk || f !== dtsMapClosedInfo) && f !== dtsClosedInfo && (dependencyTsAndMapOk || f !== dependencyTs.path)), + // When project actual file contains dts, it needs to be watched + dtsClosedInfo && expectedProjectActualFiles.some(expectedProjectActualFiles => expectedProjectActualFiles.some(f => f.toLowerCase() === dtsPath)) ? + otherWatchedFiles.concat(dtsClosedInfo) : + otherWatchedFiles + ); + } + + function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { + assert.strictEqual(session.getProjectService().filenameToScriptInfo.get(dtsMapPath), dependencyMap); + if (notEqual) { + assert.notStrictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); + } + else { + assert.strictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); + } + } + + function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { + const { reqName, request, expectedResponse, expectedResponseNoMap, expectedResponseNoDts } = actionGetter(fn); + const { response } = session.executeCommandSeq(request); + return { reqName, response, expectedResponse, expectedResponseNoMap, expectedResponseNoDts }; + } + + function firstAction(session: TestSession) { + actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); + } + + function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo | undefined, isFirst: boolean) => void, dtsAbsent?: true) { + // action + let isFirst = true; + for (const actionGetter of actionGetters) { + for (let fn = 1; fn <= 5; fn++) { + const result = action(actionGetter, fn, session); + const dtsInfo = session.getProjectService().filenameToScriptInfo.get(dtsPath); + if (dtsAbsent) { + assert.isUndefined(dtsInfo); + } + else { + assert.isDefined(dtsInfo); + } + verifyAction(result, dtsInfo, isFirst); + isFirst = false; + } + } + } + + function verifyAllFnAction( + session: TestSession, + host: TestServerHost, + firstDocumentPositionMapperNotEquals?: true, + dependencyMap?: server.ScriptInfo, + documentPositionMapper?: server.ScriptInfo["documentPositionMapper"] + ) { + // action + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse }, dtsInfo, isFirst) => { + assert.deepEqual(response, expectedResponse, `Failed on ${reqName}`); + verifyInfos(session, host); + assert.equal(dtsInfo!.sourceMapFilePath, dtsMapPath); + if (isFirst) { + if (dependencyMap) { + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); + documentPositionMapper = dependencyMap.documentPositionMapper; + } + else { + dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; + documentPositionMapper = dependencyMap.documentPositionMapper; + } + } + else { + verifyDocumentPositionMapper(session, dependencyMap!, documentPositionMapper); + } + }); + return { dependencyMap: dependencyMap!, documentPositionMapper }; + } + + function verifyAllFnActionWithNoMap( + session: TestSession, + host: TestServerHost, + dependencyTsOK?: true + ) { + let sourceMapFilePath: server.ScriptInfo["sourceMapFilePath"]; + // action + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoMap }, dtsInfo, isFirst) => { + assert.deepEqual(response, expectedResponseNoMap || expectedResponse, `Failed on ${reqName}`); + verifyInfosWhenNoMapFile(session, host, dependencyTsOK); + assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); + if (isFirst) { + assert.isNotString(dtsInfo!.sourceMapFilePath); + assert.isNotFalse(dtsInfo!.sourceMapFilePath); + assert.isDefined(dtsInfo!.sourceMapFilePath); + sourceMapFilePath = dtsInfo!.sourceMapFilePath; + } + else { + assert.equal(dtsInfo!.sourceMapFilePath, sourceMapFilePath); + } + }); + return sourceMapFilePath; + } + + function verifyAllFnActionWithNoDts( + session: TestSession, + host: TestServerHost, + dependencyTsAndMapOk?: true + ) { + // action + verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoDts }) => { + assert.deepEqual(response, expectedResponseNoDts || expectedResponse, `Failed on ${reqName}`); + verifyInfosWhenNoDtsFile(session, host, dependencyTsAndMapOk); + }, /*dtsAbsent*/ true); + } + + function verifyScenarioWithChangesWorker( + change: (host: TestServerHost, session: TestSession) => void, + afterActionDocumentPositionMapperNotEquals: true | undefined, + timeoutBeforeAction: boolean + ) { + const { host, session } = openTsFile(); + + // Create DocumentPositionMapper + firstAction(session); + const dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; + const documentPositionMapper = dependencyMap.documentPositionMapper; + + // change + change(host, session); + if (timeoutBeforeAction) { + host.runQueuedTimeoutCallbacks(); + checkProject(session); + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); + } + + // action + verifyAllFnAction(session, host, afterActionDocumentPositionMapperNotEquals, dependencyMap, documentPositionMapper); + } + + function verifyScenarioWithChanges( + scenarioName: string, + change: (host: TestServerHost, session: TestSession) => void, + afterActionDocumentPositionMapperNotEquals?: true + ) { + describe(scenarioName, () => { + it("when timeout occurs before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ true); + }); + + it("when timeout does not occur before request", () => { + verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ false); + }); + }); + } + + function verifyMainScenarioAndScriptInfoCollection(session: TestSession, host: TestServerHost) { + // Main scenario action + const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, host); + checkProject(session); + verifyInfos(session, host); + + // Collecting at this point retains dependency.d.ts and map + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfos(session, host); + verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); + + // Closing open file, removes dependencies too + closeFilesForSession([...openFiles, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(session, host); + } + + function verifyMainScenarioAndScriptInfoCollectionWithNoMap(session: TestSession, host: TestServerHost, dependencyTsOKInScenario?: true) { + // Main scenario action + verifyAllFnActionWithNoMap(session, host, dependencyTsOKInScenario); + + // Collecting at this point retains dependency.d.ts and map watcher + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfosWhenNoMapFile(session, host); + + // Closing open file, removes dependencies too + closeFilesForSession([...openFiles, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(session, host); + } + + function verifyMainScenarioAndScriptInfoCollectionWithNoDts(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { + // Main scenario action + verifyAllFnActionWithNoDts(session, host, dependencyTsAndMapOk); + + // Collecting at this point retains dependency.d.ts and map watcher + closeFilesForSession([randomFile], session); + openFilesForSession([randomFile], session); + verifyInfosWhenNoDtsFile(session, host); + + // Closing open file, removes dependencies too + closeFilesForSession([...openFiles, randomFile], session); + openFilesForSession([randomFile], session); + verifyOnlyRandomInfos(session, host); + } + + function verifyScenarioWhenFileNotPresent( + scenarioName: string, + fileLocation: string, + verifyScenarioAndScriptInfoCollection: (session: TestSession, host: TestServerHost, dependencyTsOk?: true) => void, + noDts?: true + ) { + describe(scenarioName, () => { + it(mainScenario, () => { + const { host, session } = openTsFile(host => host.deleteFile(fileLocation)); + checkProject(session, noDts); + + verifyScenarioAndScriptInfoCollection(session, host); + }); + + it("when file is created", () => { + let fileContents: string | undefined; + const { host, session } = openTsFile(host => { + fileContents = host.readFile(fileLocation); + host.deleteFile(fileLocation); + }); + firstAction(session); + + host.writeFile(fileLocation, fileContents!); + verifyMainScenarioAndScriptInfoCollection(session, host); + }); + + it("when file is deleted", () => { + const { host, session } = openTsFile(); + firstAction(session); + + // The dependency file is deleted when orphan files are collected + host.deleteFile(fileLocation); + verifyScenarioAndScriptInfoCollection(session, host, /*dependencyTsOk*/ true); + }); + }); + } + + it(mainScenario, () => { + const { host, session } = openTsFile(); + checkProject(session); + + verifyMainScenarioAndScriptInfoCollection(session, host); + }); + + // Edit + verifyScenarioWithChanges( + "when usage file changes, document position mapper doesnt change", + (_host, session) => openFiles.forEach( + (openFile, index) => session.executeCommandSeq({ + command: protocol.CommandTypes.Change, + arguments: { file: openFile.path, line: openFileLastLines[index], offset: 1, endLine: openFileLastLines[index], endOffset: 1, insertString: "const x = 10;" } + }) + ) + ); + + // Edit dts to add new fn + verifyScenarioWithChanges( + "when dependency .d.ts changes, document position mapper doesnt change", + host => host.writeFile( + dtsLocation, + host.readFile(dtsLocation)!.replace( + "//# sourceMappingURL=FnS.d.ts.map", + `export declare function fn6(): void; +//# sourceMappingURL=FnS.d.ts.map` + ) + ) + ); + + // Edit map file to represent added new line + verifyScenarioWithChanges( + "when dependency file's map changes", + host => host.writeFile( + dtsMapLocation, + `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,eAAO,MAAM,CAAC,KAAK,CAAC"}` + ), + /*afterActionDocumentPositionMapperNotEquals*/ true + ); + + verifyScenarioWhenFileNotPresent( + "when map file is not present", + dtsMapLocation, + verifyMainScenarioAndScriptInfoCollectionWithNoMap + ); + + verifyScenarioWhenFileNotPresent( + "when .d.ts file is not present", + dtsLocation, + verifyMainScenarioAndScriptInfoCollectionWithNoDts, + /*noDts*/ true + ); + } + + const usageVerifier: DocumentPositionMapperVerifier = { + openFile: mainTs, + expectedProjectActualFiles: [mainTs.path, libFile.path, mainConfig.path, dtsPath], + actionGetter: gotoDefintinionFromMainTs, + openFileLastLine: 14 + }; + describe("from project that uses dependency", () => { + const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, dtsPath, dtsMapLocation]; + verifyDocumentPositionMapperUpdates( + "can go to definition correctly", + [usageVerifier], + closedInfos + ); + }); + + const definingVerifier: DocumentPositionMapperVerifier = { + openFile: dependencyTs, + expectedProjectActualFiles: [dependencyTs.path, libFile.path, dependencyConfig.path], + actionGetter: renameFromDependencyTs, + openFileLastLine: 6 + }; + describe("from defining project", () => { + const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; + verifyDocumentPositionMapperUpdates( + "rename locations from dependency", + [definingVerifier], + closedInfos + ); + }); + + describe("when opening depedency and usage project", () => { + const closedInfos = [libFile.path, dtsPath, dtsMapLocation, dependencyConfig.path]; + verifyDocumentPositionMapperUpdates( + "goto Definition in usage and rename locations from defining project", + [usageVerifier, { ...definingVerifier, actionGetter: renameFromDependencyTsWithBothProjectsOpen }], + closedInfos + ); + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/refactors.ts b/src/testRunner/unittests/tsserver/refactors.ts new file mode 100644 index 00000000000..2e916f50f9b --- /dev/null +++ b/src/testRunner/unittests/tsserver/refactors.ts @@ -0,0 +1,120 @@ +namespace ts.projectSystem { + describe("tsserver:: refactors", () => { + it("use formatting options", () => { + const file = { + path: "/a.ts", + content: "function f() {\n 1;\n}", + }; + const host = createServerHost([file]); + const session = createSession(host); + openFilesForSession([file], session); + + const response0 = session.executeCommandSeq({ + command: server.protocol.CommandTypes.Configure, + arguments: { + formatOptions: { + indentSize: 2, + }, + }, + }).response; + assert.deepEqual(response0, /*expected*/ undefined); + + const response1 = session.executeCommandSeq({ + command: server.protocol.CommandTypes.GetEditsForRefactor, + arguments: { + refactor: "Extract Symbol", + action: "function_scope_1", + file: "/a.ts", + startLine: 2, + startOffset: 3, + endLine: 2, + endOffset: 4, + }, + }).response; + assert.deepEqual(response1, { + edits: [ + { + fileName: "/a.ts", + textChanges: [ + { + start: { line: 2, offset: 3 }, + end: { line: 2, offset: 5 }, + newText: "newFunction();", + }, + { + start: { line: 3, offset: 2 }, + end: { line: 3, offset: 2 }, + newText: "\n\nfunction newFunction() {\n 1;\n}\n", + }, + ] + } + ], + renameFilename: "/a.ts", + renameLocation: { line: 2, offset: 3 }, + }); + }); + + it("handles text changes in tsconfig.json", () => { + const aTs = { + path: "/a.ts", + content: "export const a = 0;", + }; + const tsconfig = { + path: "/tsconfig.json", + content: '{ "files": ["./a.ts"] }', + }; + + const session = createSession(createServerHost([aTs, tsconfig])); + openFilesForSession([aTs], session); + + const response1 = session.executeCommandSeq({ + command: server.protocol.CommandTypes.GetEditsForRefactor, + arguments: { + refactor: "Move to a new file", + action: "Move to a new file", + file: "/a.ts", + startLine: 1, + startOffset: 1, + endLine: 1, + endOffset: 20, + }, + }).response; + assert.deepEqual(response1, { + edits: [ + { + fileName: "/a.ts", + textChanges: [ + { + start: { line: 1, offset: 1 }, + end: { line: 1, offset: 20 }, + newText: "", + }, + ], + }, + { + fileName: "/tsconfig.json", + textChanges: [ + { + start: { line: 1, offset: 21 }, + end: { line: 1, offset: 21 }, + newText: ", \"./a.1.ts\"", + }, + ], + }, + { + fileName: "/a.1.ts", + textChanges: [ + { + start: { line: 0, offset: 0 }, + end: { line: 0, offset: 0 }, + newText: "export const a = 0;\n", + }, + ], + } + ], + renameFilename: undefined, + renameLocation: undefined, + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/rename.ts b/src/testRunner/unittests/tsserver/rename.ts new file mode 100644 index 00000000000..3b4d77263e6 --- /dev/null +++ b/src/testRunner/unittests/tsserver/rename.ts @@ -0,0 +1,53 @@ +namespace ts.projectSystem { + describe("tsserver:: rename", () => { + it("works with fileToRename", () => { + const aTs: File = { path: "/a.ts", content: "export const a = 0;" }; + const bTs: File = { path: "/b.ts", content: 'import { a } from "./a";' }; + + const session = createSession(createServerHost([aTs, bTs])); + openFilesForSession([bTs], session); + + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(bTs, 'a";')); + assert.deepEqual(response, { + info: { + canRename: true, + fileToRename: aTs.path, + displayName: aTs.path, + fullDisplayName: aTs.path, + kind: ScriptElementKind.moduleElement, + kindModifiers: "", + triggerSpan: protocolTextSpanFromSubstring(bTs.content, "a", { index: 1 }), + }, + locs: [{ file: bTs.path, locs: [protocolRenameSpanFromSubstring(bTs.content, "./a")] }], + }); + }); + + it("works with prefixText and suffixText", () => { + const aTs: File = { path: "/a.ts", content: "const x = 0; const o = { x };" }; + const session = createSession(createServerHost([aTs])); + openFilesForSession([aTs], session); + + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "x")); + assert.deepEqual(response, { + info: { + canRename: true, + fileToRename: undefined, + displayName: "x", + fullDisplayName: "x", + kind: ScriptElementKind.constElement, + kindModifiers: ScriptElementKindModifier.none, + triggerSpan: protocolTextSpanFromSubstring(aTs.content, "x"), + }, + locs: [ + { + file: aTs.path, + locs: [ + protocolRenameSpanFromSubstring(aTs.content, "x"), + protocolRenameSpanFromSubstring(aTs.content, "x", { index: 1 }, { prefixText: "x: " }), + ], + }, + ], + }); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/resolutionCache.ts b/src/testRunner/unittests/tsserver/resolutionCache.ts index a07cb7721d4..9f75455e226 100644 --- a/src/testRunner/unittests/tsserver/resolutionCache.ts +++ b/src/testRunner/unittests/tsserver/resolutionCache.ts @@ -5,7 +5,7 @@ namespace ts.projectSystem { return resolutionTrace; } - describe("resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { + describe("tsserver:: resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { it("can load typings that are proper modules", () => { const file1 = { path: "/a/b/app.js", @@ -46,7 +46,7 @@ namespace ts.projectSystem { }); }); - describe("resolutionCache:: tsserverProjectSystem watching @types", () => { + describe("tsserver:: resolutionCache:: tsserverProjectSystem watching @types", () => { it("works correctly when typings are added or removed", () => { const f1 = { path: "/a/b/app.ts", @@ -92,7 +92,7 @@ namespace ts.projectSystem { }); }); - describe("resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { + describe("tsserver:: resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { it("should remove the `module not found` error", () => { const moduleFile = { path: "/a/b/moduleFile.ts", @@ -358,7 +358,7 @@ namespace ts.projectSystem { }); }); - describe("resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { + describe("tsserver:: resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { it("should restore the states for inferred projects", () => { const moduleFile = { path: "/a/b/moduleFile.ts", @@ -493,7 +493,7 @@ namespace ts.projectSystem { }); }); - describe("resolutionCache:: tsserverProjectSystem module resolution caching", () => { + describe("tsserver:: resolutionCache:: tsserverProjectSystem module resolution caching", () => { const projectLocation = "/user/username/projects/myproject"; const configFile: File = { path: `${projectLocation}/tsconfig.json`, diff --git a/src/testRunner/unittests/tsserver/syntaxOperations.ts b/src/testRunner/unittests/tsserver/syntaxOperations.ts new file mode 100644 index 00000000000..c2ec877137a --- /dev/null +++ b/src/testRunner/unittests/tsserver/syntaxOperations.ts @@ -0,0 +1,98 @@ +namespace ts.projectSystem { + describe("tsserver:: syntax operations", () => { + function navBarFull(session: TestSession, file: File) { + return JSON.stringify(session.executeCommandSeq({ + command: protocol.CommandTypes.NavBarFull, + arguments: { file: file.path } + }).response); + } + + function openFile(session: TestSession, file: File) { + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { file: file.path, fileContent: file.content } + }); + } + + it("works when file is removed and added with different content", () => { + const projectRoot = "/user/username/projects/myproject"; + const app: File = { + path: `${projectRoot}/app.ts`, + content: "console.log('Hello world');" + }; + const unitTest1: File = { + path: `${projectRoot}/unitTest1.ts`, + content: `import assert = require('assert'); + +describe("Test Suite 1", () => { + it("Test A", () => { + assert.ok(true, "This shouldn't fail"); + }); + + it("Test B", () => { + assert.ok(1 === 1, "This shouldn't fail"); + assert.ok(false, "This should fail"); + }); +});` + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: "{}" + }; + const files = [app, libFile, tsconfig]; + const host = createServerHost(files); + const session = createSession(host); + const service = session.getProjectService(); + openFile(session, app); + + checkNumberOfProjects(service, { configuredProjects: 1 }); + const project = service.configuredProjects.get(tsconfig.path)!; + const expectedFilesWithoutUnitTest1 = files.map(f => f.path); + checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); + + host.writeFile(unitTest1.path, unitTest1.content); + host.runQueuedTimeoutCallbacks(); + const expectedFilesWithUnitTest1 = expectedFilesWithoutUnitTest1.concat(unitTest1.path); + checkProjectActualFiles(project, expectedFilesWithUnitTest1); + + openFile(session, unitTest1); + checkProjectActualFiles(project, expectedFilesWithUnitTest1); + + const navBarResultUnitTest1 = navBarFull(session, unitTest1); + host.deleteFile(unitTest1.path); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); + + session.executeCommandSeq({ + command: protocol.CommandTypes.Close, + arguments: { file: unitTest1.path } + }); + checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); + + const unitTest1WithChangedContent: File = { + path: unitTest1.path, + content: `import assert = require('assert'); + +export function Test1() { + assert.ok(true, "This shouldn't fail"); +}; + +export function Test2() { + assert.ok(1 === 1, "This shouldn't fail"); + assert.ok(false, "This should fail"); +};` + }; + host.writeFile(unitTest1.path, unitTest1WithChangedContent.content); + host.runQueuedTimeoutCallbacks(); + checkProjectActualFiles(project, expectedFilesWithUnitTest1); + + openFile(session, unitTest1WithChangedContent); + checkProjectActualFiles(project, expectedFilesWithUnitTest1); + const sourceFile = project.getLanguageService().getNonBoundSourceFile(unitTest1WithChangedContent.path); + assert.strictEqual(sourceFile.text, unitTest1WithChangedContent.content); + + const navBarResultUnitTest1WithChangedContent = navBarFull(session, unitTest1WithChangedContent); + assert.notStrictEqual(navBarResultUnitTest1WithChangedContent, navBarResultUnitTest1, "With changes in contents of unitTest file, we should see changed naviagation bar item result"); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/telemetry.ts b/src/testRunner/unittests/tsserver/telemetry.ts index f2a7d854124..4f4d8ba8b19 100644 --- a/src/testRunner/unittests/tsserver/telemetry.ts +++ b/src/testRunner/unittests/tsserver/telemetry.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("project telemetry", () => { + describe("tsserver:: project telemetry", () => { it("does nothing for inferred project", () => { const file = makeFile("/a.js"); const et = new TestServerEventManager([file]); diff --git a/src/testRunner/unittests/tsserver/textStorage.ts b/src/testRunner/unittests/tsserver/textStorage.ts index 0bb14aa2d90..157734da931 100644 --- a/src/testRunner/unittests/tsserver/textStorage.ts +++ b/src/testRunner/unittests/tsserver/textStorage.ts @@ -1,5 +1,5 @@ namespace ts.textStorage { - describe("Text storage", () => { + describe("tsserver:: Text storage", () => { const f = { path: "/a/app.ts", content: ` diff --git a/src/testRunner/unittests/tsserver/typeAquisition.ts b/src/testRunner/unittests/tsserver/typeAquisition.ts new file mode 100644 index 00000000000..9f487896e03 --- /dev/null +++ b/src/testRunner/unittests/tsserver/typeAquisition.ts @@ -0,0 +1,52 @@ +namespace ts.projectSystem { + describe("tsserver:: autoDiscovery", () => { + it("does not depend on extension", () => { + const file1 = { + path: "/a/b/app.html", + content: "" + }; + const file2 = { + path: "/a/b/app.d.ts", + content: "" + }; + const host = createServerHost([file1, file2]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + projectFileName: "/a/b/proj.csproj", + rootFiles: [toExternalFile(file2.path), { fileName: file1.path, hasMixedContent: true, scriptKind: ScriptKind.JS }], + options: {} + }); + projectService.checkNumberOfProjects({ externalProjects: 1 }); + const typeAcquisition = projectService.externalProjects[0].getTypeAcquisition(); + assert.isTrue(typeAcquisition.enable, "Typine acquisition should be enabled"); + }); + }); + + describe("tsserver:: prefer typings to js", () => { + it("during second resolution pass", () => { + const typingsCacheLocation = "/a/typings"; + const f1 = { + path: "/a/b/app.js", + content: "var x = require('bar')" + }; + const barjs = { + path: "/a/b/node_modules/bar/index.js", + content: "export let x = 1" + }; + const barTypings = { + path: `${typingsCacheLocation}/node_modules/@types/bar/index.d.ts`, + content: "export let y: number" + }; + const config = { + path: "/a/b/jsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true }, exclude: ["node_modules"] }) + }; + const host = createServerHost([f1, barjs, barTypings, config]); + const projectService = createProjectService(host, { typingsInstaller: new TestTypingsInstaller(typingsCacheLocation, /*throttleLimit*/ 5, host) }); + + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, barTypings.path, config.path]); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts b/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts new file mode 100644 index 00000000000..8318f402a1a --- /dev/null +++ b/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts @@ -0,0 +1,87 @@ +namespace ts.projectSystem { + describe("tsserver:: typeReferenceDirectives", () => { + it("when typeReferenceDirective contains UpperCasePackage", () => { + const projectLocation = "/user/username/projects/myproject"; + const libProjectLocation = `${projectLocation}/lib`; + const typeLib: File = { + path: `${libProjectLocation}/@types/UpperCasePackage/index.d.ts`, + content: `declare class BrokenTest { + constructor(name: string, width: number, height: number, onSelect: Function); + Name: string; + SelectedFile: string; +}` + }; + const appLib: File = { + path: `${libProjectLocation}/@app/lib/index.d.ts`, + content: `/// +declare class TestLib { + issue: BrokenTest; + constructor(); + test(): void; +}` + }; + const testProjectLocation = `${projectLocation}/test`; + const testFile: File = { + path: `${testProjectLocation}/test.ts`, + content: `class TestClass1 { + + constructor() { + var l = new TestLib(); + + } + + public test2() { + var x = new BrokenTest('',0,0,null); + + } +}` + }; + const testConfig: File = { + path: `${testProjectLocation}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { + module: "amd", + typeRoots: ["../lib/@types", "../lib/@app"] + } + }) + }; + + const files = [typeLib, appLib, testFile, testConfig, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(testFile.path); + checkNumberOfProjects(service, { configuredProjects: 1 }); + const project = service.configuredProjects.get(testConfig.path)!; + checkProjectActualFiles(project, files.map(f => f.path)); + host.writeFile(appLib.path, appLib.content.replace("test()", "test2()")); + host.checkTimeoutQueueLengthAndRun(2); + }); + + it("when typeReferenceDirective is relative path and in a sibling folder", () => { + const projectRootPath = "/user/username/projects/browser-addon"; + const projectPath = `${projectRootPath}/background`; + const file: File = { + path: `${projectPath}/a.ts`, + content: "let x = 10;" + }; + const tsconfig: File = { + path: `${projectPath}/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { + types: [ + "../typedefs/filesystem" + ] + } + }) + }; + const filesystem: File = { + path: `${projectRootPath}/typedefs/filesystem.d.ts`, + content: `interface LocalFileSystem { someProperty: string; }` + }; + const files = [file, tsconfig, filesystem, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(file.path); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/typingsInstaller.ts b/src/testRunner/unittests/tsserver/typingsInstaller.ts index f0cd9549e6c..18117a5f961 100644 --- a/src/testRunner/unittests/tsserver/typingsInstaller.ts +++ b/src/testRunner/unittests/tsserver/typingsInstaller.ts @@ -47,7 +47,7 @@ namespace ts.projectSystem { import typingsName = TI.typingsName; - describe("typingsInstaller:: local module", () => { + describe("tsserver:: typingsInstaller:: local module", () => { it("should not be picked up", () => { const f1 = { path: "/a/app.js", @@ -86,7 +86,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: General functionality", () => { + describe("tsserver:: typingsInstaller:: General functionality", () => { it("configured projects (typings installed) 1", () => { const file1 = { path: "/a/b/app.js", @@ -1249,7 +1249,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: Validate package name:", () => { + describe("tsserver:: typingsInstaller:: Validate package name:", () => { it("name cannot be too long", () => { let packageName = "a"; for (let i = 0; i < 8; i++) { @@ -1273,7 +1273,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: Invalid package names", () => { + describe("tsserver:: typingsInstaller:: Invalid package names", () => { it("should not be installed", () => { const f1 = { path: "/a/b/app.js", @@ -1305,7 +1305,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: discover typings", () => { + describe("tsserver:: typingsInstaller:: discover typings", () => { const emptySafeList = emptyMap; it("should use mappings from safe list", () => { @@ -1517,7 +1517,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: telemetry events", () => { + describe("tsserver:: typingsInstaller:: telemetry events", () => { it("should be received", () => { const f1 = { path: "/a/app.js", @@ -1567,7 +1567,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: progress notifications", () => { + describe("tsserver:: typingsInstaller:: progress notifications", () => { it("should be sent for success", () => { const f1 = { path: "/a/app.js", @@ -1676,7 +1676,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: npm installation command", () => { + describe("tsserver:: typingsInstaller:: npm installation command", () => { const npmPath = "npm", tsVersion = "2.9.0-dev.20180410"; const packageNames = ["@types/graphql@ts2.8", "@types/highlight.js@ts2.8", "@types/jest@ts2.8", "@types/mini-css-extract-plugin@ts2.8", "@types/mongoose@ts2.8", "@types/pg@ts2.8", "@types/webpack-bundle-analyzer@ts2.8", "@types/enhanced-resolve@ts2.8", "@types/eslint-plugin-prettier@ts2.8", "@types/friendly-errors-webpack-plugin@ts2.8", "@types/hammerjs@ts2.8", "@types/history@ts2.8", "@types/image-size@ts2.8", "@types/js-cookie@ts2.8", "@types/koa-compress@ts2.8", "@types/less@ts2.8", "@types/material-ui@ts2.8", "@types/mysql@ts2.8", "@types/nodemailer@ts2.8", "@types/prettier@ts2.8", "@types/query-string@ts2.8", "@types/react-places-autocomplete@ts2.8", "@types/react-router@ts2.8", "@types/react-router-config@ts2.8", "@types/react-select@ts2.8", "@types/react-transition-group@ts2.8", "@types/redux-form@ts2.8", "@types/abbrev@ts2.8", "@types/accepts@ts2.8", "@types/acorn@ts2.8", "@types/ansi-regex@ts2.8", "@types/ansi-styles@ts2.8", "@types/anymatch@ts2.8", "@types/apollo-codegen@ts2.8", "@types/are-we-there-yet@ts2.8", "@types/argparse@ts2.8", "@types/arr-union@ts2.8", "@types/array-find-index@ts2.8", "@types/array-uniq@ts2.8", "@types/array-unique@ts2.8", "@types/arrify@ts2.8", "@types/assert-plus@ts2.8", "@types/async@ts2.8", "@types/autoprefixer@ts2.8", "@types/aws4@ts2.8", "@types/babel-code-frame@ts2.8", "@types/babel-generator@ts2.8", "@types/babel-plugin-syntax-jsx@ts2.8", "@types/babel-template@ts2.8", "@types/babel-traverse@ts2.8", "@types/babel-types@ts2.8", "@types/babylon@ts2.8", "@types/base64-js@ts2.8", "@types/basic-auth@ts2.8", "@types/big.js@ts2.8", "@types/bl@ts2.8", "@types/bluebird@ts2.8", "@types/body-parser@ts2.8", "@types/bonjour@ts2.8", "@types/boom@ts2.8", "@types/brace-expansion@ts2.8", "@types/braces@ts2.8", "@types/brorand@ts2.8", "@types/browser-resolve@ts2.8", "@types/bson@ts2.8", "@types/buffer-equal@ts2.8", "@types/builtin-modules@ts2.8", "@types/bytes@ts2.8", "@types/callsites@ts2.8", "@types/camelcase@ts2.8", "@types/camelcase-keys@ts2.8", "@types/caseless@ts2.8", "@types/change-emitter@ts2.8", "@types/check-types@ts2.8", "@types/cheerio@ts2.8", "@types/chokidar@ts2.8", "@types/chownr@ts2.8", "@types/circular-json@ts2.8", "@types/classnames@ts2.8", "@types/clean-css@ts2.8", "@types/clone@ts2.8", "@types/co-body@ts2.8", "@types/color@ts2.8", "@types/color-convert@ts2.8", "@types/color-name@ts2.8", "@types/color-string@ts2.8", "@types/colors@ts2.8", "@types/combined-stream@ts2.8", "@types/common-tags@ts2.8", "@types/component-emitter@ts2.8", "@types/compressible@ts2.8", "@types/compression@ts2.8", "@types/concat-stream@ts2.8", "@types/connect-history-api-fallback@ts2.8", "@types/content-disposition@ts2.8", "@types/content-type@ts2.8", "@types/convert-source-map@ts2.8", "@types/cookie@ts2.8", "@types/cookie-signature@ts2.8", "@types/cookies@ts2.8", "@types/core-js@ts2.8", "@types/cosmiconfig@ts2.8", "@types/create-react-class@ts2.8", "@types/cross-spawn@ts2.8", "@types/cryptiles@ts2.8", "@types/css-modules-require-hook@ts2.8", "@types/dargs@ts2.8", "@types/dateformat@ts2.8", "@types/debug@ts2.8", "@types/decamelize@ts2.8", "@types/decompress@ts2.8", "@types/decompress-response@ts2.8", "@types/deep-equal@ts2.8", "@types/deep-extend@ts2.8", "@types/deepmerge@ts2.8", "@types/defined@ts2.8", "@types/del@ts2.8", "@types/depd@ts2.8", "@types/destroy@ts2.8", "@types/detect-indent@ts2.8", "@types/detect-newline@ts2.8", "@types/diff@ts2.8", "@types/doctrine@ts2.8", "@types/download@ts2.8", "@types/draft-js@ts2.8", "@types/duplexer2@ts2.8", "@types/duplexer3@ts2.8", "@types/duplexify@ts2.8", "@types/ejs@ts2.8", "@types/end-of-stream@ts2.8", "@types/entities@ts2.8", "@types/escape-html@ts2.8", "@types/escape-string-regexp@ts2.8", "@types/escodegen@ts2.8", "@types/eslint-scope@ts2.8", "@types/eslint-visitor-keys@ts2.8", "@types/esprima@ts2.8", "@types/estraverse@ts2.8", "@types/etag@ts2.8", "@types/events@ts2.8", "@types/execa@ts2.8", "@types/exenv@ts2.8", "@types/exit@ts2.8", "@types/exit-hook@ts2.8", "@types/expect@ts2.8", "@types/express@ts2.8", "@types/express-graphql@ts2.8", "@types/extend@ts2.8", "@types/extract-zip@ts2.8", "@types/fancy-log@ts2.8", "@types/fast-diff@ts2.8", "@types/fast-levenshtein@ts2.8", "@types/figures@ts2.8", "@types/file-type@ts2.8", "@types/filenamify@ts2.8", "@types/filesize@ts2.8", "@types/finalhandler@ts2.8", "@types/find-root@ts2.8", "@types/find-up@ts2.8", "@types/findup-sync@ts2.8", "@types/forever-agent@ts2.8", "@types/form-data@ts2.8", "@types/forwarded@ts2.8", "@types/fresh@ts2.8", "@types/from2@ts2.8", "@types/fs-extra@ts2.8", "@types/get-caller-file@ts2.8", "@types/get-stdin@ts2.8", "@types/get-stream@ts2.8", "@types/get-value@ts2.8", "@types/glob-base@ts2.8", "@types/glob-parent@ts2.8", "@types/glob-stream@ts2.8", "@types/globby@ts2.8", "@types/globule@ts2.8", "@types/got@ts2.8", "@types/graceful-fs@ts2.8", "@types/gulp-rename@ts2.8", "@types/gulp-sourcemaps@ts2.8", "@types/gulp-util@ts2.8", "@types/gzip-size@ts2.8", "@types/handlebars@ts2.8", "@types/has-ansi@ts2.8", "@types/hasha@ts2.8", "@types/he@ts2.8", "@types/hoek@ts2.8", "@types/html-entities@ts2.8", "@types/html-minifier@ts2.8", "@types/htmlparser2@ts2.8", "@types/http-assert@ts2.8", "@types/http-errors@ts2.8", "@types/http-proxy@ts2.8", "@types/http-proxy-middleware@ts2.8", "@types/indent-string@ts2.8", "@types/inflected@ts2.8", "@types/inherits@ts2.8", "@types/ini@ts2.8", "@types/inline-style-prefixer@ts2.8", "@types/inquirer@ts2.8", "@types/internal-ip@ts2.8", "@types/into-stream@ts2.8", "@types/invariant@ts2.8", "@types/ip@ts2.8", "@types/ip-regex@ts2.8", "@types/is-absolute-url@ts2.8", "@types/is-binary-path@ts2.8", "@types/is-finite@ts2.8", "@types/is-glob@ts2.8", "@types/is-my-json-valid@ts2.8", "@types/is-number@ts2.8", "@types/is-object@ts2.8", "@types/is-path-cwd@ts2.8", "@types/is-path-in-cwd@ts2.8", "@types/is-promise@ts2.8", "@types/is-scoped@ts2.8", "@types/is-stream@ts2.8", "@types/is-svg@ts2.8", "@types/is-url@ts2.8", "@types/is-windows@ts2.8", "@types/istanbul-lib-coverage@ts2.8", "@types/istanbul-lib-hook@ts2.8", "@types/istanbul-lib-instrument@ts2.8", "@types/istanbul-lib-report@ts2.8", "@types/istanbul-lib-source-maps@ts2.8", "@types/istanbul-reports@ts2.8", "@types/jest-diff@ts2.8", "@types/jest-docblock@ts2.8", "@types/jest-get-type@ts2.8", "@types/jest-matcher-utils@ts2.8", "@types/jest-validate@ts2.8", "@types/jpeg-js@ts2.8", "@types/js-base64@ts2.8", "@types/js-string-escape@ts2.8", "@types/js-yaml@ts2.8", "@types/jsbn@ts2.8", "@types/jsdom@ts2.8", "@types/jsesc@ts2.8", "@types/json-parse-better-errors@ts2.8", "@types/json-schema@ts2.8", "@types/json-stable-stringify@ts2.8", "@types/json-stringify-safe@ts2.8", "@types/json5@ts2.8", "@types/jsonfile@ts2.8", "@types/jsontoxml@ts2.8", "@types/jss@ts2.8", "@types/keygrip@ts2.8", "@types/keymirror@ts2.8", "@types/keyv@ts2.8", "@types/klaw@ts2.8", "@types/koa-send@ts2.8", "@types/leven@ts2.8", "@types/listr@ts2.8", "@types/load-json-file@ts2.8", "@types/loader-runner@ts2.8", "@types/loader-utils@ts2.8", "@types/locate-path@ts2.8", "@types/lodash-es@ts2.8", "@types/lodash.assign@ts2.8", "@types/lodash.camelcase@ts2.8", "@types/lodash.clonedeep@ts2.8", "@types/lodash.debounce@ts2.8", "@types/lodash.escape@ts2.8", "@types/lodash.flowright@ts2.8", "@types/lodash.get@ts2.8", "@types/lodash.isarguments@ts2.8", "@types/lodash.isarray@ts2.8", "@types/lodash.isequal@ts2.8", "@types/lodash.isobject@ts2.8", "@types/lodash.isstring@ts2.8", "@types/lodash.keys@ts2.8", "@types/lodash.memoize@ts2.8", "@types/lodash.merge@ts2.8", "@types/lodash.mergewith@ts2.8", "@types/lodash.pick@ts2.8", "@types/lodash.sortby@ts2.8", "@types/lodash.tail@ts2.8", "@types/lodash.template@ts2.8", "@types/lodash.throttle@ts2.8", "@types/lodash.unescape@ts2.8", "@types/lodash.uniq@ts2.8", "@types/log-symbols@ts2.8", "@types/log-update@ts2.8", "@types/loglevel@ts2.8", "@types/loud-rejection@ts2.8", "@types/lru-cache@ts2.8", "@types/make-dir@ts2.8", "@types/map-obj@ts2.8", "@types/media-typer@ts2.8", "@types/mem@ts2.8", "@types/mem-fs@ts2.8", "@types/memory-fs@ts2.8", "@types/meow@ts2.8", "@types/merge-descriptors@ts2.8", "@types/merge-stream@ts2.8", "@types/methods@ts2.8", "@types/micromatch@ts2.8", "@types/mime@ts2.8", "@types/mime-db@ts2.8", "@types/mime-types@ts2.8", "@types/minimatch@ts2.8", "@types/minimist@ts2.8", "@types/minipass@ts2.8", "@types/mkdirp@ts2.8", "@types/mongodb@ts2.8", "@types/morgan@ts2.8", "@types/move-concurrently@ts2.8", "@types/ms@ts2.8", "@types/msgpack-lite@ts2.8", "@types/multimatch@ts2.8", "@types/mz@ts2.8", "@types/negotiator@ts2.8", "@types/node-dir@ts2.8", "@types/node-fetch@ts2.8", "@types/node-forge@ts2.8", "@types/node-int64@ts2.8", "@types/node-ipc@ts2.8", "@types/node-notifier@ts2.8", "@types/nomnom@ts2.8", "@types/nopt@ts2.8", "@types/normalize-package-data@ts2.8", "@types/normalize-url@ts2.8", "@types/number-is-nan@ts2.8", "@types/object-assign@ts2.8", "@types/on-finished@ts2.8", "@types/on-headers@ts2.8", "@types/once@ts2.8", "@types/onetime@ts2.8", "@types/opener@ts2.8", "@types/opn@ts2.8", "@types/optimist@ts2.8", "@types/ora@ts2.8", "@types/os-homedir@ts2.8", "@types/os-locale@ts2.8", "@types/os-tmpdir@ts2.8", "@types/p-cancelable@ts2.8", "@types/p-each-series@ts2.8", "@types/p-event@ts2.8", "@types/p-lazy@ts2.8", "@types/p-limit@ts2.8", "@types/p-locate@ts2.8", "@types/p-map@ts2.8", "@types/p-map-series@ts2.8", "@types/p-reduce@ts2.8", "@types/p-timeout@ts2.8", "@types/p-try@ts2.8", "@types/pako@ts2.8", "@types/parse-glob@ts2.8", "@types/parse-json@ts2.8", "@types/parseurl@ts2.8", "@types/path-exists@ts2.8", "@types/path-is-absolute@ts2.8", "@types/path-parse@ts2.8", "@types/pg-pool@ts2.8", "@types/pg-types@ts2.8", "@types/pify@ts2.8", "@types/pixelmatch@ts2.8", "@types/pkg-dir@ts2.8", "@types/pluralize@ts2.8", "@types/pngjs@ts2.8", "@types/prelude-ls@ts2.8", "@types/pretty-bytes@ts2.8", "@types/pretty-format@ts2.8", "@types/progress@ts2.8", "@types/promise-retry@ts2.8", "@types/proxy-addr@ts2.8", "@types/pump@ts2.8", "@types/q@ts2.8", "@types/qs@ts2.8", "@types/range-parser@ts2.8", "@types/rc@ts2.8", "@types/rc-select@ts2.8", "@types/rc-slider@ts2.8", "@types/rc-tooltip@ts2.8", "@types/rc-tree@ts2.8", "@types/react-event-listener@ts2.8", "@types/react-side-effect@ts2.8", "@types/react-slick@ts2.8", "@types/read-chunk@ts2.8", "@types/read-pkg@ts2.8", "@types/read-pkg-up@ts2.8", "@types/recompose@ts2.8", "@types/recursive-readdir@ts2.8", "@types/relateurl@ts2.8", "@types/replace-ext@ts2.8", "@types/request@ts2.8", "@types/request-promise-native@ts2.8", "@types/require-directory@ts2.8", "@types/require-from-string@ts2.8", "@types/require-relative@ts2.8", "@types/resolve@ts2.8", "@types/resolve-from@ts2.8", "@types/retry@ts2.8", "@types/rx@ts2.8", "@types/rx-lite@ts2.8", "@types/rx-lite-aggregates@ts2.8", "@types/safe-regex@ts2.8", "@types/sane@ts2.8", "@types/sass-graph@ts2.8", "@types/sax@ts2.8", "@types/scriptjs@ts2.8", "@types/semver@ts2.8", "@types/send@ts2.8", "@types/serialize-javascript@ts2.8", "@types/serve-index@ts2.8", "@types/serve-static@ts2.8", "@types/set-value@ts2.8", "@types/shallowequal@ts2.8", "@types/shelljs@ts2.8", "@types/sockjs@ts2.8", "@types/sockjs-client@ts2.8", "@types/source-list-map@ts2.8", "@types/source-map-support@ts2.8", "@types/spdx-correct@ts2.8", "@types/spdy@ts2.8", "@types/split@ts2.8", "@types/sprintf@ts2.8", "@types/sprintf-js@ts2.8", "@types/sqlstring@ts2.8", "@types/sshpk@ts2.8", "@types/stack-utils@ts2.8", "@types/stat-mode@ts2.8", "@types/statuses@ts2.8", "@types/strict-uri-encode@ts2.8", "@types/string-template@ts2.8", "@types/strip-ansi@ts2.8", "@types/strip-bom@ts2.8", "@types/strip-json-comments@ts2.8", "@types/supports-color@ts2.8", "@types/svg2png@ts2.8", "@types/svgo@ts2.8", "@types/table@ts2.8", "@types/tapable@ts2.8", "@types/tar@ts2.8", "@types/temp@ts2.8", "@types/tempfile@ts2.8", "@types/through@ts2.8", "@types/through2@ts2.8", "@types/tinycolor2@ts2.8", "@types/tmp@ts2.8", "@types/to-absolute-glob@ts2.8", "@types/tough-cookie@ts2.8", "@types/trim@ts2.8", "@types/tryer@ts2.8", "@types/type-check@ts2.8", "@types/type-is@ts2.8", "@types/ua-parser-js@ts2.8", "@types/uglify-js@ts2.8", "@types/uglifyjs-webpack-plugin@ts2.8", "@types/underscore@ts2.8", "@types/uniq@ts2.8", "@types/uniqid@ts2.8", "@types/untildify@ts2.8", "@types/urijs@ts2.8", "@types/url-join@ts2.8", "@types/url-parse@ts2.8", "@types/url-regex@ts2.8", "@types/user-home@ts2.8", "@types/util-deprecate@ts2.8", "@types/util.promisify@ts2.8", "@types/utils-merge@ts2.8", "@types/uuid@ts2.8", "@types/vali-date@ts2.8", "@types/vary@ts2.8", "@types/verror@ts2.8", "@types/vinyl@ts2.8", "@types/vinyl-fs@ts2.8", "@types/warning@ts2.8", "@types/watch@ts2.8", "@types/watchpack@ts2.8", "@types/webpack-dev-middleware@ts2.8", "@types/webpack-sources@ts2.8", "@types/which@ts2.8", "@types/window-size@ts2.8", "@types/wrap-ansi@ts2.8", "@types/write-file-atomic@ts2.8", "@types/ws@ts2.8", "@types/xml2js@ts2.8", "@types/xmlbuilder@ts2.8", "@types/xtend@ts2.8", "@types/yallist@ts2.8", "@types/yargs@ts2.8", "@types/yauzl@ts2.8", "@types/yeoman-generator@ts2.8", "@types/zen-observable@ts2.8", "@types/react-content-loader@ts2.8"]; const expectedCommands = [ @@ -1704,7 +1704,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: recomputing resolutions of unresolved imports", () => { + describe("tsserver:: typingsInstaller:: recomputing resolutions of unresolved imports", () => { const globalTypingsCacheLocation = "/tmp"; const appPath = "/a/b/app.js" as Path; const foooPath = "/a/b/node_modules/fooo/index.d.ts"; @@ -1775,7 +1775,7 @@ namespace ts.projectSystem { }); }); - describe("typingsInstaller:: tsserver:: with inferred Project", () => { + describe("tsserver:: typingsInstaller:: tsserver:: with inferred Project", () => { it("when projectRootPath is provided", () => { const projects = "/users/username/projects"; const projectRootPath = `${projects}/san2`; diff --git a/src/testRunner/unittests/tsserver/untitledFiles.ts b/src/testRunner/unittests/tsserver/untitledFiles.ts new file mode 100644 index 00000000000..2c429707a94 --- /dev/null +++ b/src/testRunner/unittests/tsserver/untitledFiles.ts @@ -0,0 +1,45 @@ +namespace ts.projectSystem { + describe("tsserver:: Untitled files", () => { + it("Can convert positions to locations", () => { + const aTs: File = { path: "/proj/a.ts", content: "" }; + const tsconfig: File = { path: "/proj/tsconfig.json", content: "{}" }; + const session = createSession(createServerHost([aTs, tsconfig])); + + openFilesForSession([aTs], session); + + const untitledFile = "untitled:^Untitled-1"; + executeSessionRequestNoResponse(session, protocol.CommandTypes.Open, { + file: untitledFile, + fileContent: `/// \nlet foo = 1;\nfooo/**/`, + scriptKindName: "TS", + projectRootPath: "/proj", + }); + + const response = executeSessionRequest(session, protocol.CommandTypes.GetCodeFixes, { + file: untitledFile, + startLine: 3, + startOffset: 1, + endLine: 3, + endOffset: 5, + errorCodes: [Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], + }); + assert.deepEqual | undefined>(response, [ + { + description: "Change spelling to 'foo'", + fixAllDescription: "Fix all detected spelling errors", + fixId: "fixSpelling", + fixName: "spelling", + changes: [{ + fileName: untitledFile, + textChanges: [{ + start: { line: 3, offset: 1 }, + end: { line: 3, offset: 5 }, + newText: "foo", + }], + }], + commands: undefined, + }, + ]); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/versionCache.ts b/src/testRunner/unittests/tsserver/versionCache.ts index cc534b6fa5b..bd75b2bbaf4 100644 --- a/src/testRunner/unittests/tsserver/versionCache.ts +++ b/src/testRunner/unittests/tsserver/versionCache.ts @@ -15,7 +15,7 @@ namespace ts { assert.equal(editedText, checkText); } - describe(`VersionCache TS code`, () => { + describe(`tsserver:: VersionCache TS code`, () => { let validateEditAtLineCharIndex: (line: number, char: number, deleteLength: number, insertString: string) => void; before(() => { @@ -77,7 +77,7 @@ var q:Point=p;`; }); }); - describe(`VersionCache simple text`, () => { + describe(`tsserver:: VersionCache simple text`, () => { let validateEditAtPosition: (position: number, deleteLength: number, insertString: string) => void; let testContent: string; let lines: string[]; @@ -181,7 +181,7 @@ and grew 1cm per day`; }); }); - describe(`VersionCache stress test`, () => { + describe(`tsserver:: VersionCache stress test`, () => { let rsa: number[] = []; let la: number[] = []; let las: number[] = []; diff --git a/src/testRunner/unittests/tsserver/watchEnvironment.ts b/src/testRunner/unittests/tsserver/watchEnvironment.ts index 8bce3505626..5ca4d6f4570 100644 --- a/src/testRunner/unittests/tsserver/watchEnvironment.ts +++ b/src/testRunner/unittests/tsserver/watchEnvironment.ts @@ -1,6 +1,6 @@ namespace ts.projectSystem { import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; - describe("watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { + describe("tsserver:: watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { const projectFolder = "/a/username/project"; const projectSrcFolder = `${projectFolder}/src`; @@ -83,7 +83,7 @@ namespace ts.projectSystem { }); }); - describe("watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { + describe("tsserver:: watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; const configFile: File = { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 85be445171a..1f851a10c47 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -1,35 +1,5 @@ namespace ts.projectSystem { - function checkOpenFiles(projectService: server.ProjectService, expectedFiles: File[]) { - checkArray("Open files", arrayFrom(projectService.openFiles.keys(), path => projectService.getScriptInfoForPath(path as Path)!.fileName), expectedFiles.map(file => file.path)); - } - - function checkScriptInfos(projectService: server.ProjectService, expectedFiles: ReadonlyArray) { - checkArray("ScriptInfos files", arrayFrom(projectService.filenameToScriptInfo.values(), info => info.fileName), expectedFiles); - } - - function protocolFileLocationFromSubstring(file: File, substring: string): protocol.FileLocationRequestArgs { - return { file: file.path, ...protocolLocationFromSubstring(file.content, substring) }; - } - function protocolFileSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): protocol.FileSpan { - return { file: file.path, ...protocolTextSpanFromSubstring(file.content, substring, options) }; - } - function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan { - return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) }; - } - function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { - return documentSpanFromSubstring(file, substring, options); - } - describe("tsserverProjectSystem general functionality", () => { - const commonFile1: File = { - path: "/a/b/commonFile1.ts", - content: "let x = 1" - }; - const commonFile2: File = { - path: "/a/b/commonFile2.ts", - content: "let y = 1" - }; - it("create inferred project", () => { const appFile: File = { path: "/a/b/c/app.ts", @@ -3046,7 +3016,7 @@ var x = 10;` }; const tsconfig: File = { path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { } }), + content: JSON.stringify({ compilerOptions: {} }), }; const host = createServerHost([file, tsconfig]); const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); @@ -3115,7 +3085,7 @@ var x = 10;` }; const tsconfig: File = { path: `${projectRoot}/tsconfig.json`, - content: JSON.stringify({ }), + content: JSON.stringify({}), }; const host = createServerHost([file, tsconfig]); const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); @@ -3228,249 +3198,6 @@ var x = 10;` }); }); - describe("tsserverProjectSystem autoDiscovery", () => { - it("does not depend on extension", () => { - const file1 = { - path: "/a/b/app.html", - content: "" - }; - const file2 = { - path: "/a/b/app.d.ts", - content: "" - }; - const host = createServerHost([file1, file2]); - const projectService = createProjectService(host); - projectService.openExternalProject({ - projectFileName: "/a/b/proj.csproj", - rootFiles: [toExternalFile(file2.path), { fileName: file1.path, hasMixedContent: true, scriptKind: ScriptKind.JS }], - options: {} - }); - projectService.checkNumberOfProjects({ externalProjects: 1 }); - const typeAcquisition = projectService.externalProjects[0].getTypeAcquisition(); - assert.isTrue(typeAcquisition.enable, "Typine acquisition should be enabled"); - }); - }); - - describe("tsserverProjectSystem navigate-to for javascript project", () => { - function containsNavToItem(items: protocol.NavtoItem[], itemName: string, itemKind: string) { - return find(items, item => item.name === itemName && item.kind === itemKind) !== undefined; - } - - it("should not include type symbols", () => { - const file1: File = { - path: "/a/b/file1.js", - content: "function foo() {}" - }; - const configFile: File = { - path: "/a/b/jsconfig.json", - content: "{}" - }; - const host = createServerHost([file1, configFile, libFile]); - const session = createSession(host); - openFilesForSession([file1], session); - - // Try to find some interface type defined in lib.d.ts - const libTypeNavToRequest = makeSessionRequest(CommandNames.Navto, { searchValue: "Document", file: file1.path, projectFileName: configFile.path }); - const items = session.executeCommand(libTypeNavToRequest).response as protocol.NavtoItem[]; - assert.isFalse(containsNavToItem(items, "Document", "interface"), `Found lib.d.ts symbol in JavaScript project nav to request result.`); - - const localFunctionNavToRequst = makeSessionRequest(CommandNames.Navto, { searchValue: "foo", file: file1.path, projectFileName: configFile.path }); - const items2 = session.executeCommand(localFunctionNavToRequst).response as protocol.NavtoItem[]; - assert.isTrue(containsNavToItem(items2, "foo", "function"), `Cannot find function symbol "foo".`); - }); - }); - - describe("tsserverProjectSystem prefer typings to js", () => { - it("during second resolution pass", () => { - const typingsCacheLocation = "/a/typings"; - const f1 = { - path: "/a/b/app.js", - content: "var x = require('bar')" - }; - const barjs = { - path: "/a/b/node_modules/bar/index.js", - content: "export let x = 1" - }; - const barTypings = { - path: `${typingsCacheLocation}/node_modules/@types/bar/index.d.ts`, - content: "export let y: number" - }; - const config = { - path: "/a/b/jsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: true }, exclude: ["node_modules"] }) - }; - const host = createServerHost([f1, barjs, barTypings, config]); - const projectService = createProjectService(host, { typingsInstaller: new TestTypingsInstaller(typingsCacheLocation, /*throttleLimit*/ 5, host) }); - - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, barTypings.path, config.path]); - }); - }); - - describe("tsserverProjectSystem format settings", () => { - it("can be set globally", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x;" - }; - const host = createServerHost([f1]); - const projectService = createProjectService(host); - projectService.openClientFile(f1.path); - - const defaultSettings = projectService.getFormatCodeOptions(f1.path as server.NormalizedPath); - - // set global settings - const newGlobalSettings1 = { ...defaultSettings, placeOpenBraceOnNewLineForControlBlocks: !defaultSettings.placeOpenBraceOnNewLineForControlBlocks }; - projectService.setHostConfiguration({ formatOptions: newGlobalSettings1 }); - - // get format options for file - should be equal to new global settings - const s1 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); - assert.deepEqual(s1, newGlobalSettings1, "file settings should be the same with global settings"); - - // set per file format options - const newPerFileSettings = { ...defaultSettings, insertSpaceAfterCommaDelimiter: !defaultSettings.insertSpaceAfterCommaDelimiter }; - projectService.setHostConfiguration({ formatOptions: newPerFileSettings, file: f1.path }); - - // get format options for file - should be equal to new per-file settings - const s2 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); - assert.deepEqual(s2, newPerFileSettings, "file settings should be the same with per-file settings"); - - // set new global settings - they should not affect ones that were set per-file - const newGlobalSettings2 = { ...defaultSettings, insertSpaceAfterSemicolonInForStatements: !defaultSettings.insertSpaceAfterSemicolonInForStatements }; - projectService.setHostConfiguration({ formatOptions: newGlobalSettings2 }); - - // get format options for file - should be equal to new per-file settings - const s3 = projectService.getFormatCodeOptions(server.toNormalizedPath(f1.path)); - assert.deepEqual(s3, newPerFileSettings, "file settings should still be the same with per-file settings"); - }); - }); - - describe("tsserverProjectSystem Open-file", () => { - it("can be reloaded with empty content", () => { - const f = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const projectFileName = "externalProject"; - const host = createServerHost([f]); - const projectService = createProjectService(host); - // create a project - projectService.openExternalProject({ projectFileName, rootFiles: [toExternalFile(f.path)], options: {} }); - projectService.checkNumberOfProjects({ externalProjects: 1 }); - - const p = projectService.externalProjects[0]; - // force to load the content of the file - p.updateGraph(); - - const scriptInfo = p.getScriptInfo(f.path)!; - checkSnapLength(scriptInfo.getSnapshot(), f.content.length); - - // open project and replace its content with empty string - projectService.openClientFile(f.path, ""); - checkSnapLength(scriptInfo.getSnapshot(), 0); - }); - function checkSnapLength(snap: IScriptSnapshot, expectedLength: number) { - assert.equal(snap.getLength(), expectedLength, "Incorrect snapshot size"); - } - - function verifyOpenFileWorks(useCaseSensitiveFileNames: boolean) { - const file1: File = { - path: "/a/b/src/app.ts", - content: "let x = 10;" - }; - const file2: File = { - path: "/a/B/lib/module2.ts", - content: "let z = 10;" - }; - const configFile: File = { - path: "/a/b/tsconfig.json", - content: "" - }; - const configFile2: File = { - path: "/a/tsconfig.json", - content: "" - }; - const host = createServerHost([file1, file2, configFile, configFile2], { - useCaseSensitiveFileNames - }); - const service = createProjectService(host); - - // Open file1 -> configFile - verifyConfigFileName(file1, "/a", configFile); - verifyConfigFileName(file1, "/a/b", configFile); - verifyConfigFileName(file1, "/a/B", configFile); - - // Open file2 use root "/a/b" - verifyConfigFileName(file2, "/a", useCaseSensitiveFileNames ? configFile2 : configFile); - verifyConfigFileName(file2, "/a/b", useCaseSensitiveFileNames ? configFile2 : configFile); - verifyConfigFileName(file2, "/a/B", useCaseSensitiveFileNames ? undefined : configFile); - - function verifyConfigFileName(file: File, projectRoot: string, expectedConfigFile: File | undefined) { - const { configFileName } = service.openClientFile(file.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectRoot); - assert.equal(configFileName, expectedConfigFile && expectedConfigFile.path); - service.closeClientFile(file.path); - } - } - it("works when project root is used with case-sensitive system", () => { - verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ true); - }); - - it("works when project root is used with case-insensitive system", () => { - verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ false); - }); - - it("uses existing project even if project refresh is pending", () => { - 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); - service.openClientFile(aFile.path, /*fileContent*/ undefined, ScriptKind.TS, projectFolder); - verifyProject(); - - const bFile: File = { - path: `${projectFolder}/src/b.ts`, - content: `export {}; declare module "./a" { export const y: number; }` - }; - files.push(bFile); - host.reloadFS(files); - service.openClientFile(bFile.path, /*fileContent*/ undefined, ScriptKind.TS, projectFolder); - verifyProject(); - - function verifyProject() { - assert.isDefined(service.configuredProjects.get(configFile.path)); - const project = service.configuredProjects.get(configFile.path)!; - checkProjectActualFiles(project, files.map(f => f.path)); - } - }); - }); - - describe("tsserverProjectSystem Language service", () => { - it("should work correctly on case-sensitive file systems", () => { - const lib = { - path: "/a/Lib/lib.d.ts", - content: "let x: number" - }; - const f = { - path: "/a/b/app.ts", - content: "let x = 1;" - }; - const host = createServerHost([lib, f], { executingFilePath: "/a/Lib/tsc.js", useCaseSensitiveFileNames: true }); - const projectService = createProjectService(host); - projectService.openClientFile(f.path); - projectService.checkNumberOfProjects({ inferredProjects: 1 }); - projectService.inferredProjects[0].getLanguageService().getProgram(); - }); - }); - describe("tsserverProjectSystem non-existing directories listed in config file input array", () => { it("should be tolerated without crashing the server", () => { const configFile = { @@ -3551,2912 +3278,4 @@ var x = 10;` projectService.checkNumberOfProjects({ configuredProjects: 0, inferredProjects: 1 }); }); }); - - describe("tsserverProjectSystem Inferred projects", () => { - it("should support files without extensions", () => { - const f = { - path: "/a/compile", - content: "let x = 1" - }; - const host = createServerHost([f]); - const session = createSession(host); - session.executeCommand({ - seq: 1, - type: "request", - command: "compilerOptionsForInferredProjects", - arguments: { - options: { - allowJs: true - } - } - }); - session.executeCommand({ - seq: 2, - type: "request", - command: "open", - arguments: { - file: f.path, - fileContent: f.content, - scriptKindName: "JS" - } - }); - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - checkProjectActualFiles(projectService.inferredProjects[0], [f.path]); - }); - - it("inferred projects per project root", () => { - const file1 = { path: "/a/file1.ts", content: "let x = 1;", projectRootPath: "/a" }; - const file2 = { path: "/a/file2.ts", content: "let y = 2;", projectRootPath: "/a" }; - const file3 = { path: "/b/file2.ts", content: "let x = 3;", projectRootPath: "/b" }; - const file4 = { path: "/c/file3.ts", content: "let z = 4;" }; - const host = createServerHost([file1, file2, file3, file4]); - const session = createSession(host, { - useSingleInferredProject: true, - useInferredProjectPerProjectRoot: true - }); - session.executeCommand({ - seq: 1, - type: "request", - command: CommandNames.CompilerOptionsForInferredProjects, - arguments: { - options: { - allowJs: true, - target: ScriptTarget.ESNext - } - } - }); - session.executeCommand({ - seq: 2, - type: "request", - command: CommandNames.CompilerOptionsForInferredProjects, - arguments: { - options: { - allowJs: true, - target: ScriptTarget.ES2015 - }, - projectRootPath: "/b" - } - }); - session.executeCommand({ - seq: 3, - type: "request", - command: CommandNames.Open, - arguments: { - file: file1.path, - fileContent: file1.content, - scriptKindName: "JS", - projectRootPath: file1.projectRootPath - } - }); - session.executeCommand({ - seq: 4, - type: "request", - command: CommandNames.Open, - arguments: { - file: file2.path, - fileContent: file2.content, - scriptKindName: "JS", - projectRootPath: file2.projectRootPath - } - }); - session.executeCommand({ - seq: 5, - type: "request", - command: CommandNames.Open, - arguments: { - file: file3.path, - fileContent: file3.content, - scriptKindName: "JS", - projectRootPath: file3.projectRootPath - } - }); - session.executeCommand({ - seq: 6, - type: "request", - command: CommandNames.Open, - arguments: { - file: file4.path, - fileContent: file4.content, - scriptKindName: "JS" - } - }); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { inferredProjects: 3 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file4.path]); - checkProjectActualFiles(projectService.inferredProjects[1], [file1.path, file2.path]); - checkProjectActualFiles(projectService.inferredProjects[2], [file3.path]); - assert.equal(projectService.inferredProjects[0].getCompilationSettings().target, ScriptTarget.ESNext); - assert.equal(projectService.inferredProjects[1].getCompilationSettings().target, ScriptTarget.ESNext); - assert.equal(projectService.inferredProjects[2].getCompilationSettings().target, ScriptTarget.ES2015); - }); - - function checkInferredProject(inferredProject: server.InferredProject, actualFiles: File[], target: ScriptTarget) { - checkProjectActualFiles(inferredProject, actualFiles.map(f => f.path)); - assert.equal(inferredProject.getCompilationSettings().target, target); - } - - function verifyProjectRootWithCaseSensitivity(useCaseSensitiveFileNames: boolean) { - const files: [File, File, File, File] = [ - { path: "/a/file1.ts", content: "let x = 1;" }, - { path: "/A/file2.ts", content: "let y = 2;" }, - { path: "/b/file2.ts", content: "let x = 3;" }, - { path: "/c/file3.ts", content: "let z = 4;" } - ]; - const host = createServerHost(files, { useCaseSensitiveFileNames }); - const projectService = createProjectService(host, { useSingleInferredProject: true, }, { useInferredProjectPerProjectRoot: true }); - projectService.setCompilerOptionsForInferredProjects({ - allowJs: true, - target: ScriptTarget.ESNext - }); - projectService.setCompilerOptionsForInferredProjects({ - allowJs: true, - target: ScriptTarget.ES2015 - }, "/a"); - - openClientFiles(["/a", "/a", "/b", undefined]); - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0], files[1]], ScriptTarget.ES2015], - [[files[2]], ScriptTarget.ESNext] - ]); - closeClientFiles(); - - openClientFiles(["/a", "/A", "/b", undefined]); - if (useCaseSensitiveFileNames) { - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0]], ScriptTarget.ES2015], - [[files[1]], ScriptTarget.ESNext], - [[files[2]], ScriptTarget.ESNext] - ]); - } - else { - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0], files[1]], ScriptTarget.ES2015], - [[files[2]], ScriptTarget.ESNext] - ]); - } - closeClientFiles(); - - projectService.setCompilerOptionsForInferredProjects({ - allowJs: true, - target: ScriptTarget.ES2017 - }, "/A"); - - openClientFiles(["/a", "/a", "/b", undefined]); - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0], files[1]], useCaseSensitiveFileNames ? ScriptTarget.ES2015 : ScriptTarget.ES2017], - [[files[2]], ScriptTarget.ESNext] - ]); - closeClientFiles(); - - openClientFiles(["/a", "/A", "/b", undefined]); - if (useCaseSensitiveFileNames) { - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0]], ScriptTarget.ES2015], - [[files[1]], ScriptTarget.ES2017], - [[files[2]], ScriptTarget.ESNext] - ]); - } - else { - verifyInferredProjectsState([ - [[files[3]], ScriptTarget.ESNext], - [[files[0], files[1]], ScriptTarget.ES2017], - [[files[2]], ScriptTarget.ESNext] - ]); - } - closeClientFiles(); - - function openClientFiles(projectRoots: [string | undefined, string | undefined, string | undefined, string | undefined]) { - files.forEach((file, index) => { - projectService.openClientFile(file.path, file.content, ScriptKind.JS, projectRoots[index]); - }); - } - - function closeClientFiles() { - files.forEach(file => projectService.closeClientFile(file.path)); - } - - function verifyInferredProjectsState(expected: [File[], ScriptTarget][]) { - checkNumberOfProjects(projectService, { inferredProjects: expected.length }); - projectService.inferredProjects.forEach((p, index) => { - const [actualFiles, target] = expected[index]; - checkInferredProject(p, actualFiles, target); - }); - } - } - - it("inferred projects per project root with case sensitive system", () => { - verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ true); - }); - - it("inferred projects per project root with case insensitive system", () => { - verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ false); - }); - }); - - describe("tsserverProjectSystem import helpers", () => { - it("should not crash in tsserver", () => { - const f1 = { - path: "/a/app.ts", - content: "export async function foo() { return 100; }" - }; - const tslib = { - path: "/a/node_modules/tslib/index.d.ts", - content: "" - }; - const host = createServerHost([f1, tslib]); - const service = createProjectService(host); - service.openExternalProject({ projectFileName: "p", rootFiles: [toExternalFile(f1.path)], options: { importHelpers: true } }); - service.checkNumberOfProjects({ externalProjects: 1 }); - }); - }); - - describe("tsserverProjectSystem searching for config file", () => { - it("should stop at projectRootPath if given", () => { - const f1 = { - path: "/a/file1.ts", - content: "" - }; - const configFile = { - path: "/tsconfig.json", - content: "{}" - }; - const host = createServerHost([f1, configFile]); - const service = createProjectService(host); - service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, "/a"); - - checkNumberOfConfiguredProjects(service, 0); - checkNumberOfInferredProjects(service, 1); - - service.closeClientFile(f1.path); - service.openClientFile(f1.path); - checkNumberOfConfiguredProjects(service, 1); - checkNumberOfInferredProjects(service, 0); - }); - - it("should use projectRootPath when searching for inferred project again", () => { - const projectDir = "/a/b/projects/project"; - const configFileLocation = `${projectDir}/src`; - const f1 = { - path: `${configFileLocation}/file1.ts`, - content: "" - }; - const configFile = { - path: `${configFileLocation}/tsconfig.json`, - content: "{}" - }; - const configFile2 = { - path: "/a/b/projects/tsconfig.json", - content: "{}" - }; - const host = createServerHost([f1, libFile, configFile, configFile2]); - const service = createProjectService(host); - service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectDir); - checkNumberOfProjects(service, { configuredProjects: 1 }); - assert.isDefined(service.configuredProjects.get(configFile.path)); - checkWatchedFiles(host, [libFile.path, configFile.path]); - checkWatchedDirectories(host, [], /*recursive*/ false); - const typeRootLocations = getTypeRootsFromLocation(configFileLocation); - checkWatchedDirectories(host, typeRootLocations.concat(configFileLocation), /*recursive*/ true); - - // Delete config file - should create inferred project and not configured project - host.reloadFS([f1, libFile, configFile2]); - host.runQueuedTimeoutCallbacks(); - checkNumberOfProjects(service, { inferredProjects: 1 }); - checkWatchedFiles(host, [libFile.path, configFile.path, `${configFileLocation}/jsconfig.json`, `${projectDir}/tsconfig.json`, `${projectDir}/jsconfig.json`]); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, typeRootLocations, /*recursive*/ true); - }); - - it("should use projectRootPath when searching for inferred project again 2", () => { - const projectDir = "/a/b/projects/project"; - const configFileLocation = `${projectDir}/src`; - const f1 = { - path: `${configFileLocation}/file1.ts`, - content: "" - }; - const configFile = { - path: `${configFileLocation}/tsconfig.json`, - content: "{}" - }; - const configFile2 = { - path: "/a/b/projects/tsconfig.json", - content: "{}" - }; - const host = createServerHost([f1, libFile, configFile, configFile2]); - const service = createProjectService(host, { useSingleInferredProject: true }, { useInferredProjectPerProjectRoot: true }); - service.openClientFile(f1.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectDir); - checkNumberOfProjects(service, { configuredProjects: 1 }); - assert.isDefined(service.configuredProjects.get(configFile.path)); - checkWatchedFiles(host, [libFile.path, configFile.path]); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, getTypeRootsFromLocation(configFileLocation).concat(configFileLocation), /*recursive*/ true); - - // Delete config file - should create inferred project with project root path set - host.reloadFS([f1, libFile, configFile2]); - host.runQueuedTimeoutCallbacks(); - checkNumberOfProjects(service, { inferredProjects: 1 }); - assert.equal(service.inferredProjects[0].projectRootPath, projectDir); - checkWatchedFiles(host, [libFile.path, configFile.path, `${configFileLocation}/jsconfig.json`, `${projectDir}/tsconfig.json`, `${projectDir}/jsconfig.json`]); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, getTypeRootsFromLocation(projectDir), /*recursive*/ true); - }); - - describe("when the opened file is not from project root", () => { - const projectRoot = "/a/b/projects/project"; - const file: File = { - path: `${projectRoot}/src/index.ts`, - content: "let y = 10" - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: "{}" - }; - const files = [file, libFile]; - const filesWithConfig = files.concat(tsconfig); - const dirOfFile = getDirectoryPath(file.path); - - function openClientFile(files: File[]) { - const host = createServerHost(files); - const projectService = createProjectService(host); - - projectService.openClientFile(file.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, "/a/b/projects/proj"); - return { host, projectService }; - } - - function verifyConfiguredProject(host: TestServerHost, projectService: TestProjectService, orphanInferredProject?: boolean) { - projectService.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: orphanInferredProject ? 1 : 0 }); - const project = Debug.assertDefined(projectService.configuredProjects.get(tsconfig.path)); - - if (orphanInferredProject) { - const inferredProject = projectService.inferredProjects[0]; - assert.isTrue(inferredProject.isOrphan()); - } - - checkProjectActualFiles(project, [file.path, libFile.path, tsconfig.path]); - checkWatchedFiles(host, [libFile.path, tsconfig.path]); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectories(host, (orphanInferredProject ? [projectRoot, `${dirOfFile}/node_modules/@types`] : [projectRoot]).concat(getTypeRootsFromLocation(projectRoot)), /*recursive*/ true); - } - - function verifyInferredProject(host: TestServerHost, projectService: TestProjectService) { - projectService.checkNumberOfProjects({ inferredProjects: 1 }); - const project = projectService.inferredProjects[0]; - assert.isDefined(project); - - const filesToWatch = [libFile.path]; - forEachAncestorDirectory(dirOfFile, ancestor => { - filesToWatch.push(combinePaths(ancestor, "tsconfig.json")); - filesToWatch.push(combinePaths(ancestor, "jsconfig.json")); - }); - - checkProjectActualFiles(project, [file.path, libFile.path]); - checkWatchedFiles(host, filesToWatch); - checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectories(host, getTypeRootsFromLocation(dirOfFile), /*recursive*/ true); - } - - it("tsconfig for the file exists", () => { - const { host, projectService } = openClientFile(filesWithConfig); - verifyConfiguredProject(host, projectService); - - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - verifyInferredProject(host, projectService); - - host.reloadFS(filesWithConfig); - host.runQueuedTimeoutCallbacks(); - verifyConfiguredProject(host, projectService, /*orphanInferredProject*/ true); - }); - - it("tsconfig for the file does not exist", () => { - const { host, projectService } = openClientFile(files); - verifyInferredProject(host, projectService); - - host.reloadFS(filesWithConfig); - host.runQueuedTimeoutCallbacks(); - verifyConfiguredProject(host, projectService, /*orphanInferredProject*/ true); - - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - verifyInferredProject(host, projectService); - }); - }); - }); - - describe("tsserverProjectSystem cancellationToken", () => { - // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test - let oldPrepare: AnyFunction; - before(() => { - oldPrepare = (Error as any).prepareStackTrace; - delete (Error as any).prepareStackTrace; - }); - - after(() => { - (Error as any).prepareStackTrace = oldPrepare; - }); - - it("is attached to request", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let xyz = 1;" - }; - const host = createServerHost([f1]); - let expectedRequestId: number; - const cancellationToken: server.ServerCancellationToken = { - isCancellationRequested: () => false, - setRequest: requestId => { - if (expectedRequestId === undefined) { - assert.isTrue(false, "unexpected call"); - } - assert.equal(requestId, expectedRequestId); - }, - resetRequest: noop - }; - - const session = createSession(host, { cancellationToken }); - - expectedRequestId = session.getNextSeq(); - session.executeCommandSeq({ - command: "open", - arguments: { file: f1.path } - }); - - expectedRequestId = session.getNextSeq(); - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - - expectedRequestId = session.getNextSeq(); - session.executeCommandSeq({ - command: "occurrences", - arguments: { file: f1.path, line: 1, offset: 6 } - }); - - expectedRequestId = 2; - host.runQueuedImmediateCallbacks(); - expectedRequestId = 2; - host.runQueuedImmediateCallbacks(); - }); - - it("Geterr is cancellable", () => { - const f1 = { - path: "/a/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: {} - }) - }; - - const cancellationToken = new TestServerCancellationToken(); - const host = createServerHost([f1, config]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: noop, - cancellationToken - }); - { - session.executeCommandSeq({ - command: "open", - arguments: { file: f1.path } - }); - // send geterr for missing file - session.executeCommandSeq({ - command: "geterr", - arguments: { files: ["/a/missing"] } - }); - // no files - expect 'completed' event - assert.equal(host.getOutput().length, 1, "expect 1 message"); - verifyRequestCompleted(session.getSeq(), 0); - } - { - const getErrId = session.getNextSeq(); - // send geterr for a valid file - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - - assert.equal(host.getOutput().length, 0, "expect 0 messages"); - - // run new request - session.executeCommandSeq({ - command: "projectInfo", - arguments: { file: f1.path } - }); - session.clearMessages(); - - // cancel previously issued Geterr - cancellationToken.setRequestToCancel(getErrId); - host.runQueuedTimeoutCallbacks(); - - assert.equal(host.getOutput().length, 1, "expect 1 message"); - verifyRequestCompleted(getErrId, 0); - - cancellationToken.resetToken(); - } - { - const getErrId = session.getNextSeq(); - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - assert.equal(host.getOutput().length, 0, "expect 0 messages"); - - // run first step - host.runQueuedTimeoutCallbacks(); - assert.equal(host.getOutput().length, 1, "expect 1 message"); - const e1 = getMessage(0); - assert.equal(e1.event, "syntaxDiag"); - session.clearMessages(); - - cancellationToken.setRequestToCancel(getErrId); - host.runQueuedImmediateCallbacks(); - assert.equal(host.getOutput().length, 1, "expect 1 message"); - verifyRequestCompleted(getErrId, 0); - - cancellationToken.resetToken(); - } - { - const getErrId = session.getNextSeq(); - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - assert.equal(host.getOutput().length, 0, "expect 0 messages"); - - // run first step - host.runQueuedTimeoutCallbacks(); - assert.equal(host.getOutput().length, 1, "expect 1 message"); - const e1 = getMessage(0); - assert.equal(e1.event, "syntaxDiag"); - session.clearMessages(); - - // the semanticDiag message - host.runQueuedImmediateCallbacks(); - assert.equal(host.getOutput().length, 1); - const e2 = getMessage(0); - assert.equal(e2.event, "semanticDiag"); - session.clearMessages(); - - host.runQueuedImmediateCallbacks(1); - assert.equal(host.getOutput().length, 2); - const e3 = getMessage(0); - assert.equal(e3.event, "suggestionDiag"); - verifyRequestCompleted(getErrId, 1); - - cancellationToken.resetToken(); - } - { - const getErr1 = session.getNextSeq(); - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - assert.equal(host.getOutput().length, 0, "expect 0 messages"); - // run first step - host.runQueuedTimeoutCallbacks(); - assert.equal(host.getOutput().length, 1, "expect 1 message"); - const e1 = getMessage(0); - assert.equal(e1.event, "syntaxDiag"); - session.clearMessages(); - - session.executeCommandSeq({ - command: "geterr", - arguments: { files: [f1.path] } - }); - // make sure that getErr1 is completed - verifyRequestCompleted(getErr1, 0); - } - - function verifyRequestCompleted(expectedSeq: number, n: number) { - const event = getMessage(n); - assert.equal(event.event, "requestCompleted"); - assert.equal(event.body.request_seq, expectedSeq, "expectedSeq"); - session.clearMessages(); - } - - function getMessage(n: number) { - return JSON.parse(server.extractMessage(host.getOutput()[n])); - } - }); - - it("Lower priority tasks are cancellable", () => { - const f1 = { - path: "/a/app.ts", - content: `{ let x = 1; } var foo = "foo"; var bar = "bar"; var fooBar = "fooBar";` - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: {} - }) - }; - const cancellationToken = new TestServerCancellationToken(/*cancelAfterRequest*/ 3); - const host = createServerHost([f1, config]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: noop, - cancellationToken, - throttleWaitMilliseconds: 0 - }); - { - session.executeCommandSeq({ - command: "open", - arguments: { file: f1.path } - }); - - // send navbar request (normal priority) - session.executeCommandSeq({ - command: "navbar", - arguments: { file: f1.path } - }); - - // ensure the nav bar request can be canceled - verifyExecuteCommandSeqIsCancellable({ - command: "navbar", - arguments: { file: f1.path } - }); - - // send outlining spans request (normal priority) - session.executeCommandSeq({ - command: "outliningSpans", - arguments: { file: f1.path } - }); - - // ensure the outlining spans request can be canceled - verifyExecuteCommandSeqIsCancellable({ - command: "outliningSpans", - arguments: { file: f1.path } - }); - } - - function verifyExecuteCommandSeqIsCancellable(request: Partial) { - // Set the next request to be cancellable - // The cancellation token will cancel the request the third time - // isCancellationRequested() is called. - cancellationToken.setRequestToCancel(session.getNextSeq()); - let operationCanceledExceptionThrown = false; - - try { - session.executeCommandSeq(request); - } - catch (e) { - assert(e instanceof OperationCanceledException); - operationCanceledExceptionThrown = true; - } - assert(operationCanceledExceptionThrown, "Operation Canceled Exception not thrown for request: " + JSON.stringify(request)); - } - }); - }); - - describe("tsserverProjectSystem occurence highlight on string", () => { - it("should be marked if only on string values", () => { - const file1: File = { - path: "/a/b/file1.ts", - content: `let t1 = "div";\nlet t2 = "div";\nlet t3 = { "div": 123 };\nlet t4 = t3["div"];` - }; - - const host = createServerHost([file1]); - const session = createSession(host); - const projectService = session.getProjectService(); - - projectService.openClientFile(file1.path); - { - const highlightRequest = makeSessionRequest( - CommandNames.Occurrences, - { file: file1.path, line: 1, offset: 11 } - ); - const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; - const firstOccurence = highlightResponse[0]; - assert.isTrue(firstOccurence.isInString, "Highlights should be marked with isInString"); - } - - { - const highlightRequest = makeSessionRequest( - CommandNames.Occurrences, - { file: file1.path, line: 3, offset: 13 } - ); - const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; - assert.isTrue(highlightResponse.length === 2); - const firstOccurence = highlightResponse[0]; - assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on property name"); - } - - { - const highlightRequest = makeSessionRequest( - CommandNames.Occurrences, - { file: file1.path, line: 4, offset: 14 } - ); - const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[]; - assert.isTrue(highlightResponse.length === 2); - const firstOccurence = highlightResponse[0]; - assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on indexer"); - } - }); - }); - - describe("tsserverProjectSystem maxNodeModuleJsDepth for inferred projects", () => { - it("should be set to 2 if the project has js root files", () => { - const file1: File = { - path: "/a/b/file1.js", - content: `var t = require("test"); t.` - }; - const moduleFile: File = { - path: "/a/b/node_modules/test/index.js", - content: `var v = 10; module.exports = v;` - }; - - const host = createServerHost([file1, moduleFile]); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - - let project = projectService.inferredProjects[0]; - let options = project.getCompilationSettings(); - assert.isTrue(options.maxNodeModuleJsDepth === 2); - - // Assert the option sticks - projectService.setCompilerOptionsForInferredProjects({ target: ScriptTarget.ES2016 }); - project = projectService.inferredProjects[0]; - options = project.getCompilationSettings(); - assert.isTrue(options.maxNodeModuleJsDepth === 2); - }); - - it("should return to normal state when all js root files are removed from project", () => { - const file1 = { - path: "/a/file1.ts", - content: "let x =1;" - }; - const file2 = { - path: "/a/file2.js", - content: "let x =1;" - }; - - const host = createServerHost([file1, file2, libFile]); - const projectService = createProjectService(host, { useSingleInferredProject: true }); - - projectService.openClientFile(file1.path); - checkNumberOfInferredProjects(projectService, 1); - let project = projectService.inferredProjects[0]; - assert.isUndefined(project.getCompilationSettings().maxNodeModuleJsDepth); - - projectService.openClientFile(file2.path); - project = projectService.inferredProjects[0]; - assert.isTrue(project.getCompilationSettings().maxNodeModuleJsDepth === 2); - - projectService.closeClientFile(file2.path); - project = projectService.inferredProjects[0]; - assert.isUndefined(project.getCompilationSettings().maxNodeModuleJsDepth); - }); - }); - - describe("tsserverProjectSystem refactors", () => { - it("use formatting options", () => { - const file = { - path: "/a.ts", - content: "function f() {\n 1;\n}", - }; - const host = createServerHost([file]); - const session = createSession(host); - openFilesForSession([file], session); - - const response0 = session.executeCommandSeq({ - command: server.protocol.CommandTypes.Configure, - arguments: { - formatOptions: { - indentSize: 2, - }, - }, - }).response; - assert.deepEqual(response0, /*expected*/ undefined); - - const response1 = session.executeCommandSeq({ - command: server.protocol.CommandTypes.GetEditsForRefactor, - arguments: { - refactor: "Extract Symbol", - action: "function_scope_1", - file: "/a.ts", - startLine: 2, - startOffset: 3, - endLine: 2, - endOffset: 4, - }, - }).response; - assert.deepEqual(response1, { - edits: [ - { - fileName: "/a.ts", - textChanges: [ - { - start: { line: 2, offset: 3 }, - end: { line: 2, offset: 5 }, - newText: "newFunction();", - }, - { - start: { line: 3, offset: 2 }, - end: { line: 3, offset: 2 }, - newText: "\n\nfunction newFunction() {\n 1;\n}\n", - }, - ] - } - ], - renameFilename: "/a.ts", - renameLocation: { line: 2, offset: 3 }, - }); - }); - - it("handles text changes in tsconfig.json", () => { - const aTs = { - path: "/a.ts", - content: "export const a = 0;", - }; - const tsconfig = { - path: "/tsconfig.json", - content: '{ "files": ["./a.ts"] }', - }; - - const session = createSession(createServerHost([aTs, tsconfig])); - openFilesForSession([aTs], session); - - const response1 = session.executeCommandSeq({ - command: server.protocol.CommandTypes.GetEditsForRefactor, - arguments: { - refactor: "Move to a new file", - action: "Move to a new file", - file: "/a.ts", - startLine: 1, - startOffset: 1, - endLine: 1, - endOffset: 20, - }, - }).response; - assert.deepEqual(response1, { - edits: [ - { - fileName: "/a.ts", - textChanges: [ - { - start: { line: 1, offset: 1 }, - end: { line: 1, offset: 20 }, - newText: "", - }, - ], - }, - { - fileName: "/tsconfig.json", - textChanges: [ - { - start: { line: 1, offset: 21 }, - end: { line: 1, offset: 21 }, - newText: ", \"./a.1.ts\"", - }, - ], - }, - { - fileName: "/a.1.ts", - textChanges: [ - { - start: { line: 0, offset: 0 }, - end: { line: 0, offset: 0 }, - newText: "export const a = 0;\n", - }, - ], - } - ], - renameFilename: undefined, - renameLocation: undefined, - }); - }); - }); - - describe("tsserverProjectSystem forceConsistentCasingInFileNames", () => { - it("works when extends is specified with a case insensitive file system", () => { - const rootPath = "/Users/username/dev/project"; - const file1: File = { - path: `${rootPath}/index.ts`, - content: 'import {x} from "file2";', - }; - const file2: File = { - path: `${rootPath}/file2.js`, - content: "", - }; - const file2Dts: File = { - path: `${rootPath}/types/file2/index.d.ts`, - content: "export declare const x: string;", - }; - const tsconfigAll: File = { - path: `${rootPath}/tsconfig.all.json`, - content: JSON.stringify({ - compilerOptions: { - baseUrl: ".", - paths: { file2: ["./file2.js"] }, - typeRoots: ["./types"], - forceConsistentCasingInFileNames: true, - }, - }), - }; - const tsconfig: File = { - path: `${rootPath}/tsconfig.json`, - content: JSON.stringify({ extends: "./tsconfig.all.json" }), - }; - - const host = createServerHost([file1, file2, file2Dts, libFile, tsconfig, tsconfigAll], { useCaseSensitiveFileNames: false }); - const session = createSession(host); - - openFilesForSession([file1], session); - const projectService = session.getProjectService(); - - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - - const diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); - }); - }); - - describe("tsserverProjectSystem getEditsForFileRename", () => { - it("works for host implementing 'resolveModuleNames' and 'getResolvedModuleWithFailedLookupLocationsFromCache'", () => { - const userTs: File = { - path: "/user.ts", - content: 'import { x } from "./old";', - }; - const newTs: File = { - path: "/new.ts", - content: "export const x = 0;", - }; - const tsconfig: File = { - path: "/tsconfig.json", - content: "{}", - }; - - const host = createServerHost([userTs, newTs, tsconfig]); - const projectService = createProjectService(host); - projectService.openClientFile(userTs.path); - const project = projectService.configuredProjects.get(tsconfig.path)!; - - Debug.assert(!!project.resolveModuleNames); - - const edits = project.getLanguageService().getEditsForFileRename("/old.ts", "/new.ts", testFormatSettings, emptyOptions); - assert.deepEqual>(edits, [{ - fileName: "/user.ts", - textChanges: [{ - span: textSpanFromSubstring(userTs.content, "./old"), - newText: "./new", - }], - }]); - }); - - it("works with multiple projects", () => { - const aUserTs: File = { - path: "/a/user.ts", - content: 'import { x } from "./old";', - }; - const aOldTs: File = { - path: "/a/old.ts", - content: "export const x = 0;", - }; - const aTsconfig: File = { - path: "/a/tsconfig.json", - content: JSON.stringify({ files: ["./old.ts", "./user.ts"] }), - }; - const bUserTs: File = { - path: "/b/user.ts", - content: 'import { x } from "../a/old";', - }; - const bTsconfig: File = { - path: "/b/tsconfig.json", - content: "{}", - }; - - const host = createServerHost([aUserTs, aOldTs, aTsconfig, bUserTs, bTsconfig]); - const session = createSession(host); - openFilesForSession([aUserTs, bUserTs], session); - - const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { - oldFilePath: aOldTs.path, - newFilePath: "/a/new.ts", - }); - assert.deepEqual>(response, [ - { - fileName: aTsconfig.path, - textChanges: [{ ...protocolTextSpanFromSubstring(aTsconfig.content, "./old.ts"), newText: "new.ts" }], - }, - { - fileName: aUserTs.path, - textChanges: [{ ...protocolTextSpanFromSubstring(aUserTs.content, "./old"), newText: "./new" }], - }, - { - fileName: bUserTs.path, - textChanges: [{ ...protocolTextSpanFromSubstring(bUserTs.content, "../a/old"), newText: "../a/new" }], - }, - ]); - }); - - it("works with file moved to inferred project", () => { - const aTs: File = { path: "/a.ts", content: 'import {} from "./b";' }; - const cTs: File = { path: "/c.ts", content: "export {};" }; - const tsconfig: File = { path: "/tsconfig.json", content: JSON.stringify({ files: ["./a.ts", "./b.ts"] }) }; - - const host = createServerHost([aTs, cTs, tsconfig]); - const session = createSession(host); - openFilesForSession([aTs, cTs], session); - - const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { - oldFilePath: "/b.ts", - newFilePath: cTs.path, - }); - assert.deepEqual>(response, [ - { - fileName: "/tsconfig.json", - textChanges: [{ ...protocolTextSpanFromSubstring(tsconfig.content, "./b.ts"), newText: "c.ts" }], - }, - { - fileName: "/a.ts", - textChanges: [{ ...protocolTextSpanFromSubstring(aTs.content, "./b"), newText: "./c" }], - }, - ]); - }); - }); - - describe("tsserverProjectSystem document registry in project service", () => { - const projectRootPath = "/user/username/projects/project"; - const importModuleContent = `import {a} from "./module1"`; - const file: File = { - path: `${projectRootPath}/index.ts`, - content: importModuleContent - }; - const moduleFile: File = { - path: `${projectRootPath}/module1.d.ts`, - content: "export const a: number;" - }; - const configFile: File = { - path: `${projectRootPath}/tsconfig.json`, - content: JSON.stringify({ files: ["index.ts"] }) - }; - - function getProject(service: TestProjectService) { - return service.configuredProjects.get(configFile.path)!; - } - - function checkProject(service: TestProjectService, moduleIsOrphan: boolean) { - // Update the project - const project = getProject(service); - project.getLanguageService(); - checkProjectActualFiles(project, [file.path, libFile.path, configFile.path, ...(moduleIsOrphan ? [] : [moduleFile.path])]); - const moduleInfo = service.getScriptInfo(moduleFile.path)!; - assert.isDefined(moduleInfo); - assert.equal(moduleInfo.isOrphan(), moduleIsOrphan); - const key = service.documentRegistry.getKeyForCompilationSettings(project.getCompilationSettings()); - assert.deepEqual(service.documentRegistry.getLanguageServiceRefCounts(moduleInfo.path), [[key, moduleIsOrphan ? undefined : 1]]); - } - - function createServiceAndHost() { - const host = createServerHost([file, moduleFile, libFile, configFile]); - const service = createProjectService(host); - service.openClientFile(file.path); - checkProject(service, /*moduleIsOrphan*/ false); - return { host, service }; - } - - function changeFileToNotImportModule(service: TestProjectService) { - const info = service.getScriptInfo(file.path)!; - service.applyChangesToFile(info, [{ span: { start: 0, length: importModuleContent.length }, newText: "" }]); - checkProject(service, /*moduleIsOrphan*/ true); - } - - function changeFileToImportModule(service: TestProjectService) { - const info = service.getScriptInfo(file.path)!; - service.applyChangesToFile(info, [{ span: { start: 0, length: 0 }, newText: importModuleContent }]); - checkProject(service, /*moduleIsOrphan*/ false); - } - - it("Caches the source file if script info is orphan", () => { - const { service } = createServiceAndHost(); - const project = getProject(service); - - const moduleInfo = service.getScriptInfo(moduleFile.path)!; - const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; - assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); - - // edit file - changeFileToNotImportModule(service); - assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); - - // write content back - changeFileToImportModule(service); - assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); - assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); - }); - - it("Caches the source file if script info is orphan, and orphan script info changes", () => { - const { host, service } = createServiceAndHost(); - const project = getProject(service); - - const moduleInfo = service.getScriptInfo(moduleFile.path)!; - const sourceFile = moduleInfo.cacheSourceFile!.sourceFile; - assert.equal(project.getSourceFile(moduleInfo.path), sourceFile); - - // edit file - changeFileToNotImportModule(service); - assert.equal(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); - - const updatedModuleContent = moduleFile.content + "\nexport const b: number;"; - host.writeFile(moduleFile.path, updatedModuleContent); - - // write content back - changeFileToImportModule(service); - assert.notEqual(moduleInfo.cacheSourceFile!.sourceFile, sourceFile); - assert.equal(project.getSourceFile(moduleInfo.path), moduleInfo.cacheSourceFile!.sourceFile); - assert.equal(moduleInfo.cacheSourceFile!.sourceFile.text, updatedModuleContent); - }); - }); - - describe("tsserverProjectSystem syntax operations", () => { - function navBarFull(session: TestSession, file: File) { - return JSON.stringify(session.executeCommandSeq({ - command: protocol.CommandTypes.NavBarFull, - arguments: { file: file.path } - }).response); - } - - function openFile(session: TestSession, file: File) { - session.executeCommandSeq({ - command: protocol.CommandTypes.Open, - arguments: { file: file.path, fileContent: file.content } - }); - } - - it("works when file is removed and added with different content", () => { - const projectRoot = "/user/username/projects/myproject"; - const app: File = { - path: `${projectRoot}/app.ts`, - content: "console.log('Hello world');" - }; - const unitTest1: File = { - path: `${projectRoot}/unitTest1.ts`, - content: `import assert = require('assert'); - -describe("Test Suite 1", () => { - it("Test A", () => { - assert.ok(true, "This shouldn't fail"); - }); - - it("Test B", () => { - assert.ok(1 === 1, "This shouldn't fail"); - assert.ok(false, "This should fail"); - }); -});` - }; - const tsconfig: File = { - path: `${projectRoot}/tsconfig.json`, - content: "{}" - }; - const files = [app, libFile, tsconfig]; - const host = createServerHost(files); - const session = createSession(host); - const service = session.getProjectService(); - openFile(session, app); - - checkNumberOfProjects(service, { configuredProjects: 1 }); - const project = service.configuredProjects.get(tsconfig.path)!; - const expectedFilesWithoutUnitTest1 = files.map(f => f.path); - checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); - - host.writeFile(unitTest1.path, unitTest1.content); - host.runQueuedTimeoutCallbacks(); - const expectedFilesWithUnitTest1 = expectedFilesWithoutUnitTest1.concat(unitTest1.path); - checkProjectActualFiles(project, expectedFilesWithUnitTest1); - - openFile(session, unitTest1); - checkProjectActualFiles(project, expectedFilesWithUnitTest1); - - const navBarResultUnitTest1 = navBarFull(session, unitTest1); - host.deleteFile(unitTest1.path); - host.checkTimeoutQueueLengthAndRun(2); - checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); - - session.executeCommandSeq({ - command: protocol.CommandTypes.Close, - arguments: { file: unitTest1.path } - }); - checkProjectActualFiles(project, expectedFilesWithoutUnitTest1); - - const unitTest1WithChangedContent: File = { - path: unitTest1.path, - content: `import assert = require('assert'); - -export function Test1() { - assert.ok(true, "This shouldn't fail"); -}; - -export function Test2() { - assert.ok(1 === 1, "This shouldn't fail"); - assert.ok(false, "This should fail"); -};` - }; - host.writeFile(unitTest1.path, unitTest1WithChangedContent.content); - host.runQueuedTimeoutCallbacks(); - checkProjectActualFiles(project, expectedFilesWithUnitTest1); - - openFile(session, unitTest1WithChangedContent); - checkProjectActualFiles(project, expectedFilesWithUnitTest1); - const sourceFile = project.getLanguageService().getNonBoundSourceFile(unitTest1WithChangedContent.path); - assert.strictEqual(sourceFile.text, unitTest1WithChangedContent.content); - - const navBarResultUnitTest1WithChangedContent = navBarFull(session, unitTest1WithChangedContent); - assert.notStrictEqual(navBarResultUnitTest1WithChangedContent, navBarResultUnitTest1, "With changes in contents of unitTest file, we should see changed naviagation bar item result"); - }); - }); - - describe("tsserverProjectSystem completions", () => { - it("works", () => { - const aTs: File = { - path: "/a.ts", - content: "export const foo = 0;", - }; - const bTs: File = { - path: "/b.ts", - content: "foo", - }; - const tsconfig: File = { - path: "/tsconfig.json", - content: "{}", - }; - - const session = createSession(createServerHost([aTs, bTs, tsconfig])); - openFilesForSession([aTs, bTs], session); - - const requestLocation: protocol.FileLocationRequestArgs = { - file: bTs.path, - line: 1, - offset: 3, - }; - - const response = executeSessionRequest(session, protocol.CommandTypes.CompletionInfo, { - ...requestLocation, - includeExternalModuleExports: true, - prefix: "foo", - }); - const entry: protocol.CompletionEntry = { - hasAction: true, - insertText: undefined, - isRecommended: undefined, - kind: ScriptElementKind.constElement, - kindModifiers: ScriptElementKindModifier.exportedModifier, - name: "foo", - replacementSpan: undefined, - sortText: "0", - source: "/a", - }; - assert.deepEqual(response, { - isGlobalCompletion: true, - isMemberCompletion: false, - isNewIdentifierLocation: false, - entries: [entry], - }); - - const detailsRequestArgs: protocol.CompletionDetailsRequestArgs = { - ...requestLocation, - entryNames: [{ name: "foo", source: "/a" }], - }; - - const detailsResponse = executeSessionRequest(session, protocol.CommandTypes.CompletionDetails, detailsRequestArgs); - const detailsCommon: protocol.CompletionEntryDetails & CompletionEntryDetails = { - displayParts: [ - keywordPart(SyntaxKind.ConstKeyword), - spacePart(), - displayPart("foo", SymbolDisplayPartKind.localName), - punctuationPart(SyntaxKind.ColonToken), - spacePart(), - displayPart("0", SymbolDisplayPartKind.stringLiteral), - ], - documentation: emptyArray, - kind: ScriptElementKind.constElement, - kindModifiers: ScriptElementKindModifier.exportedModifier, - name: "foo", - source: [{ text: "./a", kind: "text" }], - tags: undefined, - }; - assert.deepEqual | undefined>(detailsResponse, [ - { - codeActions: [ - { - description: `Import 'foo' from module "./a"`, - changes: [ - { - fileName: "/b.ts", - textChanges: [ - { - start: { line: 1, offset: 1 }, - end: { line: 1, offset: 1 }, - newText: 'import { foo } from "./a";\n\n', - }, - ], - }, - ], - commands: undefined, - }, - ], - ...detailsCommon, - }, - ]); - - interface CompletionDetailsFullRequest extends protocol.FileLocationRequest { - readonly command: protocol.CommandTypes.CompletionDetailsFull; - readonly arguments: protocol.CompletionDetailsRequestArgs; - } - interface CompletionDetailsFullResponse extends protocol.Response { - readonly body?: ReadonlyArray; - } - const detailsFullResponse = executeSessionRequest(session, protocol.CommandTypes.CompletionDetailsFull, detailsRequestArgs); - assert.deepEqual | undefined>(detailsFullResponse, [ - { - codeActions: [ - { - description: `Import 'foo' from module "./a"`, - changes: [ - { - fileName: "/b.ts", - textChanges: [createTextChange(createTextSpan(0, 0), 'import { foo } from "./a";\n\n')], - }, - ], - commands: undefined, - } - ], - ...detailsCommon, - } - ]); - }); - }); - - describe("tsserverProjectSystem rename", () => { - it("works with fileToRename", () => { - const aTs: File = { path: "/a.ts", content: "export const a = 0;" }; - const bTs: File = { path: "/b.ts", content: 'import { a } from "./a";' }; - - const session = createSession(createServerHost([aTs, bTs])); - openFilesForSession([bTs], session); - - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(bTs, 'a";')); - assert.deepEqual(response, { - info: { - canRename: true, - fileToRename: aTs.path, - displayName: aTs.path, - fullDisplayName: aTs.path, - kind: ScriptElementKind.moduleElement, - kindModifiers: "", - triggerSpan: protocolTextSpanFromSubstring(bTs.content, "a", { index: 1 }), - }, - locs: [{ file: bTs.path, locs: [protocolRenameSpanFromSubstring(bTs.content, "./a")] }], - }); - }); - - it("works with prefixText and suffixText", () => { - const aTs: File = { path: "/a.ts", content: "const x = 0; const o = { x };" }; - const session = createSession(createServerHost([aTs])); - openFilesForSession([aTs], session); - - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "x")); - assert.deepEqual(response, { - info: { - canRename: true, - fileToRename: undefined, - displayName: "x", - fullDisplayName: "x", - kind: ScriptElementKind.constElement, - kindModifiers: ScriptElementKindModifier.none, - triggerSpan: protocolTextSpanFromSubstring(aTs.content, "x"), - }, - locs: [ - { - file: aTs.path, - locs: [ - protocolRenameSpanFromSubstring(aTs.content, "x"), - protocolRenameSpanFromSubstring(aTs.content, "x", { index: 1 }, { prefixText: "x: " }), - ], - }, - ], - }); - }); - }); - - describe("tsserverProjectSystem typeReferenceDirectives", () => { - it("when typeReferenceDirective contains UpperCasePackage", () => { - const projectLocation = "/user/username/projects/myproject"; - const libProjectLocation = `${projectLocation}/lib`; - const typeLib: File = { - path: `${libProjectLocation}/@types/UpperCasePackage/index.d.ts`, - content: `declare class BrokenTest { - constructor(name: string, width: number, height: number, onSelect: Function); - Name: string; - SelectedFile: string; -}` - }; - const appLib: File = { - path: `${libProjectLocation}/@app/lib/index.d.ts`, - content: `/// -declare class TestLib { - issue: BrokenTest; - constructor(); - test(): void; -}` - }; - const testProjectLocation = `${projectLocation}/test`; - const testFile: File = { - path: `${testProjectLocation}/test.ts`, - content: `class TestClass1 { - - constructor() { - var l = new TestLib(); - - } - - public test2() { - var x = new BrokenTest('',0,0,null); - - } -}` - }; - const testConfig: File = { - path: `${testProjectLocation}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { - module: "amd", - typeRoots: ["../lib/@types", "../lib/@app"] - } - }) - }; - - const files = [typeLib, appLib, testFile, testConfig, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(testFile.path); - checkNumberOfProjects(service, { configuredProjects: 1 }); - const project = service.configuredProjects.get(testConfig.path)!; - checkProjectActualFiles(project, files.map(f => f.path)); - host.writeFile(appLib.path, appLib.content.replace("test()", "test2()")); - host.checkTimeoutQueueLengthAndRun(2); - }); - - it("when typeReferenceDirective is relative path and in a sibling folder", () => { - const projectRootPath = "/user/username/projects/browser-addon"; - const projectPath = `${projectRootPath}/background`; - const file: File = { - path: `${projectPath}/a.ts`, - content: "let x = 10;" - }; - const tsconfig: File = { - path: `${projectPath}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { - types: [ - "../typedefs/filesystem" - ] } - }) - }; - const filesystem: File = { - path: `${projectRootPath}/typedefs/filesystem.d.ts`, - content: `interface LocalFileSystem { someProperty: string; }` - }; - const files = [file, tsconfig, filesystem, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(file.path); - }); - }); - - describe("tsserverProjectSystem project references", () => { - const aTs: File = { - path: "/a/a.ts", - content: "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};", - }; - const compilerOptions: CompilerOptions = { - outDir: "bin", - declaration: true, - declarationMap: true, - composite: true, - }; - const configContent = JSON.stringify({ compilerOptions }); - const aTsconfig: File = { path: "/a/tsconfig.json", content: configContent }; - - const aDtsMapContent: RawSourceMap = { - version: 3, - file: "a.d.ts", - sourceRoot: "", - sources: ["../a.ts"], - names: [], - mappings: "AAAA,wBAAgB,GAAG,SAAK;AACxB,MAAM,WAAW,MAAM;CAAG;AAC1B,eAAO,MAAM,SAAS,EAAE,MAAW,CAAC" - }; - const aDtsMap: File = { - path: "/a/bin/a.d.ts.map", - content: JSON.stringify(aDtsMapContent), - }; - const aDts: File = { - path: "/a/bin/a.d.ts", - // Need to mangle the sourceMappingURL part or it breaks the build - content: `export declare function fnA(): void;\nexport interface IfaceA {\n}\nexport declare const instanceA: IfaceA;\n//# source${""}MappingURL=a.d.ts.map`, - }; - - const bTs: File = { - path: "/b/b.ts", - content: "export function fnB() {}", - }; - const bTsconfig: File = { path: "/b/tsconfig.json", content: configContent }; - - const bDtsMapContent: RawSourceMap = { - version: 3, - file: "b.d.ts", - sourceRoot: "", - sources: ["../b.ts"], - names: [], - mappings: "AAAA,wBAAgB,GAAG,SAAK", - }; - const bDtsMap: File = { - path: "/b/bin/b.d.ts.map", - content: JSON.stringify(bDtsMapContent), - }; - const bDts: File = { - // Need to mangle the sourceMappingURL part or it breaks the build - path: "/b/bin/b.d.ts", - content: `export declare function fnB(): void;\n//# source${""}MappingURL=b.d.ts.map`, - }; - - const dummyFile: File = { - path: "/dummy/dummy.ts", - content: "let a = 10;" - }; - - const userTs: File = { - path: "/user/user.ts", - content: 'import * as a from "../a/bin/a";\nimport * as b from "../b/bin/b";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }', - }; - - const userTsForConfigProject: File = { - path: "/user/user.ts", - content: 'import * as a from "../a/a";\nimport * as b from "../b/b";\nexport function fnUser() { a.fnA(); b.fnB(); a.instanceA; }', - }; - - const userTsconfig: File = { - path: "/user/tsconfig.json", - content: JSON.stringify({ - file: ["user.ts"], - references: [{ path: "../a" }, { path: "../b" }] - }) - }; - - function makeSampleProjects(addUserTsConfig?: boolean) { - const host = createServerHost([aTs, aTsconfig, aDtsMap, aDts, bTsconfig, bTs, bDtsMap, bDts, ...(addUserTsConfig ? [userTsForConfigProject, userTsconfig] : [userTs]), dummyFile]); - const session = createSession(host); - - checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); - checkDeclarationFiles(bTs, session, [bDtsMap, bDts]); - - // Testing what happens if we delete the original sources. - host.deleteFile(bTs.path); - - openFilesForSession([userTs], session); - const service = session.getProjectService(); - checkNumberOfProjects(service, addUserTsConfig ? { configuredProjects: 1 } : { inferredProjects: 1 }); - return session; - } - - function verifyInferredProjectUnchanged(session: TestSession) { - checkProjectActualFiles(session.getProjectService().inferredProjects[0], [userTs.path, aDts.path, bDts.path]); - } - - function verifyDummyProject(session: TestSession) { - checkProjectActualFiles(session.getProjectService().inferredProjects[0], [dummyFile.path]); - } - - function verifyOnlyOrphanInferredProject(session: TestSession) { - openFilesForSession([dummyFile], session); - checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); - verifyDummyProject(session); - } - - function verifySingleInferredProject(session: TestSession) { - checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); - verifyInferredProjectUnchanged(session); - - // Close user file should close all the projects after opening dummy file - closeFilesForSession([userTs], session); - verifyOnlyOrphanInferredProject(session); - } - - function verifyATsConfigProject(session: TestSession) { - checkProjectActualFiles(session.getProjectService().configuredProjects.get(aTsconfig.path)!, [aTs.path, aTsconfig.path]); - } - - function verifyATsConfigOriginalProject(session: TestSession) { - checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); - verifyInferredProjectUnchanged(session); - verifyATsConfigProject(session); - // Close user file should close all the projects - closeFilesForSession([userTs], session); - verifyOnlyOrphanInferredProject(session); - } - - function verifyATsConfigWhenOpened(session: TestSession) { - checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); - verifyInferredProjectUnchanged(session); - verifyATsConfigProject(session); - - closeFilesForSession([userTs], session); - openFilesForSession([dummyFile], session); - checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); - verifyDummyProject(session); - verifyATsConfigProject(session); // ATsConfig should still be alive - } - - function verifyUserTsConfigProject(session: TestSession) { - checkProjectActualFiles(session.getProjectService().configuredProjects.get(userTsconfig.path)!, [userTs.path, aDts.path, userTsconfig.path]); - } - - it("goToDefinition", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.Definition, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); - verifySingleInferredProject(session); - }); - - it("getDefinitionAndBoundSpan", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, { - textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), - definitions: [protocolFileSpanFromSubstring(aTs, "fnA")], - }); - verifySingleInferredProject(session); - }); - - it("getDefinitionAndBoundSpan with file navigation", () => { - const session = makeSampleProjects(/*addUserTsConfig*/ true); - const response = executeSessionRequest(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, { - textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), - definitions: [protocolFileSpanFromSubstring(aTs, "fnA")], - }); - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); - verifyUserTsConfigProject(session); - - // Navigate to the definition - closeFilesForSession([userTs], session); - openFilesForSession([aTs], session); - - // UserTs configured project should be alive - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 2 }); - verifyUserTsConfigProject(session); - verifyATsConfigProject(session); - - closeFilesForSession([aTs], session); - verifyOnlyOrphanInferredProject(session); - }); - - it("goToType", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.TypeDefinition, protocolFileLocationFromSubstring(userTs, "instanceA")); - assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "IfaceA")]); - verifySingleInferredProject(session); - }); - - it("goToImplementation", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.Implementation, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); - verifySingleInferredProject(session); - }); - - it("goToDefinition -- target does not exist", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, CommandNames.Definition, protocolFileLocationFromSubstring(userTs, "fnB()")); - // bTs does not exist, so stick with bDts - assert.deepEqual(response, [protocolFileSpanFromSubstring(bDts, "fnB")]); - verifySingleInferredProject(session); - }); - - it("navigateTo", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, CommandNames.Navto, { file: userTs.path, searchValue: "fn" }); - assert.deepEqual | undefined>(response, [ - { - ...protocolFileSpanFromSubstring(bDts, "export declare function fnB(): void;"), - name: "fnB", - matchKind: "prefix", - isCaseSensitive: true, - kind: ScriptElementKind.functionElement, - kindModifiers: "export,declare", - }, - { - ...protocolFileSpanFromSubstring(userTs, "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), - name: "fnUser", - matchKind: "prefix", - isCaseSensitive: true, - kind: ScriptElementKind.functionElement, - kindModifiers: "export", - }, - { - ...protocolFileSpanFromSubstring(aTs, "export function fnA() {}"), - name: "fnA", - matchKind: "prefix", - isCaseSensitive: true, - kind: ScriptElementKind.functionElement, - kindModifiers: "export", - }, - ]); - - verifyATsConfigOriginalProject(session); - }); - - const referenceATs = (aTs: File): protocol.ReferencesResponseItem => makeReferenceItem(aTs, /*isDefinition*/ true, "fnA", "export function fnA() {}"); - const referencesUserTs = (userTs: File): ReadonlyArray => [ - makeReferenceItem(userTs, /*isDefinition*/ false, "fnA", "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), - ]; - - it("findAllReferences", () => { - const session = makeSampleProjects(); - - const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, { - refs: [...referencesUserTs(userTs), referenceATs(aTs)], - symbolName: "fnA", - symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnA()").offset, - symbolDisplayString: "function fnA(): void", - }); - - verifyATsConfigOriginalProject(session); - }); - - it("findAllReferences -- starting at definition", () => { - const session = makeSampleProjects(); - openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. - const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(aTs, "fnA")); - assert.deepEqual(response, { - refs: [referenceATs(aTs), ...referencesUserTs(userTs)], - symbolName: "fnA", - symbolStartOffset: protocolLocationFromSubstring(aTs.content, "fnA").offset, - symbolDisplayString: "function fnA(): void", - }); - verifyATsConfigWhenOpened(session); - }); - - interface ReferencesFullRequest extends protocol.FileLocationRequest { readonly command: protocol.CommandTypes.ReferencesFull; } - interface ReferencesFullResponse extends protocol.Response { readonly body: ReadonlyArray; } - - it("findAllReferencesFull", () => { - const session = makeSampleProjects(); - - const responseFull = executeSessionRequest(session, protocol.CommandTypes.ReferencesFull, protocolFileLocationFromSubstring(userTs, "fnA()")); - - assert.deepEqual>(responseFull, [ - { - definition: { - ...documentSpanFromSubstring(aTs, "fnA"), - kind: ScriptElementKind.functionElement, - name: "function fnA(): void", - containerKind: ScriptElementKind.unknown, - containerName: "", - displayParts: [ - keywordPart(SyntaxKind.FunctionKeyword), - spacePart(), - displayPart("fnA", SymbolDisplayPartKind.functionName), - punctuationPart(SyntaxKind.OpenParenToken), - punctuationPart(SyntaxKind.CloseParenToken), - punctuationPart(SyntaxKind.ColonToken), - spacePart(), - keywordPart(SyntaxKind.VoidKeyword), - ], - }, - references: [ - makeReferenceEntry(userTs, /*isDefinition*/ false, "fnA"), - makeReferenceEntry(aTs, /*isDefinition*/ true, "fnA"), - ], - }, - ]); - verifyATsConfigOriginalProject(session); - }); - - it("findAllReferencesFull definition is in mapped file", () => { - const aTs: File = { path: "/a/a.ts", content: `function f() {}` }; - const aTsconfig: File = { - path: "/a/tsconfig.json", - content: JSON.stringify({ compilerOptions: { declaration: true, declarationMap: true, outFile: "../bin/a.js" } }), - }; - const bTs: File = { path: "/b/b.ts", content: `f();` }; - const bTsconfig: File = { path: "/b/tsconfig.json", content: JSON.stringify({ references: [{ path: "../a" }] }) }; - const aDts: File = { path: "/bin/a.d.ts", content: `declare function f(): void;\n//# sourceMappingURL=a.d.ts.map` }; - const aDtsMap: File = { - path: "/bin/a.d.ts.map", - content: JSON.stringify({ version: 3, file: "a.d.ts", sourceRoot: "", sources: ["../a/a.ts"], names: [], mappings: "AAAA,iBAAS,CAAC,SAAK" }), - }; - - const session = createSession(createServerHost([aTs, aTsconfig, bTs, bTsconfig, aDts, aDtsMap])); - checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); - openFilesForSession([bTs], session); - checkNumberOfProjects(session.getProjectService(), { configuredProjects: 1 }); - - const responseFull = executeSessionRequest(session, protocol.CommandTypes.ReferencesFull, protocolFileLocationFromSubstring(bTs, "f()")); - - assert.deepEqual>(responseFull, [ - { - definition: { - containerKind: ScriptElementKind.unknown, - containerName: "", - displayParts: [ - keywordPart(SyntaxKind.FunctionKeyword), - spacePart(), - displayPart("f", SymbolDisplayPartKind.functionName), - punctuationPart(SyntaxKind.OpenParenToken), - punctuationPart(SyntaxKind.CloseParenToken), - punctuationPart(SyntaxKind.ColonToken), - spacePart(), - keywordPart(SyntaxKind.VoidKeyword), - ], - fileName: aTs.path, - kind: ScriptElementKind.functionElement, - name: "function f(): void", - textSpan: { start: 9, length: 1 }, - }, - references: [ - { - fileName: bTs.path, - isDefinition: false, - isInString: undefined, - isWriteAccess: false, - textSpan: { start: 0, length: 1 }, - }, - { - fileName: aTs.path, - isDefinition: true, - isInString: undefined, - isWriteAccess: true, - textSpan: { start: 9, length: 1 }, - }, - ], - } - ]); - }); - - it("findAllReferences -- target does not exist", () => { - const session = makeSampleProjects(); - - const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnB()")); - assert.deepEqual(response, { - refs: [ - makeReferenceItem(bDts, /*isDefinition*/ true, "fnB", "export declare function fnB(): void;"), - makeReferenceItem(userTs, /*isDefinition*/ false, "fnB", "export function fnUser() { a.fnA(); b.fnB(); a.instanceA; }"), - ], - symbolName: "fnB", - symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnB()").offset, - symbolDisplayString: "function fnB(): void", - }); - verifySingleInferredProject(session); - }); - - const renameATs = (aTs: File): protocol.SpanGroup => ({ - file: aTs.path, - locs: [protocolRenameSpanFromSubstring(aTs.content, "fnA")], - }); - const renameUserTs = (userTs: File): protocol.SpanGroup => ({ - file: userTs.path, - locs: [protocolRenameSpanFromSubstring(userTs.content, "fnA")], - }); - - it("renameLocations", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual(response, { - info: { - canRename: true, - displayName: "fnA", - fileToRename: undefined, - fullDisplayName: '"/a/bin/a".fnA', // Ideally this would use the original source's path instead of the declaration file's path. - kind: ScriptElementKind.functionElement, - kindModifiers: [ScriptElementKindModifier.exportedModifier, ScriptElementKindModifier.ambientModifier].join(","), - triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnA"), - }, - locs: [renameUserTs(userTs), renameATs(aTs)], - }); - verifyATsConfigOriginalProject(session); - }); - - it("renameLocations -- starting at definition", () => { - const session = makeSampleProjects(); - openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "fnA")); - assert.deepEqual(response, { - info: { - canRename: true, - displayName: "fnA", - fileToRename: undefined, - fullDisplayName: '"/a/a".fnA', - kind: ScriptElementKind.functionElement, - kindModifiers: ScriptElementKindModifier.exportedModifier, - triggerSpan: protocolTextSpanFromSubstring(aTs.content, "fnA"), - }, - locs: [renameATs(aTs), renameUserTs(userTs)], - }); - verifyATsConfigWhenOpened(session); - }); - - it("renameLocationsFull", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()")); - assert.deepEqual>(response, [ - renameLocation(userTs, "fnA"), - renameLocation(aTs, "fnA"), - ]); - verifyATsConfigOriginalProject(session); - }); - - it("renameLocations -- target does not exist", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnB()")); - assert.deepEqual(response, { - info: { - canRename: true, - displayName: "fnB", - fileToRename: undefined, - fullDisplayName: '"/b/bin/b".fnB', - kind: ScriptElementKind.functionElement, - kindModifiers: [ScriptElementKindModifier.exportedModifier, ScriptElementKindModifier.ambientModifier].join(","), - triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnB"), - }, - locs: [ - { - file: bDts.path, - locs: [protocolRenameSpanFromSubstring(bDts.content, "fnB")], - }, - { - file: userTs.path, - locs: [protocolRenameSpanFromSubstring(userTs.content, "fnB")], - }, - ], - }); - verifySingleInferredProject(session); - }); - - it("getEditsForFileRename", () => { - const session = makeSampleProjects(); - const response = executeSessionRequest(session, protocol.CommandTypes.GetEditsForFileRename, { - oldFilePath: aTs.path, - newFilePath: "/a/aNew.ts", - }); - assert.deepEqual>(response, [ - { - fileName: userTs.path, - textChanges: [ - { ...protocolTextSpanFromSubstring(userTs.content, "../a/bin/a"), newText: "../a/bin/aNew" }, - ], - }, - ]); - verifySingleInferredProject(session); - }); - - it("getEditsForFileRename when referencing project doesnt include file and its renamed", () => { - const aTs: File = { path: "/a/src/a.ts", content: "" }; - const aTsconfig: File = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - composite: true, - declaration: true, - declarationMap: true, - outDir: "./build", - } - }), - }; - const bTs: File = { path: "/b/src/b.ts", content: "" }; - const bTsconfig: File = { - path: "/b/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - composite: true, - outDir: "./build", - }, - include: ["./src"], - references: [{ path: "../a" }], - }), - }; - - const host = createServerHost([aTs, aTsconfig, bTs, bTsconfig]); - const session = createSession(host); - openFilesForSession([aTs, bTs], session); - const response = executeSessionRequest(session, CommandNames.GetEditsForFileRename, { - oldFilePath: aTs.path, - newFilePath: "/a/src/a1.ts", - }); - assert.deepEqual>(response, []); // Should not change anything - }); - }); - - describe("tsserverProjectSystem with tsbuild projects", () => { - function createHost(files: ReadonlyArray, rootNames: ReadonlyArray) { - const host = createServerHost(files); - - // ts build should succeed - const solutionBuilder = tscWatch.createSolutionBuilder(host, rootNames, {}); - solutionBuilder.buildAllProjects(); - assert.equal(host.getOutput().length, 0); - - return host; - } - - describe("with container project", () => { - function getProjectFiles(project: string): [File, File] { - return [ - TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json"), - TestFSWithWatch.getTsBuildProjectFile(project, "index.ts"), - ]; - } - - const project = "container"; - const containerLib = getProjectFiles("container/lib"); - const containerExec = getProjectFiles("container/exec"); - const containerCompositeExec = getProjectFiles("container/compositeExec"); - const containerConfig = TestFSWithWatch.getTsBuildProjectFile(project, "tsconfig.json"); - const files = [libFile, ...containerLib, ...containerExec, ...containerCompositeExec, containerConfig]; - - it("does not error on container only project", () => { - const host = createHost(files, [containerConfig.path]); - - // Open external project for the folder - const session = createSession(host); - const service = session.getProjectService(); - service.openExternalProjects([{ - projectFileName: TestFSWithWatch.getTsBuildProjectFilePath(project, project), - rootFiles: files.map(f => ({ fileName: f.path })), - options: {} - }]); - checkNumberOfProjects(service, { configuredProjects: 4 }); - files.forEach(f => { - const args: protocol.FileRequestArgs = { - file: f.path, - projectFileName: endsWith(f.path, "tsconfig.json") ? f.path : undefined - }; - const syntaxDiagnostics = session.executeCommandSeq({ - command: protocol.CommandTypes.SyntacticDiagnosticsSync, - arguments: args - }).response; - assert.deepEqual(syntaxDiagnostics, []); - const semanticDiagnostics = session.executeCommandSeq({ - command: protocol.CommandTypes.SemanticDiagnosticsSync, - arguments: args - }).response; - assert.deepEqual(semanticDiagnostics, []); - }); - const containerProject = service.configuredProjects.get(containerConfig.path)!; - checkProjectActualFiles(containerProject, [containerConfig.path]); - const optionsDiagnostics = session.executeCommandSeq({ - command: protocol.CommandTypes.CompilerOptionsDiagnosticsFull, - arguments: { projectFileName: containerProject.projectName } - }).response; - assert.deepEqual(optionsDiagnostics, []); - }); - - it("can successfully find references with --out options", () => { - const host = createHost(files, [containerConfig.path]); - const session = createSession(host); - openFilesForSession([containerCompositeExec[1]], session); - const service = session.getProjectService(); - checkNumberOfProjects(service, { configuredProjects: 1 }); - const locationOfMyConst = protocolLocationFromSubstring(containerCompositeExec[1].content, "myConst"); - const response = session.executeCommandSeq({ - command: protocol.CommandTypes.Rename, - arguments: { - file: containerCompositeExec[1].path, - ...locationOfMyConst - } - }).response as protocol.RenameResponseBody; - - - const myConstLen = "myConst".length; - const locationOfMyConstInLib = protocolLocationFromSubstring(containerLib[1].content, "myConst"); - assert.deepEqual(response.locs, [ - { file: containerCompositeExec[1].path, locs: [{ start: locationOfMyConst, end: { line: locationOfMyConst.line, offset: locationOfMyConst.offset + myConstLen } }] }, - { file: containerLib[1].path, locs: [{ start: locationOfMyConstInLib, end: { line: locationOfMyConstInLib.line, offset: locationOfMyConstInLib.offset + myConstLen } }] } - ]); - }); - }); - - describe("with main and depedency project", () => { - const projectLocation = "/user/username/projects/myproject"; - const dependecyLocation = `${projectLocation}/dependency`; - const mainLocation = `${projectLocation}/main`; - const dependencyTs: File = { - path: `${dependecyLocation}/FnS.ts`, - content: `export function fn1() { } -export function fn2() { } -export function fn3() { } -export function fn4() { } -export function fn5() { } -` - }; - const dependencyConfig: File = { - path: `${dependecyLocation}/tsconfig.json`, - content: JSON.stringify({ compilerOptions: { composite: true, declarationMap: true } }) - }; - - const mainTs: File = { - path: `${mainLocation}/main.ts`, - content: `import { - fn1, - fn2, - fn3, - fn4, - fn5 -} from '../dependency/fns' - -fn1(); -fn2(); -fn3(); -fn4(); -fn5(); -` - }; - const mainConfig: File = { - path: `${mainLocation}/tsconfig.json`, - content: JSON.stringify({ - compilerOptions: { composite: true, declarationMap: true }, - references: [{ path: "../dependency" }] - }) - }; - - const randomFile: File = { - path: `${projectLocation}/random/random.ts`, - content: "let a = 10;" - }; - const randomConfig: File = { - path: `${projectLocation}/random/tsconfig.json`, - content: "{}" - }; - const dtsLocation = `${dependecyLocation}/FnS.d.ts`; - const dtsPath = dtsLocation.toLowerCase() as Path; - const dtsMapLocation = `${dtsLocation}.map`; - const dtsMapPath = dtsMapLocation.toLowerCase() as Path; - - const files = [dependencyTs, dependencyConfig, mainTs, mainConfig, libFile, randomFile, randomConfig]; - - function verifyScriptInfos(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { - checkScriptInfos(session.getProjectService(), openInfos.concat(closedInfos)); - checkWatchedFiles(host, closedInfos.concat(otherWatchedFiles).map(f => f.toLowerCase())); - } - - function verifyInfosWithRandom(session: TestSession, host: TestServerHost, openInfos: ReadonlyArray, closedInfos: ReadonlyArray, otherWatchedFiles: ReadonlyArray) { - verifyScriptInfos(session, host, openInfos.concat(randomFile.path), closedInfos, otherWatchedFiles.concat(randomConfig.path)); - } - - function verifyOnlyRandomInfos(session: TestSession, host: TestServerHost) { - verifyScriptInfos(session, host, [randomFile.path], [libFile.path], [randomConfig.path]); - } - - // Returns request and expected Response, expected response when no map file - interface SessionAction { - reqName: string; - request: Partial; - expectedResponse: Response; - expectedResponseNoMap?: Response; - expectedResponseNoDts?: Response; - } - function gotoDefintinionFromMainTs(fn: number): SessionAction { - const textSpan = usageSpan(fn); - const definition: protocol.FileSpan = { file: dependencyTs.path, ...definitionSpan(fn) }; - const declareSpaceLength = "declare ".length; - return { - reqName: "goToDef", - request: { - command: protocol.CommandTypes.DefinitionAndBoundSpan, - arguments: { file: mainTs.path, ...textSpan.start } - }, - expectedResponse: { - // To dependency - definitions: [definition], - textSpan - }, - expectedResponseNoMap: { - // To the dts - definitions: [{ file: dtsPath, start: { line: fn, offset: definition.start.offset + declareSpaceLength }, end: { line: fn, offset: definition.end.offset + declareSpaceLength } }], - textSpan - }, - expectedResponseNoDts: { - // To import declaration - definitions: [{ file: mainTs.path, ...importSpan(fn) }], - textSpan - } - }; - } - - function definitionSpan(fn: number): protocol.TextSpan { - return { start: { line: fn, offset: 17 }, end: { line: fn, offset: 20 } }; - } - function importSpan(fn: number): protocol.TextSpan { - return { start: { line: fn + 1, offset: 5 }, end: { line: fn + 1, offset: 8 } }; - } - function usageSpan(fn: number): protocol.TextSpan { - return { start: { line: fn + 8, offset: 1 }, end: { line: fn + 8, offset: 4 } }; - } - - function renameFromDependencyTs(fn: number): SessionAction { - const triggerSpan = definitionSpan(fn); - return { - reqName: "rename", - request: { - command: protocol.CommandTypes.Rename, - arguments: { file: dependencyTs.path, ...triggerSpan.start } - }, - expectedResponse: { - info: { - canRename: true, - fileToRename: undefined, - displayName: `fn${fn}`, - fullDisplayName: `"${dependecyLocation}/FnS".fn${fn}`, - kind: ScriptElementKind.functionElement, - kindModifiers: "export", - triggerSpan - }, - locs: [ - { file: dependencyTs.path, locs: [triggerSpan] } - ] - } - }; - } - - function renameFromDependencyTsWithBothProjectsOpen(fn: number): SessionAction { - const { reqName, request, expectedResponse } = renameFromDependencyTs(fn); - const { info, locs } = expectedResponse; - return { - reqName, - request, - expectedResponse: { - info, - locs: [ - locs[0], - { - file: mainTs.path, - locs: [ - importSpan(fn), - usageSpan(fn) - ] - } - ] - }, - // Only dependency result - expectedResponseNoMap: expectedResponse, - expectedResponseNoDts: expectedResponse - }; - } - - // Returns request and expected Response - type SessionActionGetter = (fn: number) => SessionAction; - // Open File, expectedProjectActualFiles, actionGetter, openFileLastLine - interface DocumentPositionMapperVerifier { - openFile: File; - expectedProjectActualFiles: ReadonlyArray; - actionGetter: SessionActionGetter; - openFileLastLine: number; - } - function verifyDocumentPositionMapperUpdates( - mainScenario: string, - verifier: ReadonlyArray, - closedInfos: ReadonlyArray) { - - const openFiles = verifier.map(v => v.openFile); - const expectedProjectActualFiles = verifier.map(v => v.expectedProjectActualFiles); - const actionGetters = verifier.map(v => v.actionGetter); - const openFileLastLines = verifier.map(v => v.openFileLastLine); - - const configFiles = openFiles.map(openFile => `${getDirectoryPath(openFile.path)}/tsconfig.json`); - const openInfos = openFiles.map(f => f.path); - // When usage and dependency are used, dependency config is part of closedInfo so ignore - const otherWatchedFiles = verifier.length > 1 ? [configFiles[0]] : configFiles; - function openTsFile(onHostCreate?: (host: TestServerHost) => void) { - const host = createHost(files, [mainConfig.path]); - if (onHostCreate) { - onHostCreate(host); - } - const session = createSession(host); - openFilesForSession([...openFiles, randomFile], session); - return { host, session }; - } - - function checkProject(session: TestSession, noDts?: true) { - const service = session.getProjectService(); - checkNumberOfProjects(service, { configuredProjects: 1 + verifier.length }); - configFiles.forEach((configFile, index) => { - checkProjectActualFiles( - service.configuredProjects.get(configFile)!, - noDts ? - expectedProjectActualFiles[index].filter(f => f.toLowerCase() !== dtsPath) : - expectedProjectActualFiles[index] - ); - }); - } - - function verifyInfos(session: TestSession, host: TestServerHost) { - verifyInfosWithRandom(session, host, openInfos, closedInfos, otherWatchedFiles); - } - - function verifyInfosWhenNoMapFile(session: TestSession, host: TestServerHost, dependencyTsOK?: true) { - const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); - verifyInfosWithRandom( - session, - host, - openInfos, - closedInfos.filter(f => f !== dtsMapClosedInfo && (dependencyTsOK || f !== dependencyTs.path)), - dtsMapClosedInfo ? otherWatchedFiles.concat(dtsMapClosedInfo) : otherWatchedFiles - ); - } - - function verifyInfosWhenNoDtsFile(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { - const dtsMapClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsMapPath ? f : undefined); - const dtsClosedInfo = firstDefined(closedInfos, f => f.toLowerCase() === dtsPath ? f : undefined); - verifyInfosWithRandom( - session, - host, - openInfos, - closedInfos.filter(f => (dependencyTsAndMapOk || f !== dtsMapClosedInfo) && f !== dtsClosedInfo && (dependencyTsAndMapOk || f !== dependencyTs.path)), - // When project actual file contains dts, it needs to be watched - dtsClosedInfo && expectedProjectActualFiles.some(expectedProjectActualFiles => expectedProjectActualFiles.some(f => f.toLowerCase() === dtsPath)) ? - otherWatchedFiles.concat(dtsClosedInfo) : - otherWatchedFiles - ); - } - - function verifyDocumentPositionMapper(session: TestSession, dependencyMap: server.ScriptInfo, documentPositionMapper: server.ScriptInfo["documentPositionMapper"], notEqual?: true) { - assert.strictEqual(session.getProjectService().filenameToScriptInfo.get(dtsMapPath), dependencyMap); - if (notEqual) { - assert.notStrictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); - } - else { - assert.strictEqual(dependencyMap.documentPositionMapper, documentPositionMapper); - } - } - - function action(actionGetter: SessionActionGetter, fn: number, session: TestSession) { - const { reqName, request, expectedResponse, expectedResponseNoMap, expectedResponseNoDts } = actionGetter(fn); - const { response } = session.executeCommandSeq(request); - return { reqName, response, expectedResponse, expectedResponseNoMap, expectedResponseNoDts }; - } - - function firstAction(session: TestSession) { - actionGetters.forEach(actionGetter => action(actionGetter, 1, session)); - } - - function verifyAllFnActionWorker(session: TestSession, verifyAction: (result: ReturnType, dtsInfo: server.ScriptInfo | undefined, isFirst: boolean) => void, dtsAbsent?: true) { - // action - let isFirst = true; - for (const actionGetter of actionGetters) { - for (let fn = 1; fn <= 5; fn++) { - const result = action(actionGetter, fn, session); - const dtsInfo = session.getProjectService().filenameToScriptInfo.get(dtsPath); - if (dtsAbsent) { - assert.isUndefined(dtsInfo); - } - else { - assert.isDefined(dtsInfo); - } - verifyAction(result, dtsInfo, isFirst); - isFirst = false; - } - } - } - - function verifyAllFnAction( - session: TestSession, - host: TestServerHost, - firstDocumentPositionMapperNotEquals?: true, - dependencyMap?: server.ScriptInfo, - documentPositionMapper?: server.ScriptInfo["documentPositionMapper"] - ) { - // action - verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse }, dtsInfo, isFirst) => { - assert.deepEqual(response, expectedResponse, `Failed on ${reqName}`); - verifyInfos(session, host); - assert.equal(dtsInfo!.sourceMapFilePath, dtsMapPath); - if (isFirst) { - if (dependencyMap) { - verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper, firstDocumentPositionMapperNotEquals); - documentPositionMapper = dependencyMap.documentPositionMapper; - } - else { - dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; - documentPositionMapper = dependencyMap.documentPositionMapper; - } - } - else { - verifyDocumentPositionMapper(session, dependencyMap!, documentPositionMapper); - } - }); - return { dependencyMap: dependencyMap!, documentPositionMapper }; - } - - function verifyAllFnActionWithNoMap( - session: TestSession, - host: TestServerHost, - dependencyTsOK?: true - ) { - let sourceMapFilePath: server.ScriptInfo["sourceMapFilePath"]; - // action - verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoMap }, dtsInfo, isFirst) => { - assert.deepEqual(response, expectedResponseNoMap || expectedResponse, `Failed on ${reqName}`); - verifyInfosWhenNoMapFile(session, host, dependencyTsOK); - assert.isUndefined(session.getProjectService().filenameToScriptInfo.get(dtsMapPath)); - if (isFirst) { - assert.isNotString(dtsInfo!.sourceMapFilePath); - assert.isNotFalse(dtsInfo!.sourceMapFilePath); - assert.isDefined(dtsInfo!.sourceMapFilePath); - sourceMapFilePath = dtsInfo!.sourceMapFilePath; - } - else { - assert.equal(dtsInfo!.sourceMapFilePath, sourceMapFilePath); - } - }); - return sourceMapFilePath; - } - - function verifyAllFnActionWithNoDts( - session: TestSession, - host: TestServerHost, - dependencyTsAndMapOk?: true - ) { - // action - verifyAllFnActionWorker(session, ({ reqName, response, expectedResponse, expectedResponseNoDts }) => { - assert.deepEqual(response, expectedResponseNoDts || expectedResponse, `Failed on ${reqName}`); - verifyInfosWhenNoDtsFile(session, host, dependencyTsAndMapOk); - }, /*dtsAbsent*/ true); - } - - function verifyScenarioWithChangesWorker( - change: (host: TestServerHost, session: TestSession) => void, - afterActionDocumentPositionMapperNotEquals: true | undefined, - timeoutBeforeAction: boolean - ) { - const { host, session } = openTsFile(); - - // Create DocumentPositionMapper - firstAction(session); - const dependencyMap = session.getProjectService().filenameToScriptInfo.get(dtsMapPath)!; - const documentPositionMapper = dependencyMap.documentPositionMapper; - - // change - change(host, session); - if (timeoutBeforeAction) { - host.runQueuedTimeoutCallbacks(); - checkProject(session); - verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); - } - - // action - verifyAllFnAction(session, host, afterActionDocumentPositionMapperNotEquals, dependencyMap, documentPositionMapper); - } - - function verifyScenarioWithChanges( - scenarioName: string, - change: (host: TestServerHost, session: TestSession) => void, - afterActionDocumentPositionMapperNotEquals?: true - ) { - describe(scenarioName, () => { - it("when timeout occurs before request", () => { - verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ true); - }); - - it("when timeout does not occur before request", () => { - verifyScenarioWithChangesWorker(change, afterActionDocumentPositionMapperNotEquals, /*timeoutBeforeAction*/ false); - }); - }); - } - - function verifyMainScenarioAndScriptInfoCollection(session: TestSession, host: TestServerHost) { - // Main scenario action - const { dependencyMap, documentPositionMapper } = verifyAllFnAction(session, host); - checkProject(session); - verifyInfos(session, host); - - // Collecting at this point retains dependency.d.ts and map - closeFilesForSession([randomFile], session); - openFilesForSession([randomFile], session); - verifyInfos(session, host); - verifyDocumentPositionMapper(session, dependencyMap, documentPositionMapper); - - // Closing open file, removes dependencies too - closeFilesForSession([...openFiles, randomFile], session); - openFilesForSession([randomFile], session); - verifyOnlyRandomInfos(session, host); - } - - function verifyMainScenarioAndScriptInfoCollectionWithNoMap(session: TestSession, host: TestServerHost, dependencyTsOKInScenario?: true) { - // Main scenario action - verifyAllFnActionWithNoMap(session, host, dependencyTsOKInScenario); - - // Collecting at this point retains dependency.d.ts and map watcher - closeFilesForSession([randomFile], session); - openFilesForSession([randomFile], session); - verifyInfosWhenNoMapFile(session, host); - - // Closing open file, removes dependencies too - closeFilesForSession([...openFiles, randomFile], session); - openFilesForSession([randomFile], session); - verifyOnlyRandomInfos(session, host); - } - - function verifyMainScenarioAndScriptInfoCollectionWithNoDts(session: TestSession, host: TestServerHost, dependencyTsAndMapOk?: true) { - // Main scenario action - verifyAllFnActionWithNoDts(session, host, dependencyTsAndMapOk); - - // Collecting at this point retains dependency.d.ts and map watcher - closeFilesForSession([randomFile], session); - openFilesForSession([randomFile], session); - verifyInfosWhenNoDtsFile(session, host); - - // Closing open file, removes dependencies too - closeFilesForSession([...openFiles, randomFile], session); - openFilesForSession([randomFile], session); - verifyOnlyRandomInfos(session, host); - } - - function verifyScenarioWhenFileNotPresent( - scenarioName: string, - fileLocation: string, - verifyScenarioAndScriptInfoCollection: (session: TestSession, host: TestServerHost, dependencyTsOk?: true) => void, - noDts?: true - ) { - describe(scenarioName, () => { - it(mainScenario, () => { - const { host, session } = openTsFile(host => host.deleteFile(fileLocation)); - checkProject(session, noDts); - - verifyScenarioAndScriptInfoCollection(session, host); - }); - - it("when file is created", () => { - let fileContents: string | undefined; - const { host, session } = openTsFile(host => { - fileContents = host.readFile(fileLocation); - host.deleteFile(fileLocation); - }); - firstAction(session); - - host.writeFile(fileLocation, fileContents!); - verifyMainScenarioAndScriptInfoCollection(session, host); - }); - - it("when file is deleted", () => { - const { host, session } = openTsFile(); - firstAction(session); - - // The dependency file is deleted when orphan files are collected - host.deleteFile(fileLocation); - verifyScenarioAndScriptInfoCollection(session, host, /*dependencyTsOk*/ true); - }); - }); - } - - it(mainScenario, () => { - const { host, session } = openTsFile(); - checkProject(session); - - verifyMainScenarioAndScriptInfoCollection(session, host); - }); - - // Edit - verifyScenarioWithChanges( - "when usage file changes, document position mapper doesnt change", - (_host, session) => openFiles.forEach( - (openFile, index) => session.executeCommandSeq({ - command: protocol.CommandTypes.Change, - arguments: { file: openFile.path, line: openFileLastLines[index], offset: 1, endLine: openFileLastLines[index], endOffset: 1, insertString: "const x = 10;" } - }) - ) - ); - - // Edit dts to add new fn - verifyScenarioWithChanges( - "when dependency .d.ts changes, document position mapper doesnt change", - host => host.writeFile( - dtsLocation, - host.readFile(dtsLocation)!.replace( - "//# sourceMappingURL=FnS.d.ts.map", - `export declare function fn6(): void; -//# sourceMappingURL=FnS.d.ts.map` - ) - ) - ); - - // Edit map file to represent added new line - verifyScenarioWithChanges( - "when dependency file's map changes", - host => host.writeFile( - dtsMapLocation, - `{"version":3,"file":"FnS.d.ts","sourceRoot":"","sources":["FnS.ts"],"names":[],"mappings":"AAAA,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,wBAAgB,GAAG,SAAM;AACzB,eAAO,MAAM,CAAC,KAAK,CAAC"}` - ), - /*afterActionDocumentPositionMapperNotEquals*/ true - ); - - verifyScenarioWhenFileNotPresent( - "when map file is not present", - dtsMapLocation, - verifyMainScenarioAndScriptInfoCollectionWithNoMap - ); - - verifyScenarioWhenFileNotPresent( - "when .d.ts file is not present", - dtsLocation, - verifyMainScenarioAndScriptInfoCollectionWithNoDts, - /*noDts*/ true - ); - } - - const usageVerifier: DocumentPositionMapperVerifier = { - openFile: mainTs, - expectedProjectActualFiles: [mainTs.path, libFile.path, mainConfig.path, dtsPath], - actionGetter: gotoDefintinionFromMainTs, - openFileLastLine: 14 - }; - describe("from project that uses dependency", () => { - const closedInfos = [dependencyTs.path, dependencyConfig.path, libFile.path, dtsPath, dtsMapLocation]; - verifyDocumentPositionMapperUpdates( - "can go to definition correctly", - [usageVerifier], - closedInfos - ); - }); - - const definingVerifier: DocumentPositionMapperVerifier = { - openFile: dependencyTs, - expectedProjectActualFiles: [dependencyTs.path, libFile.path, dependencyConfig.path], - actionGetter: renameFromDependencyTs, - openFileLastLine: 6 - }; - describe("from defining project", () => { - const closedInfos = [libFile.path, dtsLocation, dtsMapLocation]; - verifyDocumentPositionMapperUpdates( - "rename locations from dependency", - [definingVerifier], - closedInfos - ); - }); - - describe("when opening depedency and usage project", () => { - const closedInfos = [libFile.path, dtsPath, dtsMapLocation, dependencyConfig.path]; - verifyDocumentPositionMapperUpdates( - "goto Definition in usage and rename locations from defining project", - [usageVerifier, { ...definingVerifier, actionGetter: renameFromDependencyTsWithBothProjectsOpen }], - closedInfos - ); - }); - }); - }); - - describe("tsserverProjectSystem duplicate packages", () => { - // Tests that 'moduleSpecifiers.ts' will import from the redirecting file, and not from the file it redirects to, if that can provide a global module specifier. - it("works with import fixes", () => { - const packageContent = "export const foo: number;"; - const packageJsonContent = JSON.stringify({ name: "foo", version: "1.2.3" }); - const aFooIndex: File = { path: "/a/node_modules/foo/index.d.ts", content: packageContent }; - const aFooPackage: File = { path: "/a/node_modules/foo/package.json", content: packageJsonContent }; - const bFooIndex: File = { path: "/b/node_modules/foo/index.d.ts", content: packageContent }; - const bFooPackage: File = { path: "/b/node_modules/foo/package.json", content: packageJsonContent }; - - const userContent = 'import("foo");\nfoo'; - const aUser: File = { path: "/a/user.ts", content: userContent }; - const bUser: File = { path: "/b/user.ts", content: userContent }; - const tsconfig: File = { - path: "/tsconfig.json", - content: "{}", - }; - - const host = createServerHost([aFooIndex, aFooPackage, bFooIndex, bFooPackage, aUser, bUser, tsconfig]); - const session = createSession(host); - - openFilesForSession([aUser, bUser], session); - - for (const user of [aUser, bUser]) { - const response = executeSessionRequest(session, protocol.CommandTypes.GetCodeFixes, { - file: user.path, - startLine: 2, - startOffset: 1, - endLine: 2, - endOffset: 4, - errorCodes: [Diagnostics.Cannot_find_name_0.code], - }); - assert.deepEqual | undefined>(response, [ - { - description: `Import 'foo' from module "foo"`, - fixName: "import", - fixId: "fixMissingImport", - fixAllDescription: "Add all missing imports", - changes: [{ - fileName: user.path, - textChanges: [{ - start: { line: 1, offset: 1 }, - end: { line: 1, offset: 1 }, - newText: 'import { foo } from "foo";\n\n', - }], - }], - commands: undefined, - }, - ]); - } - }); - }); - - describe("tsserverProjectSystem Untitled files", () => { - it("Can convert positions to locations", () => { - const aTs: File = { path: "/proj/a.ts", content: "" }; - const tsconfig: File = { path: "/proj/tsconfig.json", content: "{}" }; - const session = createSession(createServerHost([aTs, tsconfig])); - - openFilesForSession([aTs], session); - - const untitledFile = "untitled:^Untitled-1"; - executeSessionRequestNoResponse(session, protocol.CommandTypes.Open, { - file: untitledFile, - fileContent: `/// \nlet foo = 1;\nfooo/**/`, - scriptKindName: "TS", - projectRootPath: "/proj", - }); - - const response = executeSessionRequest(session, protocol.CommandTypes.GetCodeFixes, { - file: untitledFile, - startLine: 3, - startOffset: 1, - endLine: 3, - endOffset: 5, - errorCodes: [Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], - }); - assert.deepEqual | undefined>(response, [ - { - description: "Change spelling to 'foo'", - fixAllDescription: "Fix all detected spelling errors", - fixId: "fixSpelling", - fixName: "spelling", - changes: [{ - fileName: untitledFile, - textChanges: [{ - start: { line: 3, offset: 1 }, - end: { line: 3, offset: 5 }, - newText: "foo", - }], - }], - commands: undefined, - }, - ]); - }); - }); - - describe("tsserverProjectSystem with metadata in response", () => { - const metadata = "Extra Info"; - function verifyOutput(host: TestServerHost, expectedResponse: protocol.Response) { - const output = host.getOutput().map(mapOutputToJson); - assert.deepEqual(output, [expectedResponse]); - host.clearOutput(); - } - - function verifyCommandWithMetadata(session: TestSession, host: TestServerHost, command: Partial, expectedResponseBody: U) { - command.seq = session.getSeq(); - command.type = "request"; - session.onMessage(JSON.stringify(command)); - verifyOutput(host, expectedResponseBody ? - { seq: 0, type: "response", command: command.command!, request_seq: command.seq, success: true, body: expectedResponseBody, metadata } : - { seq: 0, type: "response", command: command.command!, request_seq: command.seq, success: false, message: "No content available." } - ); - } - - const aTs: File = { path: "/a.ts", content: `class c { prop = "hello"; foo() { return this.prop; } }` }; - const tsconfig: File = { - path: "/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { plugins: [{ name: "myplugin" }] } - }) - }; - function createHostWithPlugin(files: ReadonlyArray) { - const host = createServerHost(files); - host.require = (_initialPath, moduleName) => { - assert.equal(moduleName, "myplugin"); - return { - module: () => ({ - create(info: server.PluginCreateInfo) { - const proxy = Harness.LanguageService.makeDefaultProxy(info); - proxy.getCompletionsAtPosition = (filename, position, options) => { - const result = info.languageService.getCompletionsAtPosition(filename, position, options); - if (result) { - result.metadata = metadata; - } - return result; - }; - return proxy; - } - }), - error: undefined - }; - }; - return host; - } - - describe("With completion requests", () => { - const completionRequestArgs: protocol.CompletionsRequestArgs = { - file: aTs.path, - line: 1, - offset: aTs.content.indexOf("this.") + 1 + "this.".length - }; - const expectedCompletionEntries: ReadonlyArray = [ - { name: "foo", kind: ScriptElementKind.memberFunctionElement, kindModifiers: "", sortText: "0" }, - { name: "prop", kind: ScriptElementKind.memberVariableElement, kindModifiers: "", sortText: "0" } - ]; - - it("can pass through metadata when the command returns array", () => { - const host = createHostWithPlugin([aTs, tsconfig]); - const session = createSession(host); - openFilesForSession([aTs], session); - verifyCommandWithMetadata>(session, host, { - command: protocol.CommandTypes.Completions, - arguments: completionRequestArgs - }, expectedCompletionEntries); - }); - - it("can pass through metadata when the command returns object", () => { - const host = createHostWithPlugin([aTs, tsconfig]); - const session = createSession(host); - openFilesForSession([aTs], session); - verifyCommandWithMetadata(session, host, { - command: protocol.CommandTypes.CompletionInfo, - arguments: completionRequestArgs - }, { - isGlobalCompletion: false, - isMemberCompletion: true, - isNewIdentifierLocation: false, - entries: expectedCompletionEntries - }); - }); - - it("returns undefined correctly", () => { - const aTs: File = { path: "/a.ts", content: `class c { prop = "hello"; foo() { const x = 0; } }` }; - const host = createHostWithPlugin([aTs, tsconfig]); - const session = createSession(host); - openFilesForSession([aTs], session); - verifyCommandWithMetadata(session, host, { - command: protocol.CommandTypes.Completions, - arguments: { file: aTs.path, line: 1, offset: aTs.content.indexOf("x") + 1 } - }, /*expectedResponseBody*/ undefined); - }); - }); - }); - - function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { - return { - ...protocolFileSpanFromSubstring(file, text, options), - isDefinition, - isWriteAccess: isDefinition, - lineText, - }; - } - - function makeReferenceEntry(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): ReferenceEntry { - return { - ...documentSpanFromSubstring(file, text, options), - isDefinition, - isWriteAccess: isDefinition, - isInString: undefined, - }; - } - - function checkDeclarationFiles(file: File, session: TestSession, expectedFiles: ReadonlyArray): void { - openFilesForSession([file], session); - const project = Debug.assertDefined(session.getProjectService().getDefaultProjectForFile(file.path as server.NormalizedPath, /*ensureProject*/ false)); - const program = project.getCurrentProgram()!; - const output = getFileEmitOutput(program, Debug.assertDefined(program.getSourceFile(file.path)), /*emitOnlyDtsFiles*/ true); - closeFilesForSession([file], session); - - Debug.assert(!output.emitSkipped); - assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false }))); - } } From db4d9b3050fec94f4c2687fc223ada8e24b2ab5f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 20 Dec 2018 13:20:53 -0800 Subject: [PATCH 239/322] Add unittests:: on all unittests describe blocks for easy run --- src/testRunner/unittests/asserts.ts | 2 +- src/testRunner/unittests/base64.ts | 2 +- src/testRunner/unittests/builder.ts | 2 +- src/testRunner/unittests/compilerCore.ts | 2 +- .../unittests/config/commandLineParsing.ts | 4 +-- .../config/configurationExtension.ts | 2 +- .../config/convertCompilerOptionsFromJson.ts | 2 +- .../config/convertTypeAcquisitionFromJson.ts | 2 +- .../unittests/config/initializeTSConfig.ts | 2 +- src/testRunner/unittests/config/matchFiles.ts | 2 +- .../unittests/config/projectReferences.ts | 12 ++++---- src/testRunner/unittests/config/showConfig.ts | 2 +- .../unittests/config/tsconfigParsing.ts | 2 +- src/testRunner/unittests/convertToBase64.ts | 2 +- src/testRunner/unittests/customTransforms.ts | 4 +-- .../unittests/evaluation/asyncArrow.ts | 2 +- .../unittests/evaluation/asyncGenerator.ts | 2 +- .../unittests/evaluation/forAwaitOf.ts | 2 +- src/testRunner/unittests/factory.ts | 2 +- src/testRunner/unittests/incrementalParser.ts | 2 +- src/testRunner/unittests/jsDocParsing.ts | 2 +- src/testRunner/unittests/moduleResolution.ts | 14 ++++----- src/testRunner/unittests/parsePseudoBigInt.ts | 4 +-- src/testRunner/unittests/paths.ts | 4 +-- src/testRunner/unittests/printer.ts | 2 +- src/testRunner/unittests/programApi.ts | 4 +-- .../unittests/reuseProgramStructure.ts | 6 ++-- src/testRunner/unittests/semver.ts | 4 +-- .../cancellableLanguageServiceOperations.ts | 2 +- .../unittests/services/colorization.ts | 2 +- .../services/convertToAsyncFunction.ts | 2 +- .../unittests/services/documentRegistry.ts | 2 +- .../unittests/services/extract/constants.ts | 2 +- .../unittests/services/extract/functions.ts | 2 +- .../unittests/services/extract/ranges.ts | 2 +- .../services/extract/symbolWalker.ts | 2 +- .../unittests/services/hostNewLineSupport.ts | 2 +- .../unittests/services/languageService.ts | 2 +- .../unittests/services/organizeImports.ts | 2 +- .../unittests/services/patternMatcher.ts | 2 +- .../unittests/services/preProcessFile.ts | 2 +- .../unittests/services/textChanges.ts | 2 +- .../unittests/services/transpile.ts | 2 +- src/testRunner/unittests/transform.ts | 2 +- src/testRunner/unittests/tsbuild.ts | 30 +++++++++---------- src/testRunner/unittests/tsbuildWatchMode.ts | 2 +- src/testRunner/unittests/tscWatch/emit.ts | 8 ++--- .../unittests/tscWatch/resolutionCache.ts | 4 +-- src/testRunner/unittests/tscWatch/watchApi.ts | 2 +- .../unittests/tscWatch/watchEnvironment.ts | 2 +- .../tsserver/cachingFileSystemInformation.ts | 2 +- .../unittests/tsserver/cancellationToken.ts | 2 +- .../unittests/tsserver/compileOnSave.ts | 4 +-- .../unittests/tsserver/completions.ts | 2 +- .../unittests/tsserver/configFileSearch.ts | 2 +- .../unittests/tsserver/declarationFileMaps.ts | 2 +- .../unittests/tsserver/documentRegistry.ts | 2 +- .../unittests/tsserver/duplicatePackages.ts | 2 +- .../tsserver/events/largeFileReferenced.ts | 2 +- .../tsserver/events/projectLoading.ts | 2 +- .../events/projectUpdatedInBackground.ts | 2 +- .../unittests/tsserver/externalProjects.ts | 2 +- .../forceConsistentCasingInFileNames.ts | 2 +- .../unittests/tsserver/formatSettings.ts | 2 +- .../tsserver/getEditsForFileRename.ts | 2 +- .../unittests/tsserver/importHelpers.ts | 2 +- .../unittests/tsserver/inferredProjects.ts | 2 +- .../unittests/tsserver/languageService.ts | 2 +- .../tsserver/maxNodeModuleJsDepth.ts | 2 +- .../unittests/tsserver/metadataInResponse.ts | 2 +- src/testRunner/unittests/tsserver/navTo.ts | 2 +- .../unittests/tsserver/occurences.ts | 2 +- src/testRunner/unittests/tsserver/openFile.ts | 2 +- .../unittests/tsserver/projectErrors.ts | 12 ++++---- .../unittests/tsserver/projectReferences.ts | 2 +- .../unittests/tsserver/refactors.ts | 2 +- src/testRunner/unittests/tsserver/reload.ts | 2 +- src/testRunner/unittests/tsserver/rename.ts | 2 +- .../unittests/tsserver/resolutionCache.ts | 10 +++---- src/testRunner/unittests/tsserver/session.ts | 10 +++---- .../unittests/tsserver/skipLibCheck.ts | 2 +- src/testRunner/unittests/tsserver/symLinks.ts | 2 +- .../unittests/tsserver/syntaxOperations.ts | 2 +- .../unittests/tsserver/telemetry.ts | 2 +- .../unittests/tsserver/textStorage.ts | 2 +- .../unittests/tsserver/typeAquisition.ts | 4 +-- .../tsserver/typeReferenceDirectives.ts | 2 +- .../unittests/tsserver/typingsInstaller.ts | 20 ++++++------- .../unittests/tsserver/untitledFiles.ts | 2 +- .../unittests/tsserver/versionCache.ts | 6 ++-- .../unittests/tsserver/watchEnvironment.ts | 4 +-- 91 files changed, 155 insertions(+), 155 deletions(-) diff --git a/src/testRunner/unittests/asserts.ts b/src/testRunner/unittests/asserts.ts index 8d5138085a8..c54173e2f90 100644 --- a/src/testRunner/unittests/asserts.ts +++ b/src/testRunner/unittests/asserts.ts @@ -1,5 +1,5 @@ namespace ts { - describe("assert", () => { + describe("unittests:: assert", () => { it("deepEqual", () => { assert.throws(() => assert.deepEqual(createNodeArray([createIdentifier("A")]), createNodeArray([createIdentifier("B")]))); assert.throws(() => assert.deepEqual(createNodeArray([], /*hasTrailingComma*/ true), createNodeArray([], /*hasTrailingComma*/ false))); diff --git a/src/testRunner/unittests/base64.ts b/src/testRunner/unittests/base64.ts index 11c2623df65..1dc51a8fbf5 100644 --- a/src/testRunner/unittests/base64.ts +++ b/src/testRunner/unittests/base64.ts @@ -1,5 +1,5 @@ namespace ts { - describe("base64", () => { + describe("unittests:: base64", () => { describe("base64decode", () => { it("can decode input strings correctly without needing a host implementation", () => { const tests = [ diff --git a/src/testRunner/unittests/builder.ts b/src/testRunner/unittests/builder.ts index 4a163d6b56b..709222a4dff 100644 --- a/src/testRunner/unittests/builder.ts +++ b/src/testRunner/unittests/builder.ts @@ -1,5 +1,5 @@ namespace ts { - describe("builder", () => { + describe("unittests:: builder", () => { it("emits dependent files", () => { const files: NamedSourceText[] = [ { name: "/a.ts", text: SourceText.New("", 'import { b } from "./b";', "") }, diff --git a/src/testRunner/unittests/compilerCore.ts b/src/testRunner/unittests/compilerCore.ts index 27f5cdc0887..4c3918c3149 100644 --- a/src/testRunner/unittests/compilerCore.ts +++ b/src/testRunner/unittests/compilerCore.ts @@ -1,5 +1,5 @@ namespace ts { - describe("compilerCore", () => { + describe("unittests:: compilerCore", () => { describe("equalOwnProperties", () => { it("correctly equates objects", () => { assert.isTrue(equalOwnProperties({}, {})); diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index be7f6dca3c5..25fa3a45050 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("config:: commandLineParsing:: parseCommandLine", () => { + describe("unittests:: config:: commandLineParsing:: parseCommandLine", () => { function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine) { const parsed = parseCommandLine(commandLine); @@ -367,7 +367,7 @@ namespace ts { }); }); - describe("config:: commandLineParsing:: parseBuildOptions", () => { + describe("unittests:: config:: commandLineParsing:: parseBuildOptions", () => { function assertParseResult(commandLine: string[], expectedParsedBuildCommand: ParsedBuildCommand) { const parsed = parseBuildCommand(commandLine); const parsedBuildOptions = JSON.stringify(parsed.buildOptions); diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index 0e7cd0821c4..25e975c0fb2 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -208,7 +208,7 @@ namespace ts { } } - describe("config:: configurationExtension", () => { + describe("unittests:: config:: configurationExtension", () => { forEach<[string, string, fakes.ParseConfigHost], void>([ ["under a case insensitive host", caseInsensitiveBasePath, caseInsensitiveHost], ["under a case sensitive host", caseSensitiveBasePath, caseSensitiveHost] diff --git a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts index 4a3a42ce216..318bc0ceb26 100644 --- a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts +++ b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts @@ -1,5 +1,5 @@ namespace ts { - describe("config:: convertCompilerOptionsFromJson", () => { + describe("unittests:: config:: convertCompilerOptionsFromJson", () => { const formatDiagnosticHost: FormatDiagnosticsHost = { getCurrentDirectory: () => "/apath/", getCanonicalFileName: createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ true), diff --git a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts index 0998b0b0d7a..890cad4ade6 100644 --- a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts +++ b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts @@ -1,6 +1,6 @@ namespace ts { interface ExpectedResult { typeAcquisition: TypeAcquisition; errors: Diagnostic[]; } - describe("config:: convertTypeAcquisitionFromJson", () => { + describe("unittests:: config:: convertTypeAcquisitionFromJson", () => { function assertTypeAcquisition(json: any, configFileName: string, expectedResult: ExpectedResult) { assertTypeAcquisitionWithJson(json, configFileName, expectedResult); assertTypeAcquisitionWithJsonNode(json, configFileName, expectedResult); diff --git a/src/testRunner/unittests/config/initializeTSConfig.ts b/src/testRunner/unittests/config/initializeTSConfig.ts index 09d80c7f5c2..f7fb7d2a439 100644 --- a/src/testRunner/unittests/config/initializeTSConfig.ts +++ b/src/testRunner/unittests/config/initializeTSConfig.ts @@ -1,5 +1,5 @@ namespace ts { - describe("config:: initTSConfig", () => { + describe("unittests:: config:: initTSConfig", () => { function initTSConfigCorrectly(name: string, commandLinesArgs: string[]) { describe(name, () => { const commandLine = parseCommandLine(commandLinesArgs); diff --git a/src/testRunner/unittests/config/matchFiles.ts b/src/testRunner/unittests/config/matchFiles.ts index 9155cb26a1c..a30fa468443 100644 --- a/src/testRunner/unittests/config/matchFiles.ts +++ b/src/testRunner/unittests/config/matchFiles.ts @@ -143,7 +143,7 @@ namespace ts { return createFileDiagnostic(file, start, length, diagnosticMessage, arg0); } - describe("config:: matchFiles", () => { + describe("unittests:: config:: matchFiles", () => { it("with defaults", () => { const json = {}; const expected: ParsedCommandLine = { diff --git a/src/testRunner/unittests/config/projectReferences.ts b/src/testRunner/unittests/config/projectReferences.ts index be8e0be6206..266b016c681 100644 --- a/src/testRunner/unittests/config/projectReferences.ts +++ b/src/testRunner/unittests/config/projectReferences.ts @@ -96,7 +96,7 @@ namespace ts { checkResult(prog, host); } - describe("config:: project-references meta check", () => { + describe("unittests:: config:: project-references meta check", () => { it("default setup was created correctly", () => { const spec: TestSpecification = { "/primary": { @@ -118,7 +118,7 @@ namespace ts { /** * Validate that we enforce the basic settings constraints for referenced projects */ - describe("config:: project-references constraint checking for settings", () => { + describe("unittests:: config:: project-references constraint checking for settings", () => { it("errors when declaration = false", () => { const spec: TestSpecification = { "/primary": { @@ -248,7 +248,7 @@ namespace ts { /** * Path mapping behavior */ - describe("config:: project-references path mapping", () => { + describe("unittests:: config:: project-references path mapping", () => { it("redirects to the output .d.ts file", () => { const spec: TestSpecification = { "/alpha": { @@ -268,7 +268,7 @@ namespace ts { }); }); - describe("config:: project-references nice-behavior", () => { + describe("unittests:: config:: project-references nice-behavior", () => { it("issues a nice error when the input file is missing", () => { const spec: TestSpecification = { "/alpha": { @@ -289,7 +289,7 @@ namespace ts { /** * 'composite' behavior */ - describe("config:: project-references behavior changes under composite: true", () => { + describe("unittests:: config:: project-references behavior changes under composite: true", () => { it("doesn't infer the rootDir from source paths", () => { const spec: TestSpecification = { "/alpha": { @@ -308,7 +308,7 @@ namespace ts { }); }); - describe("config:: project-references errors when a file in a composite project occurs outside the root", () => { + describe("unittests:: config:: project-references errors when a file in a composite project occurs outside the root", () => { it("Errors when a file is outside the rootdir", () => { const spec: TestSpecification = { "/alpha": { diff --git a/src/testRunner/unittests/config/showConfig.ts b/src/testRunner/unittests/config/showConfig.ts index f86b37970f5..afe8f878d27 100644 --- a/src/testRunner/unittests/config/showConfig.ts +++ b/src/testRunner/unittests/config/showConfig.ts @@ -1,5 +1,5 @@ namespace ts { - describe("config:: showConfig", () => { + describe("unittests:: config:: showConfig", () => { function showTSConfigCorrectly(name: string, commandLinesArgs: string[], configJson?: object) { describe(name, () => { const outputFileName = `showConfig/${name.replace(/[^a-z0-9\-./ ]/ig, "")}/tsconfig.json`; diff --git a/src/testRunner/unittests/config/tsconfigParsing.ts b/src/testRunner/unittests/config/tsconfigParsing.ts index cc617a0d151..638a394a34e 100644 --- a/src/testRunner/unittests/config/tsconfigParsing.ts +++ b/src/testRunner/unittests/config/tsconfigParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("config:: tsconfigParsing:: parseConfigFileTextToJson", () => { + describe("unittests:: config:: tsconfigParsing:: parseConfigFileTextToJson", () => { function assertParseResult(jsonText: string, expectedConfigObject: { config?: any; error?: Diagnostic[] }) { const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); assert.equal(JSON.stringify(parsed), JSON.stringify(expectedConfigObject)); diff --git a/src/testRunner/unittests/convertToBase64.ts b/src/testRunner/unittests/convertToBase64.ts index 56c95622977..37e38da8da7 100644 --- a/src/testRunner/unittests/convertToBase64.ts +++ b/src/testRunner/unittests/convertToBase64.ts @@ -1,5 +1,5 @@ namespace ts { - describe("convertToBase64", () => { + describe("unittests:: convertToBase64", () => { function runTest(input: string): void { const actual = convertToBase64(input); const expected = sys.base64encode!(input); diff --git a/src/testRunner/unittests/customTransforms.ts b/src/testRunner/unittests/customTransforms.ts index c4ff21d0a25..304c0a55c59 100644 --- a/src/testRunner/unittests/customTransforms.ts +++ b/src/testRunner/unittests/customTransforms.ts @@ -1,5 +1,5 @@ namespace ts { - describe("customTransforms", () => { + describe("unittests:: customTransforms", () => { function emitsCorrectly(name: string, sources: { file: string, text: string }[], customTransformers: CustomTransformers, options: CompilerOptions = {}) { it(name, () => { const roots = sources.map(source => createSourceFile(source.file, source.text, ScriptTarget.ES2015)); @@ -97,4 +97,4 @@ namespace ts { experimentalDecorators: true }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/evaluation/asyncArrow.ts b/src/testRunner/unittests/evaluation/asyncArrow.ts index 01959ca150f..04a7af613fa 100644 --- a/src/testRunner/unittests/evaluation/asyncArrow.ts +++ b/src/testRunner/unittests/evaluation/asyncArrow.ts @@ -1,4 +1,4 @@ -describe("evaluation:: asyncArrowEvaluation", () => { +describe("unittests:: evaluation:: asyncArrowEvaluation", () => { // https://github.com/Microsoft/TypeScript/issues/24722 it("this capture (es5)", async () => { const result = evaluator.evaluateTypeScript(` diff --git a/src/testRunner/unittests/evaluation/asyncGenerator.ts b/src/testRunner/unittests/evaluation/asyncGenerator.ts index cb630d28724..8ca531f0759 100644 --- a/src/testRunner/unittests/evaluation/asyncGenerator.ts +++ b/src/testRunner/unittests/evaluation/asyncGenerator.ts @@ -1,4 +1,4 @@ -describe("evaluation:: asyncGeneratorEvaluation", () => { +describe("unittests:: evaluation:: asyncGeneratorEvaluation", () => { it("return (es5)", async () => { const result = evaluator.evaluateTypeScript(` async function * g() { diff --git a/src/testRunner/unittests/evaluation/forAwaitOf.ts b/src/testRunner/unittests/evaluation/forAwaitOf.ts index 7e7ee41e2f1..c7be018cbc9 100644 --- a/src/testRunner/unittests/evaluation/forAwaitOf.ts +++ b/src/testRunner/unittests/evaluation/forAwaitOf.ts @@ -1,4 +1,4 @@ -describe("evaluation:: forAwaitOfEvaluation", () => { +describe("unittests:: evaluation:: forAwaitOfEvaluation", () => { it("sync (es5)", async () => { const result = evaluator.evaluateTypeScript(` let i = 0; diff --git a/src/testRunner/unittests/factory.ts b/src/testRunner/unittests/factory.ts index 402c399d728..cc760059c19 100644 --- a/src/testRunner/unittests/factory.ts +++ b/src/testRunner/unittests/factory.ts @@ -1,5 +1,5 @@ namespace ts { - describe("FactoryAPI", () => { + describe("unittests:: FactoryAPI", () => { function assertSyntaxKind(node: Node, expected: SyntaxKind) { assert.strictEqual(node.kind, expected, `Actual: ${Debug.showSyntaxKind(node)} Expected: ${(ts as any).SyntaxKind[expected]}`); } diff --git a/src/testRunner/unittests/incrementalParser.ts b/src/testRunner/unittests/incrementalParser.ts index fb3408b1fc3..8af44494803 100644 --- a/src/testRunner/unittests/incrementalParser.ts +++ b/src/testRunner/unittests/incrementalParser.ts @@ -120,7 +120,7 @@ namespace ts { } } - describe("Incremental", () => { + describe("unittests:: Incremental Parser", () => { it("Inserting into method", () => { const source = "class C {\r\n" + " public foo1() { }\r\n" + diff --git a/src/testRunner/unittests/jsDocParsing.ts b/src/testRunner/unittests/jsDocParsing.ts index 931785aa94d..4171a330f32 100644 --- a/src/testRunner/unittests/jsDocParsing.ts +++ b/src/testRunner/unittests/jsDocParsing.ts @@ -1,5 +1,5 @@ namespace ts { - describe("JSDocParsing", () => { + describe("unittests:: JSDocParsing", () => { describe("TypeExpressions", () => { function parsesCorrectly(name: string, content: string) { it(name, () => { diff --git a/src/testRunner/unittests/moduleResolution.ts b/src/testRunner/unittests/moduleResolution.ts index 28f25437149..69560e5449c 100644 --- a/src/testRunner/unittests/moduleResolution.ts +++ b/src/testRunner/unittests/moduleResolution.ts @@ -80,7 +80,7 @@ namespace ts { } } - describe("moduleResolution:: Node module resolution - relative paths", () => { + describe("unittests:: moduleResolution:: Node module resolution - relative paths", () => { function testLoadAsFile(containingFileName: string, moduleFileNameNoExt: string, moduleName: string): void { for (const ext of supportedTSExtensions) { @@ -200,7 +200,7 @@ namespace ts { }); }); - describe("moduleResolution:: Node module resolution - non-relative paths", () => { + describe("unittests:: moduleResolution:: Node module resolution - non-relative paths", () => { it("computes correct commonPrefix for moduleName cache", () => { const resolutionCache = createModuleResolutionCache("/", (f) => f); let cache = resolutionCache.getOrCreateCacheForModuleName("a"); @@ -457,7 +457,7 @@ namespace ts { }); }); - describe("moduleResolution:: Relative imports", () => { + describe("unittests:: moduleResolution:: Relative imports", () => { function test(files: Map, currentDirectory: string, rootFiles: string[], expectedFilesCount: number, relativeNamesToCheck: string[]) { const options: CompilerOptions = { module: ModuleKind.CommonJS }; const host: CompilerHost = { @@ -530,7 +530,7 @@ export = C; }); }); - describe("moduleResolution:: Files with different casing", () => { + describe("unittests:: moduleResolution:: Files with different casing", () => { let library: SourceFile; function test(files: Map, options: CompilerOptions, currentDirectory: string, useCaseSensitiveFileNames: boolean, rootFiles: string[], diagnosticCodes: number[]): void { const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); @@ -651,7 +651,7 @@ import b = require("./moduleB"); }); }); - describe("moduleResolution:: baseUrl augmented module resolution", () => { + describe("unittests:: moduleResolution:: baseUrl augmented module resolution", () => { it("module resolution without path mappings/rootDirs", () => { test(/*hasDirectoryExists*/ false); @@ -1098,7 +1098,7 @@ import b = require("./moduleB"); }); }); - describe("moduleResolution:: ModuleResolutionHost.directoryExists", () => { + describe("unittests:: moduleResolution:: ModuleResolutionHost.directoryExists", () => { it("No 'fileExists' calls if containing directory is missing", () => { const host: ModuleResolutionHost = { readFile: notImplemented, @@ -1111,7 +1111,7 @@ import b = require("./moduleB"); }); }); - describe("moduleResolution:: Type reference directive resolution: ", () => { + describe("unittests:: moduleResolution:: Type reference directive resolution: ", () => { function testWorker(hasDirectoryExists: boolean, typesRoot: string | undefined, typeDirective: string, primary: boolean, initialFile: File, targetFile: File, ...otherFiles: File[]) { const host = createModuleResolutionHost(hasDirectoryExists, ...[initialFile, targetFile].concat(...otherFiles)); const result = resolveTypeReferenceDirective(typeDirective, initialFile.name, typesRoot ? { typeRoots: [typesRoot] } : {}, host); diff --git a/src/testRunner/unittests/parsePseudoBigInt.ts b/src/testRunner/unittests/parsePseudoBigInt.ts index 0ffbee6345e..db1a841dc2b 100644 --- a/src/testRunner/unittests/parsePseudoBigInt.ts +++ b/src/testRunner/unittests/parsePseudoBigInt.ts @@ -1,5 +1,5 @@ namespace ts { - describe("BigInt literal base conversions", () => { + describe("unittests:: BigInt literal base conversions", () => { describe("parsePseudoBigInt", () => { const testNumbers: number[] = []; for (let i = 0; i < 1e3; i++) testNumbers.push(i); @@ -68,4 +68,4 @@ namespace ts { }); }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/paths.ts b/src/testRunner/unittests/paths.ts index 0b28bedc929..b1555ab2174 100644 --- a/src/testRunner/unittests/paths.ts +++ b/src/testRunner/unittests/paths.ts @@ -1,4 +1,4 @@ -describe("core paths", () => { +describe("unittests:: core paths", () => { it("normalizeSlashes", () => { assert.strictEqual(ts.normalizeSlashes("a"), "a"); assert.strictEqual(ts.normalizeSlashes("a/b"), "a/b"); @@ -289,4 +289,4 @@ describe("core paths", () => { assert.strictEqual(ts.getRelativePathFromDirectory("file:///a/b/c", "file:///a/b", /*ignoreCase*/ false), ".."); assert.strictEqual(ts.getRelativePathFromDirectory("file:///c:", "file:///d:", /*ignoreCase*/ false), "file:///d:/"); }); -}); \ No newline at end of file +}); diff --git a/src/testRunner/unittests/printer.ts b/src/testRunner/unittests/printer.ts index 2e69cf60876..8e217aa6a3a 100644 --- a/src/testRunner/unittests/printer.ts +++ b/src/testRunner/unittests/printer.ts @@ -1,5 +1,5 @@ namespace ts { - describe("PrinterAPI", () => { + describe("unittests:: PrinterAPI", () => { function makePrintsCorrectly(prefix: string) { return function printsCorrectly(name: string, options: PrinterOptions, printCallback: (printer: Printer) => string) { it(name, () => { diff --git a/src/testRunner/unittests/programApi.ts b/src/testRunner/unittests/programApi.ts index 8fa107513fe..01ef6610dba 100644 --- a/src/testRunner/unittests/programApi.ts +++ b/src/testRunner/unittests/programApi.ts @@ -11,7 +11,7 @@ namespace ts { assert.equal(notFound.length, 0, `Not found ${notFound} in actual: ${missingPaths} expected: ${expected}`); } - describe("Program.getMissingFilePaths", () => { + describe("unittests:: Program.getMissingFilePaths", () => { const options: CompilerOptions = { noLib: true, @@ -127,7 +127,7 @@ namespace ts { }); }); - describe("Program.isSourceFileFromExternalLibrary", () => { + describe("unittests:: Program.isSourceFileFromExternalLibrary", () => { it("works on redirect files", () => { // In this example '/node_modules/foo/index.d.ts' will redirect to '/node_modules/bar/node_modules/foo/index.d.ts'. const a = new documents.TextDocument("/a.ts", 'import * as bar from "bar"; import * as foo from "foo";'); diff --git a/src/testRunner/unittests/reuseProgramStructure.ts b/src/testRunner/unittests/reuseProgramStructure.ts index 63b670912d8..c9ea0e77fec 100644 --- a/src/testRunner/unittests/reuseProgramStructure.ts +++ b/src/testRunner/unittests/reuseProgramStructure.ts @@ -210,7 +210,7 @@ namespace ts { checkCache("resolved type directives", program, fileName, expectedContent, f => f.resolvedTypeReferenceDirectiveNames, checkResolvedTypeDirective); } - describe("Reuse program structure:: General", () => { + describe("unittests:: Reuse program structure:: General", () => { const target = ScriptTarget.Latest; const files: NamedSourceText[] = [ { @@ -895,7 +895,7 @@ namespace ts { }); }); - describe("Reuse program structure:: host is optional", () => { + describe("unittests:: Reuse program structure:: host is optional", () => { it("should work if host is not provided", () => { createProgram([], {}); }); @@ -905,7 +905,7 @@ namespace ts { import createTestSystem = TestFSWithWatch.createWatchedSystem; import libFile = TestFSWithWatch.libFile; - describe("Reuse program structure:: isProgramUptoDate should return true when there is no change in compiler options and", () => { + describe("unittests:: Reuse program structure:: isProgramUptoDate should return true when there is no change in compiler options and", () => { function verifyProgramIsUptoDate( program: Program, newRootFileNames: string[], diff --git a/src/testRunner/unittests/semver.ts b/src/testRunner/unittests/semver.ts index 357a24307ca..079bdc3d512 100644 --- a/src/testRunner/unittests/semver.ts +++ b/src/testRunner/unittests/semver.ts @@ -1,6 +1,6 @@ namespace ts { import theory = utils.theory; - describe("semver", () => { + describe("unittests:: semver", () => { describe("Version", () => { function assertVersion(version: Version, [major, minor, patch, prerelease, build]: [number, number, number, string[]?, string[]?]) { assert.strictEqual(version.major, major); @@ -225,4 +225,4 @@ namespace ts { ]); }); }); -} \ No newline at end of file +} diff --git a/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts b/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts index 1d7e12d9825..9868d628d0c 100644 --- a/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts +++ b/src/testRunner/unittests/services/cancellableLanguageServiceOperations.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: cancellableLanguageServiceOperations", () => { + describe("unittests:: services:: cancellableLanguageServiceOperations", () => { const file = ` function foo(): void; function foo(x: T): T; diff --git a/src/testRunner/unittests/services/colorization.ts b/src/testRunner/unittests/services/colorization.ts index 54ea98dd563..71ba8bad394 100644 --- a/src/testRunner/unittests/services/colorization.ts +++ b/src/testRunner/unittests/services/colorization.ts @@ -6,7 +6,7 @@ interface ClassificationEntry { position?: number; } -describe("services:: Colorization", () => { +describe("unittests:: services:: Colorization", () => { // Use the shim adapter to ensure test coverage of the shim layer for the classifier const languageServiceAdapter = new Harness.LanguageService.ShimLanguageServiceAdapter(/*preprocessToResolve*/ false); const classifier = languageServiceAdapter.getClassifier(); diff --git a/src/testRunner/unittests/services/convertToAsyncFunction.ts b/src/testRunner/unittests/services/convertToAsyncFunction.ts index e8d857f2ee0..b89e684183b 100644 --- a/src/testRunner/unittests/services/convertToAsyncFunction.ts +++ b/src/testRunner/unittests/services/convertToAsyncFunction.ts @@ -343,7 +343,7 @@ interface Array {}` } } - describe("services:: convertToAsyncFunctions", () => { + describe("unittests:: services:: convertToAsyncFunctions", () => { _testConvertToAsyncFunction("convertToAsyncFunction_basic", ` function [#|f|](): Promise{ return fetch('https://typescriptlang.org').then(result => { console.log(result) }); diff --git a/src/testRunner/unittests/services/documentRegistry.ts b/src/testRunner/unittests/services/documentRegistry.ts index 96f2aaff76b..e7c80486e97 100644 --- a/src/testRunner/unittests/services/documentRegistry.ts +++ b/src/testRunner/unittests/services/documentRegistry.ts @@ -1,4 +1,4 @@ -describe("services:: DocumentRegistry", () => { +describe("unittests:: services:: DocumentRegistry", () => { it("documents are shared between projects", () => { const documentRegistry = ts.createDocumentRegistry(); const defaultCompilerOptions = ts.getDefaultCompilerOptions(); diff --git a/src/testRunner/unittests/services/extract/constants.ts b/src/testRunner/unittests/services/extract/constants.ts index 1ca5a719a82..d9cd5010d5b 100644 --- a/src/testRunner/unittests/services/extract/constants.ts +++ b/src/testRunner/unittests/services/extract/constants.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: extract:: extractConstants", () => { + describe("unittests:: services:: extract:: extractConstants", () => { testExtractConstant("extractConstant_TopLevel", `let x = [#|1|];`); diff --git a/src/testRunner/unittests/services/extract/functions.ts b/src/testRunner/unittests/services/extract/functions.ts index 21c5e8e9001..d872ad81a63 100644 --- a/src/testRunner/unittests/services/extract/functions.ts +++ b/src/testRunner/unittests/services/extract/functions.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: extract:: extractFunctions", () => { + describe("unittests:: services:: extract:: extractFunctions", () => { testExtractFunction("extractFunction1", `namespace A { let x = 1; diff --git a/src/testRunner/unittests/services/extract/ranges.ts b/src/testRunner/unittests/services/extract/ranges.ts index dc62618e0c6..265dd33e60a 100644 --- a/src/testRunner/unittests/services/extract/ranges.ts +++ b/src/testRunner/unittests/services/extract/ranges.ts @@ -42,7 +42,7 @@ namespace ts { } } - describe("services:: extract:: extractRanges", () => { + describe("unittests:: services:: extract:: extractRanges", () => { it("get extract range from selection", () => { testExtractRange(` [#| diff --git a/src/testRunner/unittests/services/extract/symbolWalker.ts b/src/testRunner/unittests/services/extract/symbolWalker.ts index 9d323a7544a..58d9dcb577f 100644 --- a/src/testRunner/unittests/services/extract/symbolWalker.ts +++ b/src/testRunner/unittests/services/extract/symbolWalker.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: extract:: Symbol Walker", () => { + describe("unittests:: services:: extract:: Symbol Walker", () => { function test(description: string, source: string, verifier: (file: SourceFile, checker: TypeChecker) => void) { it(description, () => { const result = Harness.Compiler.compileFiles([{ diff --git a/src/testRunner/unittests/services/hostNewLineSupport.ts b/src/testRunner/unittests/services/hostNewLineSupport.ts index 2f00c7b08e5..cafe4813431 100644 --- a/src/testRunner/unittests/services/hostNewLineSupport.ts +++ b/src/testRunner/unittests/services/hostNewLineSupport.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: hostNewLineSupport", () => { + describe("unittests:: services:: hostNewLineSupport", () => { function testLSWithFiles(settings: CompilerOptions, files: Harness.Compiler.TestFile[]) { function snapFor(path: string): IScriptSnapshot | undefined { if (path === "lib.d.ts") { diff --git a/src/testRunner/unittests/services/languageService.ts b/src/testRunner/unittests/services/languageService.ts index 332d59ca68a..d646f32383f 100644 --- a/src/testRunner/unittests/services/languageService.ts +++ b/src/testRunner/unittests/services/languageService.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: languageService", () => { + describe("unittests:: services:: languageService", () => { const files: {[index: string]: string} = { "foo.ts": `import Vue from "./vue"; import Component from "./vue-class-component"; diff --git a/src/testRunner/unittests/services/organizeImports.ts b/src/testRunner/unittests/services/organizeImports.ts index a45c7548394..1421780a4b4 100644 --- a/src/testRunner/unittests/services/organizeImports.ts +++ b/src/testRunner/unittests/services/organizeImports.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: Organize imports", () => { + describe("unittests:: services:: Organize imports", () => { describe("Sort imports", () => { it("Sort - non-relative vs non-relative", () => { assertSortsBefore( diff --git a/src/testRunner/unittests/services/patternMatcher.ts b/src/testRunner/unittests/services/patternMatcher.ts index 304a9225e0d..9f3cbf4b6d7 100644 --- a/src/testRunner/unittests/services/patternMatcher.ts +++ b/src/testRunner/unittests/services/patternMatcher.ts @@ -1,4 +1,4 @@ -describe("services:: PatternMatcher", () => { +describe("unittests:: services:: PatternMatcher", () => { describe("BreakIntoCharacterSpans", () => { it("EmptyIdentifier", () => { verifyBreakIntoCharacterSpans(""); diff --git a/src/testRunner/unittests/services/preProcessFile.ts b/src/testRunner/unittests/services/preProcessFile.ts index caf412d6403..3e9d16672db 100644 --- a/src/testRunner/unittests/services/preProcessFile.ts +++ b/src/testRunner/unittests/services/preProcessFile.ts @@ -1,4 +1,4 @@ -describe("services:: PreProcessFile:", () => { +describe("unittests:: services:: PreProcessFile:", () => { function test(sourceText: string, readImportFile: boolean, detectJavaScriptImports: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { const resultPreProcess = ts.preProcessFile(sourceText, readImportFile, detectJavaScriptImports); diff --git a/src/testRunner/unittests/services/textChanges.ts b/src/testRunner/unittests/services/textChanges.ts index fa5e723419a..de92efafbeb 100644 --- a/src/testRunner/unittests/services/textChanges.ts +++ b/src/testRunner/unittests/services/textChanges.ts @@ -2,7 +2,7 @@ // tslint:disable trim-trailing-whitespace namespace ts { - describe("services:: textChanges", () => { + describe("unittests:: services:: textChanges", () => { function findChild(name: string, n: Node) { return find(n)!; diff --git a/src/testRunner/unittests/services/transpile.ts b/src/testRunner/unittests/services/transpile.ts index 533f07884f4..d197d6db621 100644 --- a/src/testRunner/unittests/services/transpile.ts +++ b/src/testRunner/unittests/services/transpile.ts @@ -1,5 +1,5 @@ namespace ts { - describe("services:: Transpile", () => { + describe("unittests:: services:: Transpile", () => { interface TranspileTestSettings { options?: TranspileOptions; diff --git a/src/testRunner/unittests/transform.ts b/src/testRunner/unittests/transform.ts index f219fb6c683..98c29025d5f 100644 --- a/src/testRunner/unittests/transform.ts +++ b/src/testRunner/unittests/transform.ts @@ -1,5 +1,5 @@ namespace ts { - describe("TransformAPI", () => { + describe("unittests:: TransformAPI", () => { function replaceUndefinedWithVoid0(context: TransformationContext) { const previousOnSubstituteNode = context.onSubstituteNode; context.enableSubstitution(SyntaxKind.Identifier); diff --git a/src/testRunner/unittests/tsbuild.ts b/src/testRunner/unittests/tsbuild.ts index 72b1121e861..bf628e10598 100644 --- a/src/testRunner/unittests/tsbuild.ts +++ b/src/testRunner/unittests/tsbuild.ts @@ -8,7 +8,7 @@ namespace ts { "/src/core/index.js", "/src/core/index.d.ts", "/src/core/index.d.ts.map", "/src/logic/index.js", "/src/logic/index.js.map", "/src/logic/index.d.ts"]; - describe("tsbuild - sanity check of clean build of 'sample1' project", () => { + describe("unittests:: tsbuild - sanity check of clean build of 'sample1' project", () => { it("can build the sample project 'sample1' without error", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -61,7 +61,7 @@ namespace ts { }); }); - describe("tsbuild - dry builds", () => { + describe("unittests:: tsbuild - dry builds", () => { it("doesn't write any files in a dry build", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -90,7 +90,7 @@ namespace ts { }); }); - describe("tsbuild - clean builds", () => { + describe("unittests:: tsbuild - clean builds", () => { it("removes all files it built", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -111,7 +111,7 @@ namespace ts { }); }); - describe("tsbuild - force builds", () => { + describe("unittests:: tsbuild - force builds", () => { it("always builds under --force", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -137,7 +137,7 @@ namespace ts { }); }); - describe("tsbuild - can detect when and what to rebuild", () => { + describe("unittests:: tsbuild - can detect when and what to rebuild", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); const builder = createSolutionBuilder(host, ["/src/tests"], { dry: false, force: false, verbose: true }); @@ -200,7 +200,7 @@ namespace ts { }); }); - describe("tsbuild - downstream-blocked compilations", () => { + describe("unittests:: tsbuild - downstream-blocked compilations", () => { it("won't build downstream projects if upstream projects have errors", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -222,7 +222,7 @@ namespace ts { }); }); - describe("tsbuild - project invalidation", () => { + describe("unittests:: tsbuild - project invalidation", () => { it("invalidates projects correctly", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -270,7 +270,7 @@ export class cNew {}`); }); }); - describe("tsbuild - with resolveJsonModule option", () => { + describe("unittests:: tsbuild - with resolveJsonModule option", () => { const projFs = loadProjectFromDisk("tests/projects/resolveJsonModuleAndComposite"); const allExpectedOutputs = ["/src/tests/dist/src/index.js", "/src/tests/dist/src/index.d.ts", "/src/tests/dist/src/hello.json"]; @@ -320,7 +320,7 @@ export default hello.hello`); }); }); - describe("tsbuild - lists files", () => { + describe("unittests:: tsbuild - lists files", () => { it("listFiles", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -369,7 +369,7 @@ export default hello.hello`); }); }); - describe("tsbuild - with rootDir of project reference in parentDirectory", () => { + describe("unittests:: tsbuild - with rootDir of project reference in parentDirectory", () => { const projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent"); const allExpectedOutputs = [ "/src/dist/other/other.js", "/src/dist/other/other.d.ts", @@ -388,7 +388,7 @@ export default hello.hello`); }); }); - describe("tsbuild - when project reference is referenced transitively", () => { + describe("unittests:: tsbuild - when project reference is referenced transitively", () => { const projFs = loadProjectFromDisk("tests/projects/transitiveReferences"); const allExpectedOutputs = [ "/src/a.js", "/src/a.d.ts", @@ -460,7 +460,7 @@ export const b = new A();`); export namespace OutFile { const outFileFs = loadProjectFromDisk("tests/projects/outfile-concat"); - describe("tsbuild - baseline sectioned sourcemaps", () => { + describe("unittests:: tsbuild - baseline sectioned sourcemaps", () => { let fs: vfs.FileSystem | undefined; before(() => { fs = outFileFs.shadow(); @@ -480,7 +480,7 @@ export const b = new A();`); }); }); - describe("tsbuild - downstream prepend projects always get rebuilt", () => { + describe("unittests:: tsbuild - downstream prepend projects always get rebuilt", () => { it("", () => { const fs = outFileFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -508,7 +508,7 @@ export const b = new A();`); "/src/core/index.d.ts.map", ]; - describe("tsbuild - empty files option in tsconfig", () => { + describe("unittests:: tsbuild - empty files option in tsconfig", () => { it("has empty files diagnostic when files is empty and no references are provided", () => { const fs = projFs.shadow(); const host = new fakes.SolutionBuilderHost(fs); @@ -541,7 +541,7 @@ export const b = new A();`); }); } - describe("tsbuild - graph-ordering", () => { + describe("unittests:: tsbuild - graph-ordering", () => { let host: fakes.SolutionBuilderHost | undefined; const deps: [string, string][] = [ ["A", "B"], diff --git a/src/testRunner/unittests/tsbuildWatchMode.ts b/src/testRunner/unittests/tsbuildWatchMode.ts index 9f45da51656..72da8dbf85e 100644 --- a/src/testRunner/unittests/tsbuildWatchMode.ts +++ b/src/testRunner/unittests/tsbuildWatchMode.ts @@ -14,7 +14,7 @@ namespace ts.tscWatch { return solutionBuilder; } - describe("tsbuild-watch program updates", () => { + describe("unittests:: tsbuild-watch program updates", () => { const project = "sample1"; const enum SubProject { core = "core", diff --git a/src/testRunner/unittests/tscWatch/emit.ts b/src/testRunner/unittests/tscWatch/emit.ts index 2f7a70bd2c6..06aec75f31f 100644 --- a/src/testRunner/unittests/tscWatch/emit.ts +++ b/src/testRunner/unittests/tscWatch/emit.ts @@ -38,7 +38,7 @@ namespace ts.tscWatch { checkOutputDoesNotContain(host, expectedNonAffectedFiles); } - describe("tsc-watch:: emit with outFile or out setting", () => { + describe("unittests:: tsc-watch:: emit with outFile or out setting", () => { function createWatchForOut(out?: string, outFile?: string) { const host = createWatchedSystem([]); const config: FileOrFolderEmit = { @@ -161,7 +161,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch:: emit for configured projects", () => { + describe("unittests:: tsc-watch:: emit for configured projects", () => { const file1Consumer1Path = "/a/b/file1Consumer1.ts"; const moduleFile1Path = "/a/b/moduleFile1.ts"; const configFilePath = "/a/b/tsconfig.json"; @@ -495,7 +495,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch:: emit file content", () => { + describe("unittests:: tsc-watch:: emit file content", () => { interface EmittedFile extends File { shouldBeWritten: boolean; } @@ -676,7 +676,7 @@ namespace ts.tscWatch { }); }); - describe("tsc-watch:: emit with when module emit is specified as node", () => { + describe("unittests:: tsc-watch:: emit with when module emit is specified as node", () => { it("when instead of filechanged recursive directory watcher is invoked", () => { const configFile: File = { path: "/a/rootFolder/project/tsconfig.json", diff --git a/src/testRunner/unittests/tscWatch/resolutionCache.ts b/src/testRunner/unittests/tscWatch/resolutionCache.ts index e7b546edcd9..b29fde85697 100644 --- a/src/testRunner/unittests/tscWatch/resolutionCache.ts +++ b/src/testRunner/unittests/tscWatch/resolutionCache.ts @@ -1,5 +1,5 @@ namespace ts.tscWatch { - describe("tsc-watch:: resolutionCache:: tsc-watch module resolution caching", () => { + describe("unittests:: tsc-watch:: resolutionCache:: tsc-watch module resolution caching", () => { it("works", () => { const root = { path: "/a/d/f0.ts", @@ -404,7 +404,7 @@ declare module "fs" { }); }); - describe("tsc-watch:: resolutionCache:: tsc-watch with modules linked to sibling folder", () => { + describe("unittests:: tsc-watch:: resolutionCache:: tsc-watch with modules linked to sibling folder", () => { const projectRoot = "/user/username/projects/project"; const mainPackageRoot = `${projectRoot}/main`; const linkedPackageRoot = `${projectRoot}/linked-package`; diff --git a/src/testRunner/unittests/tscWatch/watchApi.ts b/src/testRunner/unittests/tscWatch/watchApi.ts index 334b353f1d5..35527b73701 100644 --- a/src/testRunner/unittests/tscWatch/watchApi.ts +++ b/src/testRunner/unittests/tscWatch/watchApi.ts @@ -1,5 +1,5 @@ namespace ts.tscWatch { - describe("tsc-watch:: watchAPI:: tsc-watch with custom module resolution", () => { + describe("unittests:: tsc-watch:: watchAPI:: tsc-watch with custom module resolution", () => { const projectRoot = "/user/username/projects/project"; const configFileJson: any = { compilerOptions: { module: "commonjs", resolveJsonModule: true }, diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index 3d09e2a38f6..d30e5854652 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -1,6 +1,6 @@ namespace ts.tscWatch { import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; - describe("tsc-watch:: watchEnvironment:: tsc-watch with different polling/non polling options", () => { + describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different polling/non polling options", () => { it("watchFile using dynamic priority polling", () => { const projectFolder = "/a/username/project"; const file1: File = { diff --git a/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts index b5132f57c0e..26b7857347a 100644 --- a/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts +++ b/src/testRunner/unittests/tsserver/cachingFileSystemInformation.ts @@ -3,7 +3,7 @@ namespace ts.projectSystem { return countWhere(recursiveWatchedDirs, dir => file.length > dir.length && startsWith(file, dir) && file[dir.length] === directorySeparator); } - describe("tsserver:: CachingFileSystemInformation:: tsserverProjectSystem CachingFileSystemInformation", () => { + describe("unittests:: tsserver:: CachingFileSystemInformation:: tsserverProjectSystem CachingFileSystemInformation", () => { enum CalledMapsWithSingleArg { fileExists = "fileExists", directoryExists = "directoryExists", diff --git a/src/testRunner/unittests/tsserver/cancellationToken.ts b/src/testRunner/unittests/tsserver/cancellationToken.ts index 5d9cd5527e6..71fb4bb4b22 100644 --- a/src/testRunner/unittests/tsserver/cancellationToken.ts +++ b/src/testRunner/unittests/tsserver/cancellationToken.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: cancellationToken", () => { + describe("unittests:: tsserver:: cancellationToken", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test let oldPrepare: AnyFunction; before(() => { diff --git a/src/testRunner/unittests/tsserver/compileOnSave.ts b/src/testRunner/unittests/tsserver/compileOnSave.ts index 310a6e9e33c..667144f6a06 100644 --- a/src/testRunner/unittests/tsserver/compileOnSave.ts +++ b/src/testRunner/unittests/tsserver/compileOnSave.ts @@ -6,7 +6,7 @@ namespace ts.projectSystem { return new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); } - describe("tsserver:: compileOnSave:: affected list", () => { + describe("unittests:: tsserver:: compileOnSave:: affected list", () => { function sendAffectedFileRequestAndCheckResult(session: server.Session, request: server.protocol.Request, expectedFileList: { projectFileName: string, files: File[] }[]) { const response = session.executeCommand(request).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[]; const actualResult = response.sort((list1, list2) => compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); @@ -552,7 +552,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: compileOnSave:: EmitFile test", () => { + describe("unittests:: tsserver:: compileOnSave:: EmitFile test", () => { it("should respect line endings", () => { test("\n"); test("\r\n"); diff --git a/src/testRunner/unittests/tsserver/completions.ts b/src/testRunner/unittests/tsserver/completions.ts index ed020bae0ba..0a62f74dc7d 100644 --- a/src/testRunner/unittests/tsserver/completions.ts +++ b/src/testRunner/unittests/tsserver/completions.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: completions", () => { + describe("unittests:: tsserver:: completions", () => { it("works", () => { const aTs: File = { path: "/a.ts", diff --git a/src/testRunner/unittests/tsserver/configFileSearch.ts b/src/testRunner/unittests/tsserver/configFileSearch.ts index 4d0b0c0efdd..c9e02b8bd06 100644 --- a/src/testRunner/unittests/tsserver/configFileSearch.ts +++ b/src/testRunner/unittests/tsserver/configFileSearch.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: searching for config file", () => { + describe("unittests:: tsserver:: searching for config file", () => { it("should stop at projectRootPath if given", () => { const f1 = { path: "/a/file1.ts", diff --git a/src/testRunner/unittests/tsserver/declarationFileMaps.ts b/src/testRunner/unittests/tsserver/declarationFileMaps.ts index 334af82ca48..200d7af0240 100644 --- a/src/testRunner/unittests/tsserver/declarationFileMaps.ts +++ b/src/testRunner/unittests/tsserver/declarationFileMaps.ts @@ -40,7 +40,7 @@ namespace ts.projectSystem { assert.deepEqual(output.outputFiles, expectedFiles.map((e): OutputFile => ({ name: e.path, text: e.content, writeByteOrderMark: false }))); } - describe("tsserver:: with declaration file maps:: project references", () => { + describe("unittests:: tsserver:: with declaration file maps:: project references", () => { const aTs: File = { path: "/a/a.ts", content: "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};", diff --git a/src/testRunner/unittests/tsserver/documentRegistry.ts b/src/testRunner/unittests/tsserver/documentRegistry.ts index 0fd812a89d2..1761e413833 100644 --- a/src/testRunner/unittests/tsserver/documentRegistry.ts +++ b/src/testRunner/unittests/tsserver/documentRegistry.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: document registry in project service", () => { + describe("unittests:: tsserver:: document registry in project service", () => { const projectRootPath = "/user/username/projects/project"; const importModuleContent = `import {a} from "./module1"`; const file: File = { diff --git a/src/testRunner/unittests/tsserver/duplicatePackages.ts b/src/testRunner/unittests/tsserver/duplicatePackages.ts index f8a282ee7d2..ec85eb6a82f 100644 --- a/src/testRunner/unittests/tsserver/duplicatePackages.ts +++ b/src/testRunner/unittests/tsserver/duplicatePackages.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: duplicate packages", () => { + describe("unittests:: tsserver:: duplicate packages", () => { // Tests that 'moduleSpecifiers.ts' will import from the redirecting file, and not from the file it redirects to, if that can provide a global module specifier. it("works with import fixes", () => { const packageContent = "export const foo: number;"; diff --git a/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts index ca7f839e1b0..ff69a7e6568 100644 --- a/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts +++ b/src/testRunner/unittests/tsserver/events/largeFileReferenced.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: LargeFileReferencedEvent with large file", () => { + describe("unittests:: tsserver:: events:: LargeFileReferencedEvent with large file", () => { const projectRoot = "/user/username/projects/project"; function getLargeFile(useLargeTsFile: boolean) { diff --git a/src/testRunner/unittests/tsserver/events/projectLoading.ts b/src/testRunner/unittests/tsserver/events/projectLoading.ts index 2de3ab40db6..7a881ff1380 100644 --- a/src/testRunner/unittests/tsserver/events/projectLoading.ts +++ b/src/testRunner/unittests/tsserver/events/projectLoading.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: events:: ProjectLoadingStart and ProjectLoadingFinish events", () => { + describe("unittests:: tsserver:: events:: ProjectLoadingStart and ProjectLoadingFinish events", () => { const projectRoot = "/user/username/projects"; const aTs: File = { path: `${projectRoot}/a/a.ts`, diff --git a/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts index c818f4d2a8d..05a43cb4a15 100644 --- a/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts +++ b/src/testRunner/unittests/tsserver/events/projectUpdatedInBackground.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: ProjectsUpdatedInBackground", () => { + describe("unittests:: tsserver:: events:: ProjectsUpdatedInBackground", () => { function verifyFiles(caption: string, actual: ReadonlyArray, expected: ReadonlyArray) { assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`); const seen = createMap(); diff --git a/src/testRunner/unittests/tsserver/externalProjects.ts b/src/testRunner/unittests/tsserver/externalProjects.ts index 6c246a2e3bd..87615b24d12 100644 --- a/src/testRunner/unittests/tsserver/externalProjects.ts +++ b/src/testRunner/unittests/tsserver/externalProjects.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: ExternalProjects", () => { + describe("unittests:: tsserver:: ExternalProjects", () => { describe("correctly handling add/remove tsconfig - 1", () => { function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { const f1 = { diff --git a/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts b/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts index d790a1aa25a..bb1be544a2c 100644 --- a/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts +++ b/src/testRunner/unittests/tsserver/forceConsistentCasingInFileNames.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: forceConsistentCasingInFileNames", () => { + describe("unittests:: tsserver:: forceConsistentCasingInFileNames", () => { it("works when extends is specified with a case insensitive file system", () => { const rootPath = "/Users/username/dev/project"; const file1: File = { diff --git a/src/testRunner/unittests/tsserver/formatSettings.ts b/src/testRunner/unittests/tsserver/formatSettings.ts index 4e3e2ebd418..2d09ed8a8a0 100644 --- a/src/testRunner/unittests/tsserver/formatSettings.ts +++ b/src/testRunner/unittests/tsserver/formatSettings.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: format settings", () => { + describe("unittests:: tsserver:: format settings", () => { it("can be set globally", () => { const f1 = { path: "/a/b/app.ts", diff --git a/src/testRunner/unittests/tsserver/getEditsForFileRename.ts b/src/testRunner/unittests/tsserver/getEditsForFileRename.ts index 3fadf99c3f8..2b28de7b121 100644 --- a/src/testRunner/unittests/tsserver/getEditsForFileRename.ts +++ b/src/testRunner/unittests/tsserver/getEditsForFileRename.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: getEditsForFileRename", () => { + describe("unittests:: tsserver:: getEditsForFileRename", () => { it("works for host implementing 'resolveModuleNames' and 'getResolvedModuleWithFailedLookupLocationsFromCache'", () => { const userTs: File = { path: "/user.ts", diff --git a/src/testRunner/unittests/tsserver/importHelpers.ts b/src/testRunner/unittests/tsserver/importHelpers.ts index 42e38aed122..b1ec5955eaa 100644 --- a/src/testRunner/unittests/tsserver/importHelpers.ts +++ b/src/testRunner/unittests/tsserver/importHelpers.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: import helpers", () => { + describe("unittests:: tsserver:: import helpers", () => { it("should not crash in tsserver", () => { const f1 = { path: "/a/app.ts", diff --git a/src/testRunner/unittests/tsserver/inferredProjects.ts b/src/testRunner/unittests/tsserver/inferredProjects.ts index b22413c6ab3..47e871efb82 100644 --- a/src/testRunner/unittests/tsserver/inferredProjects.ts +++ b/src/testRunner/unittests/tsserver/inferredProjects.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: Inferred projects", () => { + describe("unittests:: tsserver:: Inferred projects", () => { it("should support files without extensions", () => { const f = { path: "/a/compile", diff --git a/src/testRunner/unittests/tsserver/languageService.ts b/src/testRunner/unittests/tsserver/languageService.ts index 6ee68e74c15..86d426664df 100644 --- a/src/testRunner/unittests/tsserver/languageService.ts +++ b/src/testRunner/unittests/tsserver/languageService.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: Language service", () => { + describe("unittests:: tsserver:: Language service", () => { it("should work correctly on case-sensitive file systems", () => { const lib = { path: "/a/Lib/lib.d.ts", diff --git a/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts b/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts index dd0b954824d..eb254789d67 100644 --- a/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts +++ b/src/testRunner/unittests/tsserver/maxNodeModuleJsDepth.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: maxNodeModuleJsDepth for inferred projects", () => { + describe("unittests:: tsserver:: maxNodeModuleJsDepth for inferred projects", () => { it("should be set to 2 if the project has js root files", () => { const file1: File = { path: "/a/b/file1.js", diff --git a/src/testRunner/unittests/tsserver/metadataInResponse.ts b/src/testRunner/unittests/tsserver/metadataInResponse.ts index 783fce4dd16..6ec8a565d87 100644 --- a/src/testRunner/unittests/tsserver/metadataInResponse.ts +++ b/src/testRunner/unittests/tsserver/metadataInResponse.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: with metadata in response", () => { + describe("unittests:: tsserver:: with metadata in response", () => { const metadata = "Extra Info"; function verifyOutput(host: TestServerHost, expectedResponse: protocol.Response) { const output = host.getOutput().map(mapOutputToJson); diff --git a/src/testRunner/unittests/tsserver/navTo.ts b/src/testRunner/unittests/tsserver/navTo.ts index 5d45e537ede..b3aebef1043 100644 --- a/src/testRunner/unittests/tsserver/navTo.ts +++ b/src/testRunner/unittests/tsserver/navTo.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: navigate-to for javascript project", () => { + describe("unittests:: tsserver:: navigate-to for javascript project", () => { function containsNavToItem(items: protocol.NavtoItem[], itemName: string, itemKind: string) { return find(items, item => item.name === itemName && item.kind === itemKind) !== undefined; } diff --git a/src/testRunner/unittests/tsserver/occurences.ts b/src/testRunner/unittests/tsserver/occurences.ts index bcdadd3872c..cf9c83e2e72 100644 --- a/src/testRunner/unittests/tsserver/occurences.ts +++ b/src/testRunner/unittests/tsserver/occurences.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: occurence highlight on string", () => { + describe("unittests:: tsserver:: occurence highlight on string", () => { it("should be marked if only on string values", () => { const file1: File = { path: "/a/b/file1.ts", diff --git a/src/testRunner/unittests/tsserver/openFile.ts b/src/testRunner/unittests/tsserver/openFile.ts index 187b5043fcc..d2a995c68f8 100644 --- a/src/testRunner/unittests/tsserver/openFile.ts +++ b/src/testRunner/unittests/tsserver/openFile.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: Open-file", () => { + describe("unittests:: tsserver:: Open-file", () => { it("can be reloaded with empty content", () => { const f = { path: "/a/b/app.ts", diff --git a/src/testRunner/unittests/tsserver/projectErrors.ts b/src/testRunner/unittests/tsserver/projectErrors.ts index cb82a9eeca6..9e24771f3ae 100644 --- a/src/testRunner/unittests/tsserver/projectErrors.ts +++ b/src/testRunner/unittests/tsserver/projectErrors.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: Project Errors", () => { + describe("unittests:: tsserver:: Project Errors", () => { function checkProjectErrors(projectFiles: server.ProjectFilesWithTSDiagnostics, expectedErrors: ReadonlyArray): void { assert.isTrue(projectFiles !== undefined, "missing project files"); checkProjectErrorsWorker(projectFiles.projectErrors, expectedErrors); @@ -200,7 +200,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors are reported as appropriate", () => { + describe("unittests:: tsserver:: Project Errors are reported as appropriate", () => { function createErrorLogger() { let hasError = false; const errorLogger: server.Logger = { @@ -481,7 +481,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors for Configure file diagnostics events", () => { + describe("unittests:: tsserver:: Project Errors for Configure file diagnostics events", () => { function getUnknownCompilerOptionDiagnostic(configFile: File, prop: string): ConfigFileDiagnostic { const d = Diagnostics.Unknown_compiler_option_0; const start = configFile.content.indexOf(prop) - 1; // start at "prop" @@ -671,7 +671,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors dont include overwrite emit error", () => { + describe("unittests:: tsserver:: Project Errors dont include overwrite emit error", () => { it("for inferred project", () => { const f1 = { path: "/a/b/f1.js", @@ -754,7 +754,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors reports Options Diagnostic locations correctly with changes in configFile contents", () => { + describe("unittests:: tsserver:: Project Errors reports Options Diagnostic locations correctly with changes in configFile contents", () => { it("when options change", () => { const file = { path: "/a/b/app.ts", @@ -818,7 +818,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: Project Errors with config file change", () => { + describe("unittests:: tsserver:: Project Errors with config file change", () => { it("Updates diagnostics when '--noUnusedLabels' changes", () => { const aTs: File = { path: "/a.ts", content: "label: while (1) {}" }; const options = (allowUnusedLabels: boolean) => `{ "compilerOptions": { "allowUnusedLabels": ${allowUnusedLabels} } }`; diff --git a/src/testRunner/unittests/tsserver/projectReferences.ts b/src/testRunner/unittests/tsserver/projectReferences.ts index c7a42d6b813..e39c510216d 100644 --- a/src/testRunner/unittests/tsserver/projectReferences.ts +++ b/src/testRunner/unittests/tsserver/projectReferences.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: with project references and tsbuild", () => { + describe("unittests:: tsserver:: with project references and tsbuild", () => { function createHost(files: ReadonlyArray, rootNames: ReadonlyArray) { const host = createServerHost(files); diff --git a/src/testRunner/unittests/tsserver/refactors.ts b/src/testRunner/unittests/tsserver/refactors.ts index 2e916f50f9b..2f4531f61a5 100644 --- a/src/testRunner/unittests/tsserver/refactors.ts +++ b/src/testRunner/unittests/tsserver/refactors.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: refactors", () => { + describe("unittests:: tsserver:: refactors", () => { it("use formatting options", () => { const file = { path: "/a.ts", diff --git a/src/testRunner/unittests/tsserver/reload.ts b/src/testRunner/unittests/tsserver/reload.ts index 80f3e56e437..e9a32a5e1a1 100644 --- a/src/testRunner/unittests/tsserver/reload.ts +++ b/src/testRunner/unittests/tsserver/reload.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: reload", () => { + describe("unittests:: tsserver:: reload", () => { it("should work with temp file", () => { const f1 = { path: "/a/b/app.ts", diff --git a/src/testRunner/unittests/tsserver/rename.ts b/src/testRunner/unittests/tsserver/rename.ts index 3b4d77263e6..75c08bb8bb0 100644 --- a/src/testRunner/unittests/tsserver/rename.ts +++ b/src/testRunner/unittests/tsserver/rename.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: rename", () => { + describe("unittests:: tsserver:: rename", () => { it("works with fileToRename", () => { const aTs: File = { path: "/a.ts", content: "export const a = 0;" }; const bTs: File = { path: "/b.ts", content: 'import { a } from "./a";' }; diff --git a/src/testRunner/unittests/tsserver/resolutionCache.ts b/src/testRunner/unittests/tsserver/resolutionCache.ts index 9f75455e226..33b59e2faae 100644 --- a/src/testRunner/unittests/tsserver/resolutionCache.ts +++ b/src/testRunner/unittests/tsserver/resolutionCache.ts @@ -5,7 +5,7 @@ namespace ts.projectSystem { return resolutionTrace; } - describe("tsserver:: resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem extra resolution pass in lshost", () => { it("can load typings that are proper modules", () => { const file1 = { path: "/a/b/app.js", @@ -46,7 +46,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: resolutionCache:: tsserverProjectSystem watching @types", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem watching @types", () => { it("works correctly when typings are added or removed", () => { const f1 = { path: "/a/b/app.ts", @@ -92,7 +92,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem add the missing module file for inferred project", () => { it("should remove the `module not found` error", () => { const moduleFile = { path: "/a/b/moduleFile.ts", @@ -358,7 +358,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem rename a module file and rename back", () => { it("should restore the states for inferred projects", () => { const moduleFile = { path: "/a/b/moduleFile.ts", @@ -493,7 +493,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: resolutionCache:: tsserverProjectSystem module resolution caching", () => { + describe("unittests:: tsserver:: resolutionCache:: tsserverProjectSystem module resolution caching", () => { const projectLocation = "/user/username/projects/myproject"; const configFile: File = { path: `${projectLocation}/tsconfig.json`, diff --git a/src/testRunner/unittests/tsserver/session.ts b/src/testRunner/unittests/tsserver/session.ts index 927b22fb475..bf21228405c 100644 --- a/src/testRunner/unittests/tsserver/session.ts +++ b/src/testRunner/unittests/tsserver/session.ts @@ -35,7 +35,7 @@ namespace ts.server { } } - describe("tsserver:: Session:: General functionality", () => { + describe("unittests:: tsserver:: Session:: General functionality", () => { let session: TestSession; let lastSent: protocol.Message; @@ -418,7 +418,7 @@ namespace ts.server { }); }); - describe("tsserver:: Session:: exceptions", () => { + describe("unittests:: tsserver:: Session:: exceptions", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test let oldPrepare: AnyFunction; @@ -489,7 +489,7 @@ namespace ts.server { }); }); - describe("tsserver:: Session:: how Session is extendable via subclassing", () => { + describe("unittests:: tsserver:: Session:: how Session is extendable via subclassing", () => { class TestSession extends Session { lastSent: protocol.Message | undefined; customHandler = "testhandler"; @@ -558,7 +558,7 @@ namespace ts.server { }); }); - describe("tsserver:: Session:: an example of using the Session API to create an in-process server", () => { + describe("unittests:: tsserver:: Session:: an example of using the Session API to create an in-process server", () => { class InProcSession extends Session { private queue: protocol.Request[] = []; constructor(private client: InProcClient) { @@ -710,7 +710,7 @@ namespace ts.server { }); }); - describe("tsserver:: Session:: helpers", () => { + describe("unittests:: tsserver:: Session:: helpers", () => { it(getLocationInNewDocument.name, () => { const text = `// blank line\nconst x = 0;`; const renameLocationInOldText = text.indexOf("0"); diff --git a/src/testRunner/unittests/tsserver/skipLibCheck.ts b/src/testRunner/unittests/tsserver/skipLibCheck.ts index 463ea439396..d154154f083 100644 --- a/src/testRunner/unittests/tsserver/skipLibCheck.ts +++ b/src/testRunner/unittests/tsserver/skipLibCheck.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: with skipLibCheck", () => { + describe("unittests:: tsserver:: with skipLibCheck", () => { it("should be turned on for js-only inferred projects", () => { const file1 = { path: "/a/b/file1.js", diff --git a/src/testRunner/unittests/tsserver/symLinks.ts b/src/testRunner/unittests/tsserver/symLinks.ts index d6fa9dca894..e331c94ca1a 100644 --- a/src/testRunner/unittests/tsserver/symLinks.ts +++ b/src/testRunner/unittests/tsserver/symLinks.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: symLinks", () => { + describe("unittests:: tsserver:: symLinks", () => { it("rename in common file renames all project", () => { const projects = "/users/username/projects"; const folderA = `${projects}/a`; diff --git a/src/testRunner/unittests/tsserver/syntaxOperations.ts b/src/testRunner/unittests/tsserver/syntaxOperations.ts index c2ec877137a..66a962d3625 100644 --- a/src/testRunner/unittests/tsserver/syntaxOperations.ts +++ b/src/testRunner/unittests/tsserver/syntaxOperations.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: syntax operations", () => { + describe("unittests:: tsserver:: syntax operations", () => { function navBarFull(session: TestSession, file: File) { return JSON.stringify(session.executeCommandSeq({ command: protocol.CommandTypes.NavBarFull, diff --git a/src/testRunner/unittests/tsserver/telemetry.ts b/src/testRunner/unittests/tsserver/telemetry.ts index 4f4d8ba8b19..cdf78adbf54 100644 --- a/src/testRunner/unittests/tsserver/telemetry.ts +++ b/src/testRunner/unittests/tsserver/telemetry.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: project telemetry", () => { + describe("unittests:: tsserver:: project telemetry", () => { it("does nothing for inferred project", () => { const file = makeFile("/a.js"); const et = new TestServerEventManager([file]); diff --git a/src/testRunner/unittests/tsserver/textStorage.ts b/src/testRunner/unittests/tsserver/textStorage.ts index 157734da931..40424b5c9c3 100644 --- a/src/testRunner/unittests/tsserver/textStorage.ts +++ b/src/testRunner/unittests/tsserver/textStorage.ts @@ -1,5 +1,5 @@ namespace ts.textStorage { - describe("tsserver:: Text storage", () => { + describe("unittests:: tsserver:: Text storage", () => { const f = { path: "/a/app.ts", content: ` diff --git a/src/testRunner/unittests/tsserver/typeAquisition.ts b/src/testRunner/unittests/tsserver/typeAquisition.ts index 9f487896e03..ac9d3e3cfc0 100644 --- a/src/testRunner/unittests/tsserver/typeAquisition.ts +++ b/src/testRunner/unittests/tsserver/typeAquisition.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: autoDiscovery", () => { + describe("unittests:: tsserver:: autoDiscovery", () => { it("does not depend on extension", () => { const file1 = { path: "/a/b/app.html", @@ -22,7 +22,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: prefer typings to js", () => { + describe("unittests:: tsserver:: prefer typings to js", () => { it("during second resolution pass", () => { const typingsCacheLocation = "/a/typings"; const f1 = { diff --git a/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts b/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts index 8318f402a1a..e3ad121e427 100644 --- a/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts +++ b/src/testRunner/unittests/tsserver/typeReferenceDirectives.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: typeReferenceDirectives", () => { + describe("unittests:: tsserver:: typeReferenceDirectives", () => { it("when typeReferenceDirective contains UpperCasePackage", () => { const projectLocation = "/user/username/projects/myproject"; const libProjectLocation = `${projectLocation}/lib`; diff --git a/src/testRunner/unittests/tsserver/typingsInstaller.ts b/src/testRunner/unittests/tsserver/typingsInstaller.ts index 18117a5f961..76df9934682 100644 --- a/src/testRunner/unittests/tsserver/typingsInstaller.ts +++ b/src/testRunner/unittests/tsserver/typingsInstaller.ts @@ -47,7 +47,7 @@ namespace ts.projectSystem { import typingsName = TI.typingsName; - describe("tsserver:: typingsInstaller:: local module", () => { + describe("unittests:: tsserver:: typingsInstaller:: local module", () => { it("should not be picked up", () => { const f1 = { path: "/a/app.js", @@ -86,7 +86,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: General functionality", () => { + describe("unittests:: tsserver:: typingsInstaller:: General functionality", () => { it("configured projects (typings installed) 1", () => { const file1 = { path: "/a/b/app.js", @@ -1249,7 +1249,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: Validate package name:", () => { + describe("unittests:: tsserver:: typingsInstaller:: Validate package name:", () => { it("name cannot be too long", () => { let packageName = "a"; for (let i = 0; i < 8; i++) { @@ -1273,7 +1273,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: Invalid package names", () => { + describe("unittests:: tsserver:: typingsInstaller:: Invalid package names", () => { it("should not be installed", () => { const f1 = { path: "/a/b/app.js", @@ -1305,7 +1305,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: discover typings", () => { + describe("unittests:: tsserver:: typingsInstaller:: discover typings", () => { const emptySafeList = emptyMap; it("should use mappings from safe list", () => { @@ -1517,7 +1517,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: telemetry events", () => { + describe("unittests:: tsserver:: typingsInstaller:: telemetry events", () => { it("should be received", () => { const f1 = { path: "/a/app.js", @@ -1567,7 +1567,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: progress notifications", () => { + describe("unittests:: tsserver:: typingsInstaller:: progress notifications", () => { it("should be sent for success", () => { const f1 = { path: "/a/app.js", @@ -1676,7 +1676,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: npm installation command", () => { + describe("unittests:: tsserver:: typingsInstaller:: npm installation command", () => { const npmPath = "npm", tsVersion = "2.9.0-dev.20180410"; const packageNames = ["@types/graphql@ts2.8", "@types/highlight.js@ts2.8", "@types/jest@ts2.8", "@types/mini-css-extract-plugin@ts2.8", "@types/mongoose@ts2.8", "@types/pg@ts2.8", "@types/webpack-bundle-analyzer@ts2.8", "@types/enhanced-resolve@ts2.8", "@types/eslint-plugin-prettier@ts2.8", "@types/friendly-errors-webpack-plugin@ts2.8", "@types/hammerjs@ts2.8", "@types/history@ts2.8", "@types/image-size@ts2.8", "@types/js-cookie@ts2.8", "@types/koa-compress@ts2.8", "@types/less@ts2.8", "@types/material-ui@ts2.8", "@types/mysql@ts2.8", "@types/nodemailer@ts2.8", "@types/prettier@ts2.8", "@types/query-string@ts2.8", "@types/react-places-autocomplete@ts2.8", "@types/react-router@ts2.8", "@types/react-router-config@ts2.8", "@types/react-select@ts2.8", "@types/react-transition-group@ts2.8", "@types/redux-form@ts2.8", "@types/abbrev@ts2.8", "@types/accepts@ts2.8", "@types/acorn@ts2.8", "@types/ansi-regex@ts2.8", "@types/ansi-styles@ts2.8", "@types/anymatch@ts2.8", "@types/apollo-codegen@ts2.8", "@types/are-we-there-yet@ts2.8", "@types/argparse@ts2.8", "@types/arr-union@ts2.8", "@types/array-find-index@ts2.8", "@types/array-uniq@ts2.8", "@types/array-unique@ts2.8", "@types/arrify@ts2.8", "@types/assert-plus@ts2.8", "@types/async@ts2.8", "@types/autoprefixer@ts2.8", "@types/aws4@ts2.8", "@types/babel-code-frame@ts2.8", "@types/babel-generator@ts2.8", "@types/babel-plugin-syntax-jsx@ts2.8", "@types/babel-template@ts2.8", "@types/babel-traverse@ts2.8", "@types/babel-types@ts2.8", "@types/babylon@ts2.8", "@types/base64-js@ts2.8", "@types/basic-auth@ts2.8", "@types/big.js@ts2.8", "@types/bl@ts2.8", "@types/bluebird@ts2.8", "@types/body-parser@ts2.8", "@types/bonjour@ts2.8", "@types/boom@ts2.8", "@types/brace-expansion@ts2.8", "@types/braces@ts2.8", "@types/brorand@ts2.8", "@types/browser-resolve@ts2.8", "@types/bson@ts2.8", "@types/buffer-equal@ts2.8", "@types/builtin-modules@ts2.8", "@types/bytes@ts2.8", "@types/callsites@ts2.8", "@types/camelcase@ts2.8", "@types/camelcase-keys@ts2.8", "@types/caseless@ts2.8", "@types/change-emitter@ts2.8", "@types/check-types@ts2.8", "@types/cheerio@ts2.8", "@types/chokidar@ts2.8", "@types/chownr@ts2.8", "@types/circular-json@ts2.8", "@types/classnames@ts2.8", "@types/clean-css@ts2.8", "@types/clone@ts2.8", "@types/co-body@ts2.8", "@types/color@ts2.8", "@types/color-convert@ts2.8", "@types/color-name@ts2.8", "@types/color-string@ts2.8", "@types/colors@ts2.8", "@types/combined-stream@ts2.8", "@types/common-tags@ts2.8", "@types/component-emitter@ts2.8", "@types/compressible@ts2.8", "@types/compression@ts2.8", "@types/concat-stream@ts2.8", "@types/connect-history-api-fallback@ts2.8", "@types/content-disposition@ts2.8", "@types/content-type@ts2.8", "@types/convert-source-map@ts2.8", "@types/cookie@ts2.8", "@types/cookie-signature@ts2.8", "@types/cookies@ts2.8", "@types/core-js@ts2.8", "@types/cosmiconfig@ts2.8", "@types/create-react-class@ts2.8", "@types/cross-spawn@ts2.8", "@types/cryptiles@ts2.8", "@types/css-modules-require-hook@ts2.8", "@types/dargs@ts2.8", "@types/dateformat@ts2.8", "@types/debug@ts2.8", "@types/decamelize@ts2.8", "@types/decompress@ts2.8", "@types/decompress-response@ts2.8", "@types/deep-equal@ts2.8", "@types/deep-extend@ts2.8", "@types/deepmerge@ts2.8", "@types/defined@ts2.8", "@types/del@ts2.8", "@types/depd@ts2.8", "@types/destroy@ts2.8", "@types/detect-indent@ts2.8", "@types/detect-newline@ts2.8", "@types/diff@ts2.8", "@types/doctrine@ts2.8", "@types/download@ts2.8", "@types/draft-js@ts2.8", "@types/duplexer2@ts2.8", "@types/duplexer3@ts2.8", "@types/duplexify@ts2.8", "@types/ejs@ts2.8", "@types/end-of-stream@ts2.8", "@types/entities@ts2.8", "@types/escape-html@ts2.8", "@types/escape-string-regexp@ts2.8", "@types/escodegen@ts2.8", "@types/eslint-scope@ts2.8", "@types/eslint-visitor-keys@ts2.8", "@types/esprima@ts2.8", "@types/estraverse@ts2.8", "@types/etag@ts2.8", "@types/events@ts2.8", "@types/execa@ts2.8", "@types/exenv@ts2.8", "@types/exit@ts2.8", "@types/exit-hook@ts2.8", "@types/expect@ts2.8", "@types/express@ts2.8", "@types/express-graphql@ts2.8", "@types/extend@ts2.8", "@types/extract-zip@ts2.8", "@types/fancy-log@ts2.8", "@types/fast-diff@ts2.8", "@types/fast-levenshtein@ts2.8", "@types/figures@ts2.8", "@types/file-type@ts2.8", "@types/filenamify@ts2.8", "@types/filesize@ts2.8", "@types/finalhandler@ts2.8", "@types/find-root@ts2.8", "@types/find-up@ts2.8", "@types/findup-sync@ts2.8", "@types/forever-agent@ts2.8", "@types/form-data@ts2.8", "@types/forwarded@ts2.8", "@types/fresh@ts2.8", "@types/from2@ts2.8", "@types/fs-extra@ts2.8", "@types/get-caller-file@ts2.8", "@types/get-stdin@ts2.8", "@types/get-stream@ts2.8", "@types/get-value@ts2.8", "@types/glob-base@ts2.8", "@types/glob-parent@ts2.8", "@types/glob-stream@ts2.8", "@types/globby@ts2.8", "@types/globule@ts2.8", "@types/got@ts2.8", "@types/graceful-fs@ts2.8", "@types/gulp-rename@ts2.8", "@types/gulp-sourcemaps@ts2.8", "@types/gulp-util@ts2.8", "@types/gzip-size@ts2.8", "@types/handlebars@ts2.8", "@types/has-ansi@ts2.8", "@types/hasha@ts2.8", "@types/he@ts2.8", "@types/hoek@ts2.8", "@types/html-entities@ts2.8", "@types/html-minifier@ts2.8", "@types/htmlparser2@ts2.8", "@types/http-assert@ts2.8", "@types/http-errors@ts2.8", "@types/http-proxy@ts2.8", "@types/http-proxy-middleware@ts2.8", "@types/indent-string@ts2.8", "@types/inflected@ts2.8", "@types/inherits@ts2.8", "@types/ini@ts2.8", "@types/inline-style-prefixer@ts2.8", "@types/inquirer@ts2.8", "@types/internal-ip@ts2.8", "@types/into-stream@ts2.8", "@types/invariant@ts2.8", "@types/ip@ts2.8", "@types/ip-regex@ts2.8", "@types/is-absolute-url@ts2.8", "@types/is-binary-path@ts2.8", "@types/is-finite@ts2.8", "@types/is-glob@ts2.8", "@types/is-my-json-valid@ts2.8", "@types/is-number@ts2.8", "@types/is-object@ts2.8", "@types/is-path-cwd@ts2.8", "@types/is-path-in-cwd@ts2.8", "@types/is-promise@ts2.8", "@types/is-scoped@ts2.8", "@types/is-stream@ts2.8", "@types/is-svg@ts2.8", "@types/is-url@ts2.8", "@types/is-windows@ts2.8", "@types/istanbul-lib-coverage@ts2.8", "@types/istanbul-lib-hook@ts2.8", "@types/istanbul-lib-instrument@ts2.8", "@types/istanbul-lib-report@ts2.8", "@types/istanbul-lib-source-maps@ts2.8", "@types/istanbul-reports@ts2.8", "@types/jest-diff@ts2.8", "@types/jest-docblock@ts2.8", "@types/jest-get-type@ts2.8", "@types/jest-matcher-utils@ts2.8", "@types/jest-validate@ts2.8", "@types/jpeg-js@ts2.8", "@types/js-base64@ts2.8", "@types/js-string-escape@ts2.8", "@types/js-yaml@ts2.8", "@types/jsbn@ts2.8", "@types/jsdom@ts2.8", "@types/jsesc@ts2.8", "@types/json-parse-better-errors@ts2.8", "@types/json-schema@ts2.8", "@types/json-stable-stringify@ts2.8", "@types/json-stringify-safe@ts2.8", "@types/json5@ts2.8", "@types/jsonfile@ts2.8", "@types/jsontoxml@ts2.8", "@types/jss@ts2.8", "@types/keygrip@ts2.8", "@types/keymirror@ts2.8", "@types/keyv@ts2.8", "@types/klaw@ts2.8", "@types/koa-send@ts2.8", "@types/leven@ts2.8", "@types/listr@ts2.8", "@types/load-json-file@ts2.8", "@types/loader-runner@ts2.8", "@types/loader-utils@ts2.8", "@types/locate-path@ts2.8", "@types/lodash-es@ts2.8", "@types/lodash.assign@ts2.8", "@types/lodash.camelcase@ts2.8", "@types/lodash.clonedeep@ts2.8", "@types/lodash.debounce@ts2.8", "@types/lodash.escape@ts2.8", "@types/lodash.flowright@ts2.8", "@types/lodash.get@ts2.8", "@types/lodash.isarguments@ts2.8", "@types/lodash.isarray@ts2.8", "@types/lodash.isequal@ts2.8", "@types/lodash.isobject@ts2.8", "@types/lodash.isstring@ts2.8", "@types/lodash.keys@ts2.8", "@types/lodash.memoize@ts2.8", "@types/lodash.merge@ts2.8", "@types/lodash.mergewith@ts2.8", "@types/lodash.pick@ts2.8", "@types/lodash.sortby@ts2.8", "@types/lodash.tail@ts2.8", "@types/lodash.template@ts2.8", "@types/lodash.throttle@ts2.8", "@types/lodash.unescape@ts2.8", "@types/lodash.uniq@ts2.8", "@types/log-symbols@ts2.8", "@types/log-update@ts2.8", "@types/loglevel@ts2.8", "@types/loud-rejection@ts2.8", "@types/lru-cache@ts2.8", "@types/make-dir@ts2.8", "@types/map-obj@ts2.8", "@types/media-typer@ts2.8", "@types/mem@ts2.8", "@types/mem-fs@ts2.8", "@types/memory-fs@ts2.8", "@types/meow@ts2.8", "@types/merge-descriptors@ts2.8", "@types/merge-stream@ts2.8", "@types/methods@ts2.8", "@types/micromatch@ts2.8", "@types/mime@ts2.8", "@types/mime-db@ts2.8", "@types/mime-types@ts2.8", "@types/minimatch@ts2.8", "@types/minimist@ts2.8", "@types/minipass@ts2.8", "@types/mkdirp@ts2.8", "@types/mongodb@ts2.8", "@types/morgan@ts2.8", "@types/move-concurrently@ts2.8", "@types/ms@ts2.8", "@types/msgpack-lite@ts2.8", "@types/multimatch@ts2.8", "@types/mz@ts2.8", "@types/negotiator@ts2.8", "@types/node-dir@ts2.8", "@types/node-fetch@ts2.8", "@types/node-forge@ts2.8", "@types/node-int64@ts2.8", "@types/node-ipc@ts2.8", "@types/node-notifier@ts2.8", "@types/nomnom@ts2.8", "@types/nopt@ts2.8", "@types/normalize-package-data@ts2.8", "@types/normalize-url@ts2.8", "@types/number-is-nan@ts2.8", "@types/object-assign@ts2.8", "@types/on-finished@ts2.8", "@types/on-headers@ts2.8", "@types/once@ts2.8", "@types/onetime@ts2.8", "@types/opener@ts2.8", "@types/opn@ts2.8", "@types/optimist@ts2.8", "@types/ora@ts2.8", "@types/os-homedir@ts2.8", "@types/os-locale@ts2.8", "@types/os-tmpdir@ts2.8", "@types/p-cancelable@ts2.8", "@types/p-each-series@ts2.8", "@types/p-event@ts2.8", "@types/p-lazy@ts2.8", "@types/p-limit@ts2.8", "@types/p-locate@ts2.8", "@types/p-map@ts2.8", "@types/p-map-series@ts2.8", "@types/p-reduce@ts2.8", "@types/p-timeout@ts2.8", "@types/p-try@ts2.8", "@types/pako@ts2.8", "@types/parse-glob@ts2.8", "@types/parse-json@ts2.8", "@types/parseurl@ts2.8", "@types/path-exists@ts2.8", "@types/path-is-absolute@ts2.8", "@types/path-parse@ts2.8", "@types/pg-pool@ts2.8", "@types/pg-types@ts2.8", "@types/pify@ts2.8", "@types/pixelmatch@ts2.8", "@types/pkg-dir@ts2.8", "@types/pluralize@ts2.8", "@types/pngjs@ts2.8", "@types/prelude-ls@ts2.8", "@types/pretty-bytes@ts2.8", "@types/pretty-format@ts2.8", "@types/progress@ts2.8", "@types/promise-retry@ts2.8", "@types/proxy-addr@ts2.8", "@types/pump@ts2.8", "@types/q@ts2.8", "@types/qs@ts2.8", "@types/range-parser@ts2.8", "@types/rc@ts2.8", "@types/rc-select@ts2.8", "@types/rc-slider@ts2.8", "@types/rc-tooltip@ts2.8", "@types/rc-tree@ts2.8", "@types/react-event-listener@ts2.8", "@types/react-side-effect@ts2.8", "@types/react-slick@ts2.8", "@types/read-chunk@ts2.8", "@types/read-pkg@ts2.8", "@types/read-pkg-up@ts2.8", "@types/recompose@ts2.8", "@types/recursive-readdir@ts2.8", "@types/relateurl@ts2.8", "@types/replace-ext@ts2.8", "@types/request@ts2.8", "@types/request-promise-native@ts2.8", "@types/require-directory@ts2.8", "@types/require-from-string@ts2.8", "@types/require-relative@ts2.8", "@types/resolve@ts2.8", "@types/resolve-from@ts2.8", "@types/retry@ts2.8", "@types/rx@ts2.8", "@types/rx-lite@ts2.8", "@types/rx-lite-aggregates@ts2.8", "@types/safe-regex@ts2.8", "@types/sane@ts2.8", "@types/sass-graph@ts2.8", "@types/sax@ts2.8", "@types/scriptjs@ts2.8", "@types/semver@ts2.8", "@types/send@ts2.8", "@types/serialize-javascript@ts2.8", "@types/serve-index@ts2.8", "@types/serve-static@ts2.8", "@types/set-value@ts2.8", "@types/shallowequal@ts2.8", "@types/shelljs@ts2.8", "@types/sockjs@ts2.8", "@types/sockjs-client@ts2.8", "@types/source-list-map@ts2.8", "@types/source-map-support@ts2.8", "@types/spdx-correct@ts2.8", "@types/spdy@ts2.8", "@types/split@ts2.8", "@types/sprintf@ts2.8", "@types/sprintf-js@ts2.8", "@types/sqlstring@ts2.8", "@types/sshpk@ts2.8", "@types/stack-utils@ts2.8", "@types/stat-mode@ts2.8", "@types/statuses@ts2.8", "@types/strict-uri-encode@ts2.8", "@types/string-template@ts2.8", "@types/strip-ansi@ts2.8", "@types/strip-bom@ts2.8", "@types/strip-json-comments@ts2.8", "@types/supports-color@ts2.8", "@types/svg2png@ts2.8", "@types/svgo@ts2.8", "@types/table@ts2.8", "@types/tapable@ts2.8", "@types/tar@ts2.8", "@types/temp@ts2.8", "@types/tempfile@ts2.8", "@types/through@ts2.8", "@types/through2@ts2.8", "@types/tinycolor2@ts2.8", "@types/tmp@ts2.8", "@types/to-absolute-glob@ts2.8", "@types/tough-cookie@ts2.8", "@types/trim@ts2.8", "@types/tryer@ts2.8", "@types/type-check@ts2.8", "@types/type-is@ts2.8", "@types/ua-parser-js@ts2.8", "@types/uglify-js@ts2.8", "@types/uglifyjs-webpack-plugin@ts2.8", "@types/underscore@ts2.8", "@types/uniq@ts2.8", "@types/uniqid@ts2.8", "@types/untildify@ts2.8", "@types/urijs@ts2.8", "@types/url-join@ts2.8", "@types/url-parse@ts2.8", "@types/url-regex@ts2.8", "@types/user-home@ts2.8", "@types/util-deprecate@ts2.8", "@types/util.promisify@ts2.8", "@types/utils-merge@ts2.8", "@types/uuid@ts2.8", "@types/vali-date@ts2.8", "@types/vary@ts2.8", "@types/verror@ts2.8", "@types/vinyl@ts2.8", "@types/vinyl-fs@ts2.8", "@types/warning@ts2.8", "@types/watch@ts2.8", "@types/watchpack@ts2.8", "@types/webpack-dev-middleware@ts2.8", "@types/webpack-sources@ts2.8", "@types/which@ts2.8", "@types/window-size@ts2.8", "@types/wrap-ansi@ts2.8", "@types/write-file-atomic@ts2.8", "@types/ws@ts2.8", "@types/xml2js@ts2.8", "@types/xmlbuilder@ts2.8", "@types/xtend@ts2.8", "@types/yallist@ts2.8", "@types/yargs@ts2.8", "@types/yauzl@ts2.8", "@types/yeoman-generator@ts2.8", "@types/zen-observable@ts2.8", "@types/react-content-loader@ts2.8"]; const expectedCommands = [ @@ -1704,7 +1704,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: recomputing resolutions of unresolved imports", () => { + describe("unittests:: tsserver:: typingsInstaller:: recomputing resolutions of unresolved imports", () => { const globalTypingsCacheLocation = "/tmp"; const appPath = "/a/b/app.js" as Path; const foooPath = "/a/b/node_modules/fooo/index.d.ts"; @@ -1775,7 +1775,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: typingsInstaller:: tsserver:: with inferred Project", () => { + describe("unittests:: tsserver:: typingsInstaller:: tsserver:: with inferred Project", () => { it("when projectRootPath is provided", () => { const projects = "/users/username/projects"; const projectRootPath = `${projects}/san2`; diff --git a/src/testRunner/unittests/tsserver/untitledFiles.ts b/src/testRunner/unittests/tsserver/untitledFiles.ts index 2c429707a94..845a53eb218 100644 --- a/src/testRunner/unittests/tsserver/untitledFiles.ts +++ b/src/testRunner/unittests/tsserver/untitledFiles.ts @@ -1,5 +1,5 @@ namespace ts.projectSystem { - describe("tsserver:: Untitled files", () => { + describe("unittests:: tsserver:: Untitled files", () => { it("Can convert positions to locations", () => { const aTs: File = { path: "/proj/a.ts", content: "" }; const tsconfig: File = { path: "/proj/tsconfig.json", content: "{}" }; diff --git a/src/testRunner/unittests/tsserver/versionCache.ts b/src/testRunner/unittests/tsserver/versionCache.ts index bd75b2bbaf4..60eaa6ca42e 100644 --- a/src/testRunner/unittests/tsserver/versionCache.ts +++ b/src/testRunner/unittests/tsserver/versionCache.ts @@ -15,7 +15,7 @@ namespace ts { assert.equal(editedText, checkText); } - describe(`tsserver:: VersionCache TS code`, () => { + describe(`unittests:: tsserver:: VersionCache TS code`, () => { let validateEditAtLineCharIndex: (line: number, char: number, deleteLength: number, insertString: string) => void; before(() => { @@ -77,7 +77,7 @@ var q:Point=p;`; }); }); - describe(`tsserver:: VersionCache simple text`, () => { + describe(`unittests:: tsserver:: VersionCache simple text`, () => { let validateEditAtPosition: (position: number, deleteLength: number, insertString: string) => void; let testContent: string; let lines: string[]; @@ -181,7 +181,7 @@ and grew 1cm per day`; }); }); - describe(`tsserver:: VersionCache stress test`, () => { + describe(`unittests:: tsserver:: VersionCache stress test`, () => { let rsa: number[] = []; let la: number[] = []; let las: number[] = []; diff --git a/src/testRunner/unittests/tsserver/watchEnvironment.ts b/src/testRunner/unittests/tsserver/watchEnvironment.ts index 5ca4d6f4570..2c195e0c7d2 100644 --- a/src/testRunner/unittests/tsserver/watchEnvironment.ts +++ b/src/testRunner/unittests/tsserver/watchEnvironment.ts @@ -1,6 +1,6 @@ namespace ts.projectSystem { import Tsc_WatchDirectory = TestFSWithWatch.Tsc_WatchDirectory; - describe("tsserver:: watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { + describe("unittests:: tsserver:: watchEnvironment:: tsserverProjectSystem watchDirectories implementation", () => { function verifyCompletionListWithNewFileInSubFolder(tscWatchDirectory: Tsc_WatchDirectory) { const projectFolder = "/a/username/project"; const projectSrcFolder = `${projectFolder}/src`; @@ -83,7 +83,7 @@ namespace ts.projectSystem { }); }); - describe("tsserver:: watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { + describe("unittests:: tsserver:: watchEnvironment:: tsserverProjectSystem Watched recursive directories with windows style file system", () => { function verifyWatchedDirectories(rootedPath: string, useProjectAtRoot: boolean) { const root = useProjectAtRoot ? rootedPath : `${rootedPath}myfolder/allproject/`; const configFile: File = { From f117184562901c18fd642abc15647b1eb1645c0d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 20 Dec 2018 14:00:45 -0800 Subject: [PATCH 240/322] More tsserver tests refactoring --- src/testRunner/tsconfig.json | 6 +- .../unittests/tsserver/compileOnSave.ts | 95 + .../unittests/tsserver/configuredProjects.ts | 1010 +++++ .../events/projectLanguageServiceState.ts | 51 + .../unittests/tsserver/events/surveyReady.ts | 111 + .../unittests/tsserver/externalProjects.ts | 464 +++ .../tsserver/getApplicableRefactors.ts | 12 + .../unittests/tsserver/inferredProjects.ts | 120 + src/testRunner/unittests/tsserver/projects.ts | 1426 +++++++ .../unittests/tsserverProjectSystem.ts | 3281 ----------------- 10 files changed, 3294 insertions(+), 3282 deletions(-) create mode 100644 src/testRunner/unittests/tsserver/configuredProjects.ts create mode 100644 src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts create mode 100644 src/testRunner/unittests/tsserver/events/surveyReady.ts create mode 100644 src/testRunner/unittests/tsserver/getApplicableRefactors.ts create mode 100644 src/testRunner/unittests/tsserver/projects.ts delete mode 100644 src/testRunner/unittests/tsserverProjectSystem.ts diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 4d200c4b8f9..9b5f74cb18c 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -61,7 +61,6 @@ "unittests/tsbuild.ts", "unittests/tsbuildWatchMode.ts", "unittests/tscWatchMode.ts", - "unittests/tsserverProjectSystem.ts", "unittests/config/commandLineParsing.ts", "unittests/config/configurationExtension.ts", "unittests/config/convertCompilerOptionsFromJson.ts", @@ -98,15 +97,19 @@ "unittests/tsserver/compileOnSave.ts", "unittests/tsserver/completions.ts", "unittests/tsserver/configFileSearch.ts", + "unittests/tsserver/configuredProjects.ts", "unittests/tsserver/declarationFileMaps.ts", "unittests/tsserver/documentRegistry.ts", "unittests/tsserver/duplicatePackages.ts", "unittests/tsserver/events/largeFileReferenced.ts", + "unittests/tsserver/events/projectLanguageServiceState.ts", "unittests/tsserver/events/projectLoading.ts", "unittests/tsserver/events/projectUpdatedInBackground.ts", + "unittests/tsserver/events/surveyReady.ts", "unittests/tsserver/externalProjects.ts", "unittests/tsserver/forceConsistentCasingInFileNames.ts", "unittests/tsserver/formatSettings.ts", + "unittests/tsserver/getApplicableRefactors.ts", "unittests/tsserver/getEditsForFileRename.ts", "unittests/tsserver/importHelpers.ts", "unittests/tsserver/inferredProjects.ts", @@ -118,6 +121,7 @@ "unittests/tsserver/openFile.ts", "unittests/tsserver/projectErrors.ts", "unittests/tsserver/projectReferences.ts", + "unittests/tsserver/projects.ts", "unittests/tsserver/refactors.ts", "unittests/tsserver/reload.ts", "unittests/tsserver/rename.ts", diff --git a/src/testRunner/unittests/tsserver/compileOnSave.ts b/src/testRunner/unittests/tsserver/compileOnSave.ts index 667144f6a06..7dc9ea0497c 100644 --- a/src/testRunner/unittests/tsserver/compileOnSave.ts +++ b/src/testRunner/unittests/tsserver/compileOnSave.ts @@ -695,4 +695,99 @@ namespace ts.projectSystem { }); }); + describe("unittests:: tsserver:: compileOnSave:: CompileOnSaveAffectedFileListRequest with and without projectFileName in request", () => { + const projectRoot = "/user/username/projects/myproject"; + const core: File = { + path: `${projectRoot}/core/core.ts`, + content: "let z = 10;" + }; + const app1: File = { + path: `${projectRoot}/app1/app.ts`, + content: "let x = 10;" + }; + const app2: File = { + path: `${projectRoot}/app2/app.ts`, + content: "let y = 10;" + }; + const app1Config: File = { + path: `${projectRoot}/app1/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile: "build/output.js" }, + compileOnSave: true + }) + }; + const app2Config: File = { + path: `${projectRoot}/app2/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile: "build/output.js" }, + compileOnSave: true + }) + }; + const files = [libFile, core, app1, app2, app1Config, app2Config]; + + function insertString(session: TestSession, file: File) { + session.executeCommandSeq({ + command: protocol.CommandTypes.Change, + arguments: { + file: file.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: "let k = 1" + } + }); + } + + function getSession() { + const host = createServerHost(files); + const session = createSession(host); + openFilesForSession([app1, app2, core], session); + const service = session.getProjectService(); + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 2 }); + const project1 = service.configuredProjects.get(app1Config.path)!; + const project2 = service.configuredProjects.get(app2Config.path)!; + checkProjectActualFiles(project1, [libFile.path, app1.path, core.path, app1Config.path]); + checkProjectActualFiles(project2, [libFile.path, app2.path, core.path, app2Config.path]); + insertString(session, app1); + insertString(session, app2); + assert.equal(project1.dirty, true); + assert.equal(project2.dirty, true); + return session; + } + + it("when projectFile is specified", () => { + const session = getSession(); + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: { + file: core.path, + projectFileName: app1Config.path + } + }).response; + assert.deepEqual(response, [ + { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true } + ]); + assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); + assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, true); + }); + + it("when projectFile is not specified", () => { + const session = getSession(); + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: { + file: core.path + } + }).response; + assert.deepEqual(response, [ + { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true }, + { projectFileName: app2Config.path, fileNames: [core.path, app2.path], projectUsesOutFile: true } + ]); + assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); + assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, false); + }); + }); } diff --git a/src/testRunner/unittests/tsserver/configuredProjects.ts b/src/testRunner/unittests/tsserver/configuredProjects.ts new file mode 100644 index 00000000000..d1525f8dbeb --- /dev/null +++ b/src/testRunner/unittests/tsserver/configuredProjects.ts @@ -0,0 +1,1010 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: ConfiguredProjects", () => { + it("create configured project without file list", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: ` + { + "compilerOptions": {}, + "exclude": [ + "e" + ] + }` + }; + const file1: File = { + path: "/a/b/c/f1.ts", + content: "let x = 1" + }; + const file2: File = { + path: "/a/b/d/f2.ts", + content: "let y = 1" + }; + const file3: File = { + path: "/a/b/e/f3.ts", + content: "let z = 1" + }; + + const host = createServerHost([configFile, libFile, file1, file2, file3]); + const projectService = createProjectService(host); + const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); + + assert(configFileName, "should find config file"); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + checkNumberOfInferredProjects(projectService, 0); + checkNumberOfConfiguredProjects(projectService, 1); + + const project = configuredProjectAt(projectService, 0); + checkProjectActualFiles(project, [file1.path, libFile.path, file2.path, configFile.path]); + checkProjectRootFiles(project, [file1.path, file2.path]); + // watching all files except one that was open + checkWatchedFiles(host, [configFile.path, file2.path, libFile.path]); + const configFileDirectory = getDirectoryPath(configFile.path); + checkWatchedDirectories(host, [configFileDirectory, combinePaths(configFileDirectory, nodeModulesAtTypes)], /*recursive*/ true); + }); + + it("create configured project with the file list", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: ` + { + "compilerOptions": {}, + "include": ["*.ts"] + }` + }; + const file1: File = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2: File = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const file3: File = { + path: "/a/b/c/f3.ts", + content: "let z = 1" + }; + + const host = createServerHost([configFile, libFile, file1, file2, file3]); + const projectService = createProjectService(host); + const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); + + assert(configFileName, "should find config file"); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + checkNumberOfInferredProjects(projectService, 0); + checkNumberOfConfiguredProjects(projectService, 1); + + const project = configuredProjectAt(projectService, 0); + checkProjectActualFiles(project, [file1.path, libFile.path, file2.path, configFile.path]); + checkProjectRootFiles(project, [file1.path, file2.path]); + // watching all files except one that was open + checkWatchedFiles(host, [configFile.path, file2.path, libFile.path]); + checkWatchedDirectories(host, [getDirectoryPath(configFile.path)], /*recursive*/ false); + }); + + it("add and then remove a config file in a folder with loose files", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["commonFile1.ts"] + }` + }; + const filesWithoutConfig = [libFile, commonFile1, commonFile2]; + const host = createServerHost(filesWithoutConfig); + + const filesWithConfig = [libFile, commonFile1, commonFile2, configFile]; + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + projectService.openClientFile(commonFile2.path); + + projectService.checkNumberOfProjects({ inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [commonFile1.path, libFile.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [commonFile2.path, libFile.path]); + + const configFileLocations = ["/", "/a/", "/a/b/"]; + const watchedFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]).concat(libFile.path); + checkWatchedFiles(host, watchedFiles); + + // Add a tsconfig file + host.reloadFS(filesWithConfig); + host.checkTimeoutQueueLengthAndRun(2); // load configured project from disk + ensureProjectsForOpenFiles + + projectService.checkNumberOfProjects({ inferredProjects: 2, configuredProjects: 1 }); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + checkProjectActualFiles(projectService.inferredProjects[1], [commonFile2.path, libFile.path]); + checkProjectActualFiles(projectService.configuredProjects.get(configFile.path)!, [libFile.path, commonFile1.path, configFile.path]); + + checkWatchedFiles(host, watchedFiles); + + // remove the tsconfig file + host.reloadFS(filesWithoutConfig); + + projectService.checkNumberOfProjects({ inferredProjects: 2 }); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + checkProjectActualFiles(projectService.inferredProjects[1], [commonFile2.path, libFile.path]); + + host.checkTimeoutQueueLengthAndRun(1); // Refresh inferred projects + + projectService.checkNumberOfProjects({ inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [commonFile1.path, libFile.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [commonFile2.path, libFile.path]); + checkWatchedFiles(host, watchedFiles); + }); + + it("add new files to a configured project without file list", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([commonFile1, libFile, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + const configFileDir = getDirectoryPath(configFile.path); + checkWatchedDirectories(host, [configFileDir, combinePaths(configFileDir, nodeModulesAtTypes)], /*recursive*/ true); + checkNumberOfConfiguredProjects(projectService, 1); + + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path]); + + // add a new ts file + host.reloadFS([commonFile1, commonFile2, libFile, configFile]); + host.checkTimeoutQueueLengthAndRun(2); + // project service waits for 250ms to update the project structure, therefore the assertion needs to wait longer. + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + }); + + it("should ignore non-existing files specified in the config file", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "files": [ + "commonFile1.ts", + "commonFile3.ts" + ] + }` + }; + const host = createServerHost([commonFile1, commonFile2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + projectService.openClientFile(commonFile2.path); + + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path]); + checkNumberOfInferredProjects(projectService, 1); + }); + + it("handle recreated files correctly", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([commonFile1, commonFile2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + + // delete commonFile2 + host.reloadFS([commonFile1, configFile]); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectRootFiles(project, [commonFile1.path]); + + // re-add commonFile2 + host.reloadFS([commonFile1, commonFile2, configFile]); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + }); + + it("files explicitly excluded in config file", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "exclude": ["/a/c"] + }` + }; + const excludedFile1: File = { + path: "/a/c/excluedFile1.ts", + content: `let t = 1;` + }; + + const host = createServerHost([commonFile1, commonFile2, excludedFile1, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(commonFile1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + projectService.openClientFile(excludedFile1.path); + checkNumberOfInferredProjects(projectService, 1); + }); + + it("should properly handle module resolution changes in config file", () => { + const file1: File = { + path: "/a/b/file1.ts", + content: `import { T } from "module1";` + }; + const nodeModuleFile: File = { + path: "/a/b/node_modules/module1.ts", + content: `export interface T {}` + }; + const classicModuleFile: File = { + path: "/a/module1.ts", + content: `export interface T {}` + }; + const randomFile: File = { + path: "/a/file1.ts", + content: `export interface T {}` + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "moduleResolution": "node" + }, + "files": ["${file1.path}"] + }` + }; + const files = [file1, nodeModuleFile, classicModuleFile, configFile, randomFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.openClientFile(nodeModuleFile.path); + projectService.openClientFile(classicModuleFile.path); + + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + const project = configuredProjectAt(projectService, 0); + const inferredProject0 = projectService.inferredProjects[0]; + checkProjectActualFiles(project, [file1.path, nodeModuleFile.path, configFile.path]); + checkProjectActualFiles(projectService.inferredProjects[0], [classicModuleFile.path]); + + configFile.content = `{ + "compilerOptions": { + "moduleResolution": "classic" + }, + "files": ["${file1.path}"] + }`; + host.reloadFS(files); + host.checkTimeoutQueueLengthAndRun(2); + + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); // will not remove project 1 + checkProjectActualFiles(project, [file1.path, classicModuleFile.path, configFile.path]); + assert.strictEqual(projectService.inferredProjects[0], inferredProject0); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + const inferredProject1 = projectService.inferredProjects[1]; + checkProjectActualFiles(projectService.inferredProjects[1], [nodeModuleFile.path]); + + // Open random file and it will reuse first inferred project + projectService.openClientFile(randomFile.path); + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); + checkProjectActualFiles(project, [file1.path, classicModuleFile.path, configFile.path]); + assert.strictEqual(projectService.inferredProjects[0], inferredProject0); + checkProjectActualFiles(projectService.inferredProjects[0], [randomFile.path]); // Reuses first inferred project + assert.strictEqual(projectService.inferredProjects[1], inferredProject1); + checkProjectActualFiles(projectService.inferredProjects[1], [nodeModuleFile.path]); + }); + + it("should keep the configured project when the opened file is referenced by the project but not its root", () => { + const file1: File = { + path: "/a/b/main.ts", + content: "import { objA } from './obj-a';" + }; + const file2: File = { + path: "/a/b/obj-a.ts", + content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.closeClientFile(file1.path); + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + }); + + it("should keep the configured project when the opened file is referenced by the project but not its root", () => { + const file1: File = { + path: "/a/b/main.ts", + content: "import { objA } from './obj-a';" + }; + const file2: File = { + path: "/a/b/obj-a.ts", + content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.closeClientFile(file1.path); + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + }); + + it("should tolerate config file errors and still try to build a project", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6", + "allowAnything": true + }, + "someOtherProperty": {} + }` + }; + const host = createServerHost([commonFile1, commonFile2, libFile, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [commonFile1.path, commonFile2.path]); + }); + + it("should reuse same project if file is opened from the configured project that has no open files", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const file2 = { + path: "/a/b/main2.ts", + content: "let y =1;" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts", "main2.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isTrue(project.hasOpenRef()); // file1 + + projectService.closeClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isFalse(project.hasOpenRef()); // No open files + assert.isFalse(project.isClosed()); + + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isTrue(project.hasOpenRef()); // file2 + assert.isFalse(project.isClosed()); + }); + + it("should not close configured project after closing last open file, but should be closed on next file open if its not the file from same project", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, configFile, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isTrue(project.hasOpenRef()); // file1 + + projectService.closeClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isFalse(project.hasOpenRef()); // No files + assert.isFalse(project.isClosed()); + + projectService.openClientFile(libFile.path); + checkNumberOfConfiguredProjects(projectService, 0); + assert.isFalse(project.hasOpenRef()); // No files + project closed + assert.isTrue(project.isClosed()); + }); + + it("open file become a part of configured project if it is referenced from root file", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "export let x = 5" + }; + const file2 = { + path: "/a/c/f2.ts", + content: `import {x} from "../b/f1"` + }; + const file3 = { + path: "/a/c/f3.ts", + content: "export let y = 1" + }; + const configFile = { + path: "/a/c/tsconfig.json", + content: JSON.stringify({ compilerOptions: {}, files: ["f2.ts", "f3.ts"] }) + }; + + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + + host.reloadFS([file1, file2, file3, configFile]); + host.checkTimeoutQueueLengthAndRun(2); // load configured project from disk + ensureProjectsForOpenFiles + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, file3.path, configFile.path]); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + assert.isTrue(projectService.inferredProjects[1].isOrphan()); + }); + + it("can correctly update configured project when set of root files has changed (new file on disk)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + + const host = createServerHost([file1, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); + + host.reloadFS([file1, file2, configFile]); + + host.checkTimeoutQueueLengthAndRun(2); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); + }); + + it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts"] }) + }; + + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); + + const modifiedConfigFile = { + path: configFile.path, + content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) + }; + + host.reloadFS([file1, file2, modifiedConfigFile]); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); + }); + + it("can update configured project when set of root files was not changed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) + }; + + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, configFile.path]); + + const modifiedConfigFile = { + path: configFile.path, + content: JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] }) + }; + + host.reloadFS([file1, file2, modifiedConfigFile]); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); + }); + + it("Open ref of configured project when open file gets added to the project as part of configured file update", () => { + const file1: File = { + path: "/a/b/src/file1.ts", + content: "let x = 1;" + }; + const file2: File = { + path: "/a/b/src/file2.ts", + content: "let y = 1;" + }; + const file3: File = { + path: "/a/b/file3.ts", + content: "let z = 1;" + }; + const file4: File = { + path: "/a/file4.ts", + content: "let z = 1;" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ files: ["src/file1.ts", "file3.ts"] }) + }; + + const files = [file1, file2, file3, file4]; + const host = createServerHost(files.concat(configFile)); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + projectService.openClientFile(file2.path); + projectService.openClientFile(file3.path); + projectService.openClientFile(file4.path); + + const infos = files.map(file => projectService.getScriptInfoForPath(file.path as Path)!); + checkOpenFiles(projectService, files); + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); + const configProject1 = projectService.configuredProjects.get(configFile.path)!; + assert.isTrue(configProject1.hasOpenRef()); // file1 and file3 + checkProjectActualFiles(configProject1, [file1.path, file3.path, configFile.path]); + const inferredProject1 = projectService.inferredProjects[0]; + checkProjectActualFiles(inferredProject1, [file2.path]); + const inferredProject2 = projectService.inferredProjects[1]; + checkProjectActualFiles(inferredProject2, [file4.path]); + + configFile.content = "{}"; + host.reloadFS(files.concat(configFile)); + host.runQueuedTimeoutCallbacks(); + + verifyScriptInfos(); + checkOpenFiles(projectService, files); + verifyConfiguredProjectStateAfterUpdate(/*hasOpenRef*/ true, 2); // file1, file2, file3 + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + const inferredProject3 = projectService.inferredProjects[1]; + checkProjectActualFiles(inferredProject3, [file4.path]); + assert.strictEqual(inferredProject3, inferredProject2); + + projectService.closeClientFile(file1.path); + projectService.closeClientFile(file2.path); + projectService.closeClientFile(file4.path); + + verifyScriptInfos(); + checkOpenFiles(projectService, [file3]); + verifyConfiguredProjectStateAfterUpdate(/*hasOpenRef*/ true, 2); // file3 + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + assert.isTrue(projectService.inferredProjects[1].isOrphan()); + + projectService.openClientFile(file4.path); + verifyScriptInfos(); + checkOpenFiles(projectService, [file3, file4]); + verifyConfiguredProjectStateAfterUpdate(/*hasOpenRef*/ true, 1); // file3 + const inferredProject4 = projectService.inferredProjects[0]; + checkProjectActualFiles(inferredProject4, [file4.path]); + + projectService.closeClientFile(file3.path); + verifyScriptInfos(); + checkOpenFiles(projectService, [file4]); + verifyConfiguredProjectStateAfterUpdate(/*hasOpenRef*/ false, 1); // No open files + const inferredProject5 = projectService.inferredProjects[0]; + checkProjectActualFiles(inferredProject4, [file4.path]); + assert.strictEqual(inferredProject5, inferredProject4); + + const file5: File = { + path: "/file5.ts", + content: "let zz = 1;" + }; + host.reloadFS(files.concat(configFile, file5)); + projectService.openClientFile(file5.path); + verifyScriptInfosAreUndefined([file1, file2, file3]); + assert.strictEqual(projectService.getScriptInfoForPath(file4.path as Path), find(infos, info => info.path === file4.path)); + assert.isDefined(projectService.getScriptInfoForPath(file5.path as Path)); + checkOpenFiles(projectService, [file4, file5]); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file4.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file5.path]); + + function verifyScriptInfos() { + infos.forEach(info => assert.strictEqual(projectService.getScriptInfoForPath(info.path), info)); + } + + function verifyScriptInfosAreUndefined(files: File[]) { + for (const file of files) { + assert.isUndefined(projectService.getScriptInfoForPath(file.path as Path)); + } + } + + function verifyConfiguredProjectStateAfterUpdate(hasOpenRef: boolean, inferredProjects: number) { + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects }); + const configProject2 = projectService.configuredProjects.get(configFile.path)!; + assert.strictEqual(configProject2, configProject1); + checkProjectActualFiles(configProject2, [file1.path, file2.path, file3.path, configFile.path]); + assert.equal(configProject2.hasOpenRef(), hasOpenRef); + } + }); + + it("Open ref of configured project when open file gets added to the project as part of configured file update buts its open file references are all closed when the update happens", () => { + const file1: File = { + path: "/a/b/src/file1.ts", + content: "let x = 1;" + }; + const file2: File = { + path: "/a/b/src/file2.ts", + content: "let y = 1;" + }; + const file3: File = { + path: "/a/b/file3.ts", + content: "let z = 1;" + }; + const file4: File = { + path: "/a/file4.ts", + content: "let z = 1;" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ files: ["src/file1.ts", "file3.ts"] }) + }; + + const files = [file1, file2, file3]; + const hostFiles = files.concat(file4, configFile); + const host = createServerHost(hostFiles); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + projectService.openClientFile(file2.path); + projectService.openClientFile(file3.path); + + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + const configuredProject = projectService.configuredProjects.get(configFile.path)!; + assert.isTrue(configuredProject.hasOpenRef()); // file1 and file3 + checkProjectActualFiles(configuredProject, [file1.path, file3.path, configFile.path]); + const inferredProject1 = projectService.inferredProjects[0]; + checkProjectActualFiles(inferredProject1, [file2.path]); + + projectService.closeClientFile(file1.path); + projectService.closeClientFile(file3.path); + assert.isFalse(configuredProject.hasOpenRef()); // No files + + configFile.content = "{}"; + host.reloadFS(files.concat(configFile)); + // Time out is not yet run so there is project update pending + assert.isTrue(configuredProject.hasOpenRef()); // Pending update and file2 might get into the project + + projectService.openClientFile(file4.path); + + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), configuredProject); + assert.isTrue(configuredProject.hasOpenRef()); // Pending update and F2 might get into the project + assert.strictEqual(projectService.inferredProjects[0], inferredProject1); + const inferredProject2 = projectService.inferredProjects[1]; + checkProjectActualFiles(inferredProject2, [file4.path]); + + host.runQueuedTimeoutCallbacks(); + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 2 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), configuredProject); + assert.isTrue(configuredProject.hasOpenRef()); // file2 + checkProjectActualFiles(configuredProject, [file1.path, file2.path, file3.path, configFile.path]); + assert.strictEqual(projectService.inferredProjects[0], inferredProject1); + assert.isTrue(inferredProject1.isOrphan()); + assert.strictEqual(projectService.inferredProjects[1], inferredProject2); + checkProjectActualFiles(inferredProject2, [file4.path]); + }); + + it("files are properly detached when language service is disabled", () => { + const f1 = { + path: "/a/app.js", + content: "var x = 1" + }; + const f2 = { + path: "/a/largefile.js", + content: "" + }; + const f3 = { + path: "/a/lib.js", + content: "var x = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true } }) + }; + const host = createServerHost([f1, f2, f3, config]); + const originalGetFileSize = host.getFileSize; + host.getFileSize = (filePath: string) => + filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); + + const projectService = createProjectService(host); + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + const project = projectService.configuredProjects.get(config.path)!; + assert.isTrue(project.hasOpenRef()); // f1 + assert.isFalse(project.isClosed()); + + projectService.closeClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config.path), project); + assert.isFalse(project.hasOpenRef()); // No files + assert.isFalse(project.isClosed()); + + for (const f of [f1, f2, f3]) { + // All the script infos should be present and contain the project since it is still alive. + const scriptInfo = projectService.getScriptInfoForNormalizedPath(server.toNormalizedPath(f.path))!; + assert.equal(scriptInfo.containingProjects.length, 1, `expect 1 containing projects for '${f.path}'`); + assert.equal(scriptInfo.containingProjects[0], project, `expect configured project to be the only containing project for '${f.path}'`); + } + + const f4 = { + path: "/aa.js", + content: "var x = 1" + }; + host.reloadFS([f1, f2, f3, config, f4]); + projectService.openClientFile(f4.path); + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + assert.isFalse(project.hasOpenRef()); // No files + assert.isTrue(project.isClosed()); + + for (const f of [f1, f2, f3]) { + // All the script infos should not be present since the project is closed and orphan script infos are collected + assert.isUndefined(projectService.getScriptInfoForNormalizedPath(server.toNormalizedPath(f.path))); + } + }); + + it("syntactic features work even if language service is disabled", () => { + const f1 = { + path: "/a/app.js", + content: "let x = 1;" + }; + const f2 = { + path: "/a/largefile.js", + content: "" + }; + const config = { + path: "/a/jsconfig.json", + content: "{}" + }; + const host = createServerHost([f1, f2, config]); + const originalGetFileSize = host.getFileSize; + host.getFileSize = (filePath: string) => + filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); + const { session, events } = createSessionWithEventTracking(host, server.ProjectLanguageServiceStateEvent); + session.executeCommand({ + seq: 0, + type: "request", + command: "open", + arguments: { file: f1.path } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = configuredProjectAt(projectService, 0); + assert.isFalse(project.languageServiceEnabled, "Language service enabled"); + assert.equal(events.length, 1, "should receive event"); + assert.equal(events[0].data.project, project, "project name"); + assert.isFalse(events[0].data.languageServiceEnabled, "Language service state"); + + const options = projectService.getFormatCodeOptions(f1.path as server.NormalizedPath); + const edits = project.getLanguageService().getFormattingEditsForDocument(f1.path, options); + assert.deepEqual(edits, [{ span: createTextSpan(/*start*/ 7, /*length*/ 3), newText: " " }]); + }); + }); + + describe("unittests:: tsserver:: ConfiguredProjects:: non-existing directories listed in config file input array", () => { + it("should be tolerated without crashing the server", () => { + const configFile = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "include": ["app/*", "test/**/*", "something"] + }` + }; + const file1 = { + path: "/a/b/file1.ts", + content: "let t = 10;" + }; + + const host = createServerHost([file1, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + host.runQueuedTimeoutCallbacks(); + // Since there is no file open from configFile it would be closed + checkNumberOfConfiguredProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 1); + + const inferredProject = projectService.inferredProjects[0]; + assert.isTrue(inferredProject.containsFile(file1.path)); + }); + + it("should be able to handle @types if input file list is empty", () => { + const f = { + path: "/a/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compiler: {}, + files: [] + }) + }; + const t1 = { + path: "/a/node_modules/@types/typings/index.d.ts", + content: `export * from "./lib"` + }; + const t2 = { + path: "/a/node_modules/@types/typings/lib.d.ts", + content: `export const x: number` + }; + const host = createServerHost([f, config, t1, t2], { currentDirectory: getDirectoryPath(f.path) }); + const projectService = createProjectService(host); + + projectService.openClientFile(f.path); + // Since no file from the configured project is open, it would be closed immediately + projectService.checkNumberOfProjects({ configuredProjects: 0, inferredProjects: 1 }); + }); + + it("should tolerate invalid include files that start in subDirectory", () => { + const projectFolder = "/user/username/projects/myproject"; + const f = { + path: `${projectFolder}/src/server/index.ts`, + content: "let x = 1" + }; + const config = { + path: `${projectFolder}/src/server/tsconfig.json`, + content: JSON.stringify({ + compiler: { + module: "commonjs", + outDir: "../../build" + }, + include: [ + "../src/**/*.ts" + ] + }) + }; + const host = createServerHost([f, config, libFile], { useCaseSensitiveFileNames: true }); + const projectService = createProjectService(host); + + projectService.openClientFile(f.path); + // Since no file from the configured project is open, it would be closed immediately + projectService.checkNumberOfProjects({ configuredProjects: 0, inferredProjects: 1 }); + }); + + it("Changed module resolution reflected when specifying files list", () => { + const file1: File = { + path: "/a/b/file1.ts", + content: 'import classc from "file2"' + }; + const file2a: File = { + path: "/a/file2.ts", + content: "export classc { method2a() { return 10; } }" + }; + const file2: File = { + path: "/a/b/file2.ts", + content: "export classc { method2() { return 10; } }" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ files: [file1.path], compilerOptions: { module: "amd" } }) + }; + const files = [file1, file2a, configFile, libFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isDefined(project); + checkProjectActualFiles(project, map(files, file => file.path)); + checkWatchedFiles(host, mapDefined(files, file => file === file1 ? undefined : file.path)); + checkWatchedDirectoriesDetailed(host, ["/a/b"], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); + + files.push(file2); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + checkProjectActualFiles(project, mapDefined(files, file => file === file2a ? undefined : file.path)); + checkWatchedFiles(host, mapDefined(files, file => file === file1 ? undefined : file.path)); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); + + // On next file open the files file2a should be closed and not watched any more + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + checkProjectActualFiles(project, mapDefined(files, file => file === file2a ? undefined : file.path)); + checkWatchedFiles(host, [libFile.path, configFile.path]); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); + }); + + it("Failed lookup locations uses parent most node_modules directory", () => { + const root = "/user/username/rootfolder"; + const file1: File = { + path: "/a/b/src/file1.ts", + content: 'import { classc } from "module1"' + }; + const module1: File = { + path: "/a/b/node_modules/module1/index.d.ts", + content: `import { class2 } from "module2"; + export classc { method2a(): class2; }` + }; + const module2: File = { + path: "/a/b/node_modules/module2/index.d.ts", + content: "export class2 { method2() { return 10; } }" + }; + const module3: File = { + path: "/a/b/node_modules/module/node_modules/module3/index.d.ts", + content: "export class3 { method2() { return 10; } }" + }; + const configFile: File = { + path: "/a/b/src/tsconfig.json", + content: JSON.stringify({ files: ["file1.ts"] }) + }; + const nonLibFiles = [file1, module1, module2, module3, configFile]; + nonLibFiles.forEach(f => f.path = root + f.path); + const files = nonLibFiles.concat(libFile); + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path)!; + assert.isDefined(project); + checkProjectActualFiles(project, [file1.path, libFile.path, module1.path, module2.path, configFile.path]); + checkWatchedFiles(host, [libFile.path, configFile.path]); + checkWatchedDirectories(host, [], /*recursive*/ false); + const watchedRecursiveDirectories = getTypeRootsFromLocation(root + "/a/b/src"); + watchedRecursiveDirectories.push(`${root}/a/b/src/node_modules`, `${root}/a/b/node_modules`); + checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts b/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts new file mode 100644 index 00000000000..231c46c350b --- /dev/null +++ b/src/testRunner/unittests/tsserver/events/projectLanguageServiceState.ts @@ -0,0 +1,51 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: events:: ProjectLanguageServiceStateEvent", () => { + it("language service disabled events are triggered", () => { + const f1 = { + path: "/a/app.js", + content: "let x = 1;" + }; + const f2 = { + path: "/a/largefile.js", + content: "" + }; + const config = { + path: "/a/jsconfig.json", + content: "{}" + }; + const configWithExclude = { + path: config.path, + content: JSON.stringify({ exclude: ["largefile.js"] }) + }; + const host = createServerHost([f1, f2, config]); + const originalGetFileSize = host.getFileSize; + host.getFileSize = (filePath: string) => + filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); + + const { session, events } = createSessionWithEventTracking(host, server.ProjectLanguageServiceStateEvent); + session.executeCommand({ + seq: 0, + type: "request", + command: "open", + arguments: { file: f1.path } + }); + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = configuredProjectAt(projectService, 0); + assert.isFalse(project.languageServiceEnabled, "Language service enabled"); + assert.equal(events.length, 1, "should receive event"); + assert.equal(events[0].data.project, project, "project name"); + assert.equal(events[0].data.project.getProjectName(), config.path, "config path"); + assert.isFalse(events[0].data.languageServiceEnabled, "Language service state"); + + host.reloadFS([f1, f2, configWithExclude]); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.isTrue(project.languageServiceEnabled, "Language service enabled"); + assert.equal(events.length, 2, "should receive event"); + assert.equal(events[1].data.project, project, "project"); + assert.equal(events[1].data.project.getProjectName(), config.path, "config path"); + assert.isTrue(events[1].data.languageServiceEnabled, "Language service state"); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/events/surveyReady.ts b/src/testRunner/unittests/tsserver/events/surveyReady.ts new file mode 100644 index 00000000000..b04746800d0 --- /dev/null +++ b/src/testRunner/unittests/tsserver/events/surveyReady.ts @@ -0,0 +1,111 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: events:: SurveyReady", () => { + function createSessionWithEventHandler(host: TestServerHost) { + const { session, events: surveyEvents } = createSessionWithEventTracking(host, server.SurveyReady); + + return { session, verifySurveyReadyEvent }; + + function verifySurveyReadyEvent(numberOfEvents: number) { + assert.equal(surveyEvents.length, numberOfEvents); + const expectedEvents = numberOfEvents === 0 ? [] : [{ + eventName: server.SurveyReady, + data: { surveyId: "checkJs" } + }]; + assert.deepEqual(surveyEvents, expectedEvents); + } + } + + it("doesn't log an event when checkJs isn't set", () => { + const projectRoot = "/user/username/projects/project"; + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: "export var y = 10;" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: {} }), + }; + const host = createServerHost([file, tsconfig]); + const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); + const service = session.getProjectService(); + openFilesForSession([file], session); + checkNumberOfProjects(service, { configuredProjects: 1 }); + const project = service.configuredProjects.get(tsconfig.path)!; + checkProjectActualFiles(project, [file.path, tsconfig.path]); + + verifySurveyReadyEvent(0); + }); + + it("logs an event when checkJs is set", () => { + const projectRoot = "/user/username/projects/project"; + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: "export var y = 10;" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { checkJs: true } }), + }; + const host = createServerHost([file, tsconfig]); + const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); + openFilesForSession([file], session); + + verifySurveyReadyEvent(1); + }); + + it("logs an event when checkJs is set, only the first time", () => { + const projectRoot = "/user/username/projects/project"; + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: "export var y = 10;" + }; + const rando: File = { + path: `/rando/calrissian.ts`, + content: "export function f() { }" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { checkJs: true } }), + }; + const host = createServerHost([file, tsconfig]); + const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); + openFilesForSession([file], session); + + verifySurveyReadyEvent(1); + + closeFilesForSession([file], session); + openFilesForSession([rando], session); + openFilesForSession([file], session); + + verifySurveyReadyEvent(1); + }); + + it("logs an event when checkJs is set after closing and reopening", () => { + const projectRoot = "/user/username/projects/project"; + const file: File = { + path: `${projectRoot}/src/file.ts`, + content: "export var y = 10;" + }; + const rando: File = { + path: `/rando/calrissian.ts`, + content: "export function f() { }" + }; + const tsconfig: File = { + path: `${projectRoot}/tsconfig.json`, + content: JSON.stringify({}), + }; + const host = createServerHost([file, tsconfig]); + const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host); + openFilesForSession([file], session); + + verifySurveyReadyEvent(0); + + closeFilesForSession([file], session); + openFilesForSession([rando], session); + host.writeFile(tsconfig.path, JSON.stringify({ compilerOptions: { checkJs: true } })); + openFilesForSession([file], session); + + verifySurveyReadyEvent(1); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/externalProjects.ts b/src/testRunner/unittests/tsserver/externalProjects.ts index 87615b24d12..12a97151f4e 100644 --- a/src/testRunner/unittests/tsserver/externalProjects.ts +++ b/src/testRunner/unittests/tsserver/externalProjects.ts @@ -1,5 +1,469 @@ namespace ts.projectSystem { describe("unittests:: tsserver:: ExternalProjects", () => { + describe("can handle tsconfig file name with difference casing", () => { + function verifyConfigFileCasing(lazyConfiguredProjectsFromExternalProject: boolean) { + const f1 = { + path: "/a/b/app.ts", + content: "let x = 1" + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ + include: [] + }) + }; + + const host = createServerHost([f1, config], { useCaseSensitiveFileNames: false }); + const service = createProjectService(host); + service.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); + const upperCaseConfigFilePath = combinePaths(getDirectoryPath(config.path).toUpperCase(), getBaseFileName(config.path)); + service.openExternalProject({ + projectFileName: "/a/b/project.csproj", + rootFiles: toExternalFiles([f1.path, upperCaseConfigFilePath]), + options: {} + }); + service.checkNumberOfProjects({ configuredProjects: 1 }); + const project = service.configuredProjects.get(config.path)!; + if (lazyConfiguredProjectsFromExternalProject) { + assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.Full); // External project referenced configured project pending to be reloaded + checkProjectActualFiles(project, emptyArray); + } + else { + assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project loaded + checkProjectActualFiles(project, [upperCaseConfigFilePath]); + } + + service.openClientFile(f1.path); + service.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: 1 }); + + assert.equal(project.pendingReload, ConfigFileProgramReloadLevel.None); // External project referenced configured project is updated + checkProjectActualFiles(project, [upperCaseConfigFilePath]); + checkProjectActualFiles(service.inferredProjects[0], [f1.path]); + } + + it("when lazyConfiguredProjectsFromExternalProject not set", () => { + verifyConfigFileCasing(/*lazyConfiguredProjectsFromExternalProject*/ false); + }); + + it("when lazyConfiguredProjectsFromExternalProject is set", () => { + verifyConfigFileCasing(/*lazyConfiguredProjectsFromExternalProject*/ true); + }); + }); + + it("remove not-listed external projects", () => { + const f1 = { + path: "/a/app.ts", + content: "let x = 1" + }; + const f2 = { + path: "/b/app.ts", + content: "let x = 1" + }; + const f3 = { + path: "/c/app.ts", + content: "let x = 1" + }; + const makeProject = (f: File) => ({ projectFileName: f.path + ".csproj", rootFiles: [toExternalFile(f.path)], options: {} }); + const p1 = makeProject(f1); + const p2 = makeProject(f2); + const p3 = makeProject(f3); + + const host = createServerHost([f1, f2, f3]); + const session = createSession(host); + + session.executeCommand({ + seq: 1, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p2] } + }); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p2.projectFileName); + + session.executeCommand({ + seq: 2, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p3] } + }); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p3.projectFileName); + + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [] } + }); + checkNumberOfProjects(projectService, { externalProjects: 0 }); + + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p2] } + }); + assert.equal(projectService.externalProjects[0].getProjectName(), p2.projectFileName); + }); + + it("should not close external project with no open files", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y =1;" + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + rootFiles: toExternalFiles([file1.path, file2.path]), + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + + // open client file - should not lead to creation of inferred project + projectService.openClientFile(file1.path, file1.content); + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + + // close client file - external project should still exists + projectService.closeClientFile(file1.path); + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + + projectService.closeExternalProject(externalProjectName); + checkNumberOfExternalProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 0); + }); + + it("external project for dynamic file", () => { + const externalProjectName = "^ScriptDocument1 file1.ts"; + const externalFiles = toExternalFiles(["^ScriptDocument1 file1.ts"]); + const host = createServerHost([]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + rootFiles: externalFiles, + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + + externalFiles[0].content = "let x =1;"; + projectService.applyChangesInOpenFiles(externalFiles, [], []); + }); + + it("external project that included config files", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f1.ts"] + } + ) + }; + const file2 = { + path: "/a/c/f2.ts", + content: "let y =1;" + }; + const config2 = { + path: "/a/c/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f2.ts"] + } + ) + }; + const file3 = { + path: "/a/d/f3.ts", + content: "let z =1;" + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2, file3, config1, config2]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + rootFiles: toExternalFiles([config1.path, config2.path, file3.path]), + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfProjects(projectService, { configuredProjects: 2 }); + const proj1 = projectService.configuredProjects.get(config1.path); + const proj2 = projectService.configuredProjects.get(config2.path); + assert.isDefined(proj1); + assert.isDefined(proj2); + + // open client file - should not lead to creation of inferred project + projectService.openClientFile(file1.path, file1.content); + checkNumberOfProjects(projectService, { configuredProjects: 2 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); + + projectService.openClientFile(file3.path, file3.content); + checkNumberOfProjects(projectService, { configuredProjects: 2, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); + + projectService.closeExternalProject(externalProjectName); + // open file 'file1' from configured project keeps project alive + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + + projectService.closeClientFile(file3.path); + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + + projectService.openClientFile(file2.path, file2.content); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.isUndefined(projectService.configuredProjects.get(config1.path)); + assert.isDefined(projectService.configuredProjects.get(config2.path)); + }); + + it("external project with included config file opened after configured project", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + projectService.openExternalProject({ + rootFiles: toExternalFiles([configFile.path]), + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + projectService.closeClientFile(file1.path); + // configured project is alive since it is opened as part of external project + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + projectService.closeExternalProject(externalProjectName); + checkNumberOfProjects(projectService, { configuredProjects: 0 }); + }); + + it("external project with included config file opened after configured project and then closed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/f2.ts", + content: "let x = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2, libFile, configFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path); + + projectService.openExternalProject({ + rootFiles: toExternalFiles([configFile.path]), + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + + projectService.closeExternalProject(externalProjectName); + // configured project is alive since file is still open + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + assert.isUndefined(projectService.configuredProjects.get(configFile.path)); + }); + + it("can correctly update external project when set of root files has changed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const host = createServerHost([file1, file2]); + const projectService = createProjectService(host); + + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path]) }); + checkNumberOfProjects(projectService, { externalProjects: 1 }); + checkProjectActualFiles(projectService.externalProjects[0], [file1.path]); + + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]) }); + checkNumberOfProjects(projectService, { externalProjects: 1 }); + checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); + }); + + it("can update external project when set of root files was not changed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export * from "m"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: "export let y = 1" + }; + const file3 = { + path: "/a/m.ts", + content: "export let y = 1" + }; + + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openExternalProject({ projectFileName: "project", options: { moduleResolution: ModuleResolutionKind.NodeJs }, rootFiles: toExternalFiles([file1.path, file2.path]) }); + checkNumberOfProjects(projectService, { externalProjects: 1 }); + checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); + checkProjectActualFiles(projectService.externalProjects[0], [file1.path, file2.path]); + + projectService.openExternalProject({ projectFileName: "project", options: { moduleResolution: ModuleResolutionKind.Classic }, rootFiles: toExternalFiles([file1.path, file2.path]) }); + checkNumberOfProjects(projectService, { externalProjects: 1 }); + checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); + checkProjectActualFiles(projectService.externalProjects[0], [file1.path, file2.path, file3.path]); + }); + + it("language service disabled state is updated in external projects", () => { + const f1 = { + path: "/a/app.js", + content: "var x = 1" + }; + const f2 = { + path: "/a/largefile.js", + content: "" + }; + const host = createServerHost([f1, f2]); + const originalGetFileSize = host.getFileSize; + host.getFileSize = (filePath: string) => + filePath === f2.path ? server.maxProgramSizeForNonTsFiles + 1 : originalGetFileSize.call(host, filePath); + + const service = createProjectService(host); + const projectFileName = "/a/proj.csproj"; + + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([f1.path, f2.path]), + options: {} + }); + service.checkNumberOfProjects({ externalProjects: 1 }); + assert.isFalse(service.externalProjects[0].languageServiceEnabled, "language service should be disabled - 1"); + + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([f1.path]), + options: {} + }); + service.checkNumberOfProjects({ externalProjects: 1 }); + assert.isTrue(service.externalProjects[0].languageServiceEnabled, "language service should be enabled"); + + service.openExternalProject({ + projectFileName, + rootFiles: toExternalFiles([f1.path, f2.path]), + options: {} + }); + service.checkNumberOfProjects({ externalProjects: 1 }); + assert.isFalse(service.externalProjects[0].languageServiceEnabled, "language service should be disabled - 2"); + }); + + describe("deleting config file opened from the external project works", () => { + function verifyDeletingConfigFile(lazyConfiguredProjectsFromExternalProject: boolean) { + const site = { + path: "/user/someuser/project/js/site.js", + content: "" + }; + const configFile = { + path: "/user/someuser/project/tsconfig.json", + content: "{}" + }; + const projectFileName = "/user/someuser/project/WebApplication6.csproj"; + const host = createServerHost([libFile, site, configFile]); + const projectService = createProjectService(host); + projectService.setHostConfiguration({ preferences: { lazyConfiguredProjectsFromExternalProject } }); + + const externalProject: protocol.ExternalProject = { + projectFileName, + rootFiles: [toExternalFile(site.path), toExternalFile(configFile.path)], + options: { allowJs: false }, + typeAcquisition: { include: [] } + }; + + projectService.openExternalProjects([externalProject]); + + let knownProjects = projectService.synchronizeProjectList([]); + checkNumberOfProjects(projectService, { configuredProjects: 1, externalProjects: 0, inferredProjects: 0 }); + + const configProject = configuredProjectAt(projectService, 0); + checkProjectActualFiles(configProject, lazyConfiguredProjectsFromExternalProject ? + emptyArray : // Since no files opened from this project, its not loaded + [configFile.path]); + + host.reloadFS([libFile, site]); + host.checkTimeoutQueueLengthAndRun(1); + + knownProjects = projectService.synchronizeProjectList(map(knownProjects, proj => proj.info!)); // TODO: GH#18217 GH#20039 + checkNumberOfProjects(projectService, { configuredProjects: 0, externalProjects: 0, inferredProjects: 0 }); + + externalProject.rootFiles.length = 1; + projectService.openExternalProjects([externalProject]); + + checkNumberOfProjects(projectService, { configuredProjects: 0, externalProjects: 1, inferredProjects: 0 }); + checkProjectActualFiles(projectService.externalProjects[0], [site.path, libFile.path]); + } + it("when lazyConfiguredProjectsFromExternalProject not set", () => { + verifyDeletingConfigFile(/*lazyConfiguredProjectsFromExternalProject*/ false); + }); + it("when lazyConfiguredProjectsFromExternalProject is set", () => { + verifyDeletingConfigFile(/*lazyConfiguredProjectsFromExternalProject*/ true); + }); + }); + describe("correctly handling add/remove tsconfig - 1", () => { function verifyAddRemoveConfig(lazyConfiguredProjectsFromExternalProject: boolean) { const f1 = { diff --git a/src/testRunner/unittests/tsserver/getApplicableRefactors.ts b/src/testRunner/unittests/tsserver/getApplicableRefactors.ts new file mode 100644 index 00000000000..1f9576e1d63 --- /dev/null +++ b/src/testRunner/unittests/tsserver/getApplicableRefactors.ts @@ -0,0 +1,12 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: getApplicableRefactors", () => { + it("works when taking position", () => { + const aTs: File = { path: "/a.ts", content: "" }; + const session = createSession(createServerHost([aTs])); + openFilesForSession([aTs], session); + const response = executeSessionRequest( + session, protocol.CommandTypes.GetApplicableRefactors, { file: aTs.path, line: 1, offset: 1 }); + assert.deepEqual | undefined>(response, []); + }); + }); +} diff --git a/src/testRunner/unittests/tsserver/inferredProjects.ts b/src/testRunner/unittests/tsserver/inferredProjects.ts index 47e871efb82..9d7ccaa1224 100644 --- a/src/testRunner/unittests/tsserver/inferredProjects.ts +++ b/src/testRunner/unittests/tsserver/inferredProjects.ts @@ -1,5 +1,125 @@ namespace ts.projectSystem { describe("unittests:: tsserver:: Inferred projects", () => { + it("create inferred project", () => { + const appFile: File = { + path: "/a/b/c/app.ts", + content: ` + import {f} from "./module" + console.log(f) + ` + }; + + const moduleFile: File = { + path: "/a/b/c/module.d.ts", + content: `export let x: number` + }; + const host = createServerHost([appFile, moduleFile, libFile]); + const projectService = createProjectService(host); + const { configFileName } = projectService.openClientFile(appFile.path); + + assert(!configFileName, `should not find config, got: '${configFileName}`); + checkNumberOfConfiguredProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 1); + + const project = projectService.inferredProjects[0]; + + checkArray("inferred project", project.getFileNames(), [appFile.path, libFile.path, moduleFile.path]); + const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; + const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); + checkWatchedFiles(host, configFiles.concat(libFile.path, moduleFile.path)); + checkWatchedDirectories(host, ["/a/b/c"], /*recursive*/ false); + checkWatchedDirectories(host, [combinePaths(getDirectoryPath(appFile.path), nodeModulesAtTypes)], /*recursive*/ true); + }); + + it("should use only one inferred project if 'useOneInferredProject' is set", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const file2 = { + path: "/a/c/main.ts", + content: "let x =1;" + }; + + const file3 = { + path: "/a/d/main.ts", + content: "let x =1;" + }; + + const host = createServerHost([file1, file2, file3, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + projectService.openClientFile(file2.path); + projectService.openClientFile(file3.path); + + checkNumberOfConfiguredProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path, libFile.path]); + + + host.reloadFS([file1, configFile, file2, file3, libFile]); + host.checkTimeoutQueueLengthAndRun(2); // load configured project from disk + ensureProjectsForOpenFiles + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path, file3.path, libFile.path]); + }); + + it("disable inferred project", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + + const host = createServerHost([file1]); + const projectService = createProjectService(host, { useSingleInferredProject: true }, { syntaxOnly: true }); + + projectService.openClientFile(file1.path, file1.content); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const proj = projectService.inferredProjects[0]; + assert.isDefined(proj); + + assert.isFalse(proj.languageServiceEnabled); + }); + + it("project settings for inferred projects", () => { + const file1 = { + path: "/a/b/app.ts", + content: `import {x} from "mod"` + }; + const modFile = { + path: "/a/mod.ts", + content: "export let x: number" + }; + const host = createServerHost([file1, modFile]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + projectService.openClientFile(modFile.path); + + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + const inferredProjects = projectService.inferredProjects.slice(); + checkProjectActualFiles(inferredProjects[0], [file1.path]); + checkProjectActualFiles(inferredProjects[1], [modFile.path]); + + projectService.setCompilerOptionsForInferredProjects({ moduleResolution: ModuleResolutionKind.Classic }); + host.checkTimeoutQueueLengthAndRun(3); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProjects[0]); + assert.strictEqual(projectService.inferredProjects[1], inferredProjects[1]); + checkProjectActualFiles(inferredProjects[0], [file1.path, modFile.path]); + assert.isTrue(inferredProjects[1].isOrphan()); + }); + it("should support files without extensions", () => { const f = { path: "/a/compile", diff --git a/src/testRunner/unittests/tsserver/projects.ts b/src/testRunner/unittests/tsserver/projects.ts new file mode 100644 index 00000000000..00941a1d3c9 --- /dev/null +++ b/src/testRunner/unittests/tsserver/projects.ts @@ -0,0 +1,1426 @@ +namespace ts.projectSystem { + describe("unittests:: tsserver:: Projects", () => { + it("handles the missing files - that were added to program because they were added with /// { + const file1: File = { + path: "/a/b/commonFile1.ts", + content: `/// + let x = y` + }; + const host = createServerHost([file1, libFile]); + const session = createSession(host); + openFilesForSession([file1], session); + const projectService = session.getProjectService(); + + checkNumberOfInferredProjects(projectService, 1); + const project = projectService.inferredProjects[0]; + checkProjectRootFiles(project, [file1.path]); + checkProjectActualFiles(project, [file1.path, libFile.path]); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); + + // Two errors: CommonFile2 not found and cannot find name y + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_name_0, errorTextArguments: ["y"] }, + { diagnosticMessage: Diagnostics.File_0_not_found, errorTextArguments: [commonFile2.path] } + ]); + + host.reloadFS([file1, commonFile2, libFile]); + host.runQueuedTimeoutCallbacks(); + checkNumberOfInferredProjects(projectService, 1); + assert.strictEqual(projectService.inferredProjects[0], project, "Inferred project should be same"); + checkProjectRootFiles(project, [file1.path]); + checkProjectActualFiles(project, [file1.path, libFile.path, commonFile2.path]); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); + + it("should create new inferred projects for files excluded from a configured project", () => { + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }` + }; + const files = [commonFile1, commonFile2, configFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + configFile.content = `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}"] + }`; + host.reloadFS(files); + + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + host.checkTimeoutQueueLengthAndRun(2); // Update the configured project + refresh inferred projects + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(project, [commonFile1.path]); + + projectService.openClientFile(commonFile2.path); + checkNumberOfInferredProjects(projectService, 1); + }); + + it("should disable features when the files are too large", () => { + const file1 = { + path: "/a/b/f1.js", + content: "let x =1;", + fileSize: 10 * 1024 * 1024 + }; + const file2 = { + path: "/a/b/f2.js", + content: "let y =1;", + fileSize: 6 * 1024 * 1024 + }; + const file3 = { + path: "/a/b/f3.js", + content: "let y =1;", + fileSize: 6 * 1024 * 1024 + }; + + const proj1name = "proj1", proj2name = "proj2", proj3name = "proj3"; + + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openExternalProject({ rootFiles: toExternalFiles([file1.path]), options: {}, projectFileName: proj1name }); + const proj1 = projectService.findProject(proj1name)!; + assert.isTrue(proj1.languageServiceEnabled); + + projectService.openExternalProject({ rootFiles: toExternalFiles([file2.path]), options: {}, projectFileName: proj2name }); + const proj2 = projectService.findProject(proj2name)!; + assert.isTrue(proj2.languageServiceEnabled); + + projectService.openExternalProject({ rootFiles: toExternalFiles([file3.path]), options: {}, projectFileName: proj3name }); + const proj3 = projectService.findProject(proj3name)!; + assert.isFalse(proj3.languageServiceEnabled); + }); + + describe("ignoreConfigFiles", () => { + it("external project including config file", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f1.ts"] + } + ) + }; + + const externalProjectName = "externalproject"; + const host = createServerHost([file1, config1]); + const projectService = createProjectService(host, { useSingleInferredProject: true }, { syntaxOnly: true }); + projectService.openExternalProject({ + rootFiles: toExternalFiles([file1.path, config1.path]), + options: {}, + projectFileName: externalProjectName + }); + + checkNumberOfProjects(projectService, { externalProjects: 1 }); + const proj = projectService.externalProjects[0]; + assert.isDefined(proj); + + assert.isTrue(proj.fileExists(file1.path)); + }); + + it("loose file included in config file (openClientFile)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f1.ts"] + } + ) + }; + + const host = createServerHost([file1, config1]); + const projectService = createProjectService(host, { useSingleInferredProject: true }, { syntaxOnly: true }); + projectService.openClientFile(file1.path, file1.content); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const proj = projectService.inferredProjects[0]; + assert.isDefined(proj); + + assert.isTrue(proj.fileExists(file1.path)); + }); + + it("loose file included in config file (applyCodeChanges)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f1.ts"] + } + ) + }; + + const host = createServerHost([file1, config1]); + const projectService = createProjectService(host, { useSingleInferredProject: true }, { syntaxOnly: true }); + projectService.applyChangesInOpenFiles([{ fileName: file1.path, content: file1.content }], [], []); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const proj = projectService.inferredProjects[0]; + assert.isDefined(proj); + + assert.isTrue(proj.fileExists(file1.path)); + }); + }); + + it("reload regular file after closing", () => { + const f1 = { + path: "/a/b/app.ts", + content: "x." + }; + const f2 = { + path: "/a/b/lib.ts", + content: "let x: number;" + }; + + const host = createServerHost([f1, f2, libFile]); + const service = createProjectService(host); + service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: toExternalFiles([f1.path, f2.path]), options: {} }); + + service.openClientFile(f1.path); + service.openClientFile(f2.path, "let x: string"); + + service.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, libFile.path]); + + const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, emptyOptions)!; + // should contain completions for string + assert.isTrue(completions1.entries.some(e => e.name === "charAt"), "should contain 'charAt'"); + assert.isFalse(completions1.entries.some(e => e.name === "toExponential"), "should not contain 'toExponential'"); + + service.closeClientFile(f2.path); + const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, emptyOptions)!; + // should contain completions for string + assert.isFalse(completions2.entries.some(e => e.name === "charAt"), "should not contain 'charAt'"); + assert.isTrue(completions2.entries.some(e => e.name === "toExponential"), "should contain 'toExponential'"); + }); + + it("clear mixed content file after closing", () => { + const f1 = { + path: "/a/b/app.ts", + content: " " + }; + const f2 = { + path: "/a/b/lib.html", + content: "" + }; + + const host = createServerHost([f1, f2, libFile]); + const service = createProjectService(host); + service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: [{ fileName: f1.path }, { fileName: f2.path, hasMixedContent: true }], options: {} }); + + service.openClientFile(f1.path); + service.openClientFile(f2.path, "let somelongname: string"); + + service.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, libFile.path]); + + const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, emptyOptions)!; + assert.isTrue(completions1.entries.some(e => e.name === "somelongname"), "should contain 'somelongname'"); + + service.closeClientFile(f2.path); + const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, emptyOptions)!; + assert.isFalse(completions2.entries.some(e => e.name === "somelongname"), "should not contain 'somelongname'"); + const sf2 = service.externalProjects[0].getLanguageService().getProgram()!.getSourceFile(f2.path)!; + assert.equal(sf2.text, ""); + }); + + it("changes in closed files are reflected in project structure", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export * from "./f2"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: `export let x = 1` + }; + const file3 = { + path: "/a/c/f3.ts", + content: `export let y = 1;` + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const inferredProject0 = projectService.inferredProjects[0]; + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path]); + + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProject0); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path]); + const inferredProject1 = projectService.inferredProjects[1]; + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + + const modifiedFile2 = { + path: file2.path, + content: `export * from "../c/f3"` // now inferred project should inclule file3 + }; + + host.reloadFS([file1, modifiedFile2, file3]); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProject0); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, modifiedFile2.path, file3.path]); + assert.strictEqual(projectService.inferredProjects[1], inferredProject1); + assert.isTrue(inferredProject1.isOrphan()); + }); + + it("deleted files affect project structure", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export * from "./f2"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: `export * from "../c/f3"` + }; + const file3 = { + path: "/a/c/f3.ts", + content: `export let y = 1;` + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); + + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + + host.reloadFS([file1, file3]); + host.checkTimeoutQueueLengthAndRun(2); + + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + }); + + it("ignores files excluded by a custom safe type list", () => { + const file1 = { + path: "/a/b/f1.js", + content: "export let x = 5" + }; + const office = { + path: "/lib/duckquack-3.min.js", + content: "whoa do @@ not parse me ok thanks!!!" + }; + const host = createServerHost([file1, office, customTypesMap]); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, office.path]) }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); + assert.deepEqual(proj.getTypeAcquisition().include, ["duck-types"]); + } finally { + projectService.resetSafeList(); + } + }); + + it("file with name constructor.js doesnt cause issue with typeAcquisition when safe type list", () => { + const file1 = { + path: "/a/b/f1.js", + content: `export let x = 5; import { s } from "s"` + }; + const constructorFile = { + path: "/a/b/constructor.js", + content: "const x = 10;" + }; + const bliss = { + path: "/a/b/bliss.js", + content: "export function is() { return true; }" + }; + const host = createServerHost([file1, libFile, constructorFile, bliss, customTypesMap]); + let request: string | undefined; + const cachePath = "/a/data"; + const typingsInstaller: server.ITypingsInstaller = { + isKnownTypesPackageName: returnFalse, + installPackage: notImplemented, + inspectValue: notImplemented, + enqueueInstallTypingsRequest: (proj, typeAcquisition, unresolvedImports) => { + assert.isUndefined(request); + request = JSON.stringify(server.createInstallTypingsRequest(proj, typeAcquisition, unresolvedImports || server.emptyArray, cachePath)); + }, + attach: noop, + onProjectClosed: noop, + globalTypingsCacheLocation: cachePath + }; + + const projectName = "project"; + const projectService = createProjectService(host, { typingsInstaller }); + projectService.openExternalProject({ projectFileName: projectName, options: {}, rootFiles: toExternalFiles([file1.path, constructorFile.path, bliss.path]) }); + assert.equal(request, JSON.stringify({ + projectName, + fileNames: [libFile.path, file1.path, constructorFile.path, bliss.path], + compilerOptions: { allowNonTsExtensions: true, noEmitForJsFiles: true }, + typeAcquisition: { include: ["blissfuljs"], exclude: [], enable: true }, + unresolvedImports: ["s"], + projectRootPath: "/", + cachePath, + kind: "discover" + })); + const response = JSON.parse(request!); + request = undefined; + projectService.updateTypingsForProject({ + kind: "action::set", + projectName: response.projectName, + typeAcquisition: response.typeAcquisition, + compilerOptions: response.compilerOptions, + typings: emptyArray, + unresolvedImports: response.unresolvedImports, + }); + + host.checkTimeoutQueueLengthAndRun(2); + assert.isUndefined(request); + }); + + it("ignores files excluded by the default type list", () => { + const file1 = { + path: "/a/b/f1.js", + content: "export let x = 5" + }; + const minFile = { + path: "/c/moment.min.js", + content: "unspecified" + }; + const kendoFile1 = { + path: "/q/lib/kendo/kendo.all.min.js", + content: "unspecified" + }; + const kendoFile2 = { + path: "/q/lib/kendo/kendo.ui.min.js", + content: "unspecified" + }; + const kendoFile3 = { + path: "/q/lib/kendo-ui/kendo.all.js", + content: "unspecified" + }; + const officeFile1 = { + path: "/scripts/Office/1/excel-15.debug.js", + content: "unspecified" + }; + const officeFile2 = { + path: "/scripts/Office/1/powerpoint.js", + content: "unspecified" + }; + const files = [file1, minFile, kendoFile1, kendoFile2, kendoFile3, officeFile1, officeFile2]; + const host = createServerHost(files); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles(files.map(f => f.path)) }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); + assert.deepEqual(proj.getTypeAcquisition().include, ["kendo-ui", "office"]); + } finally { + projectService.resetSafeList(); + } + }); + + it("removes version numbers correctly", () => { + const testData: [string, string][] = [ + ["jquery-max", "jquery-max"], + ["jquery.min", "jquery"], + ["jquery-min.4.2.3", "jquery"], + ["jquery.min.4.2.1", "jquery"], + ["minimum", "minimum"], + ["min", "min"], + ["min.3.2", "min"], + ["jquery", "jquery"] + ]; + for (const t of testData) { + assert.equal(removeMinAndVersionNumbers(t[0]), t[1], t[0]); + } + }); + + it("ignores files excluded by a legacy safe type list", () => { + const file1 = { + path: "/a/b/bliss.js", + content: "let x = 5" + }; + const file2 = { + path: "/a/b/foo.js", + content: "" + }; + const file3 = { + path: "/a/b/Bacon.js", + content: "let y = 5" + }; + const host = createServerHost([file1, file2, file3, customTypesMap]); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]), typeAcquisition: { enable: true } }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(), [file2.path]); + } finally { + projectService.resetSafeList(); + } + }); + + it("correctly migrate files between projects", () => { + const file1 = { + path: "/a/b/f1.ts", + content: ` + export * from "../c/f2"; + export * from "../d/f3";` + }; + const file2 = { + path: "/a/c/f2.ts", + content: "export let x = 1;" + }; + const file3 = { + path: "/a/d/f3.ts", + content: "export let y = 1;" + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); + + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); + let inferredProjects = projectService.inferredProjects.slice(); + + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProjects[0]); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + inferredProjects = projectService.inferredProjects.slice(); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + assert.notStrictEqual(projectService.inferredProjects[0], inferredProjects[0]); + assert.notStrictEqual(projectService.inferredProjects[0], inferredProjects[1]); + checkProjectRootFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); + inferredProjects = projectService.inferredProjects.slice(); + + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 3 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProjects[0]); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]); + checkProjectActualFiles(projectService.inferredProjects[2], [file3.path]); + inferredProjects = projectService.inferredProjects.slice(); + + projectService.closeClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 3 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProjects[0]); + assert.strictEqual(projectService.inferredProjects[1], inferredProjects[1]); + assert.strictEqual(projectService.inferredProjects[2], inferredProjects[2]); + assert.isTrue(projectService.inferredProjects[0].isOrphan()); + checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]); + assert.isTrue(projectService.inferredProjects[2].isOrphan()); + + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + assert.strictEqual(projectService.inferredProjects[0], inferredProjects[2]); + assert.strictEqual(projectService.inferredProjects[1], inferredProjects[1]); + checkProjectActualFiles(projectService.inferredProjects[0], [file3.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]); + }); + + it("regression test for crash in acquireOrUpdateDocument", () => { + const tsFile = { + fileName: "/a/b/file1.ts", + path: "/a/b/file1.ts", + content: "" + }; + const jsFile = { + path: "/a/b/file1.js", + content: "var x = 10;", + fileName: "/a/b/file1.js", + scriptKind: "JS" as "JS" + }; + + const host = createServerHost([]); + const projectService = createProjectService(host); + projectService.applyChangesInOpenFiles([tsFile], [], []); + const projs = projectService.synchronizeProjectList([]); + projectService.findProject(projs[0].info!.projectName)!.getLanguageService().getNavigationBarItems(tsFile.fileName); + projectService.synchronizeProjectList([projs[0].info!]); + projectService.applyChangesInOpenFiles([jsFile], [], []); + }); + + it("config file is deleted", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1;" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 2;" + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + const host = createServerHost([file1, file2, config]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); + + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); + + host.reloadFS([file1, file2]); + host.checkTimeoutQueueLengthAndRun(1); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]); + }); + + it("loading files with correct priority", () => { + const f1 = { + path: "/a/main.ts", + content: "let x = 1" + }; + const f2 = { + path: "/a/main.js", + content: "var y = 1" + }; + const config = { + path: "/a/tsconfig.json", + content: JSON.stringify({ + compilerOptions: { allowJs: true } + }) + }; + const host = createServerHost([f1, f2, config]); + const projectService = createProjectService(host); + projectService.setHostConfiguration({ + extraFileExtensions: [ + { extension: ".js", isMixedContent: false }, + { extension: ".html", isMixedContent: true } + ] + }); + projectService.openClientFile(f1.path); + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, config.path]); + + // Should close configured project with next file open + projectService.closeClientFile(f1.path); + + projectService.openClientFile(f2.path); + projectService.checkNumberOfProjects({ inferredProjects: 1 }); + assert.isUndefined(projectService.configuredProjects.get(config.path)); + checkProjectActualFiles(projectService.inferredProjects[0], [f2.path]); + }); + + it("tsconfig script block support", () => { + const file1 = { + path: "/a/b/f1.ts", + content: ` ` + }; + const file2 = { + path: "/a/b/f2.html", + content: `var hello = "hello";` + }; + const config = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true } }) + }; + const host = createServerHost([file1, file2, config]); + const session = createSession(host); + openFilesForSession([file1], session); + const projectService = session.getProjectService(); + + // HTML file will not be included in any projects yet + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const configuredProj = configuredProjectAt(projectService, 0); + checkProjectActualFiles(configuredProj, [file1.path, config.path]); + + // Specify .html extension as mixed content + const extraFileExtensions = [{ extension: ".html", scriptKind: ScriptKind.JS, isMixedContent: true }]; + const configureHostRequest = makeSessionRequest(CommandNames.Configure, { extraFileExtensions }); + session.executeCommand(configureHostRequest); + + // The configured project should now be updated to include html file + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(configuredProjectAt(projectService, 0), configuredProj, "Same configured project should be updated"); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); + + // Open HTML file + projectService.applyChangesInOpenFiles( + /*openFiles*/[{ fileName: file2.path, hasMixedContent: true, scriptKind: ScriptKind.JS, content: `var hello = "hello";` }], + /*changedFiles*/ undefined, + /*closedFiles*/ undefined); + + // Now HTML file is included in the project + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); + + // Check identifiers defined in HTML content are available in .ts file + const project = configuredProjectAt(projectService, 0); + let completions = project.getLanguageService().getCompletionsAtPosition(file1.path, 1, emptyOptions); + assert(completions && completions.entries[0].name === "hello", `expected entry hello to be in completion list`); + + // Close HTML file + projectService.applyChangesInOpenFiles( + /*openFiles*/ undefined, + /*changedFiles*/ undefined, + /*closedFiles*/[file2.path]); + + // HTML file is still included in project + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); + + // Check identifiers defined in HTML content are not available in .ts file + completions = project.getLanguageService().getCompletionsAtPosition(file1.path, 5, emptyOptions); + assert(completions && completions.entries[0].name !== "hello", `unexpected hello entry in completion list`); + }); + + it("no tsconfig script block diagnostic errors", () => { + + // #1. Ensure no diagnostic errors when allowJs is true + const file1 = { + path: "/a/b/f1.ts", + content: ` ` + }; + const file2 = { + path: "/a/b/f2.html", + content: `var hello = "hello";` + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true } }) + }; + + let host = createServerHost([file1, file2, config1, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); + let session = createSession(host); + + // Specify .html extension as mixed content in a configure host request + const extraFileExtensions = [{ extension: ".html", scriptKind: ScriptKind.JS, isMixedContent: true }]; + const configureHostRequest = makeSessionRequest(CommandNames.Configure, { extraFileExtensions }); + session.executeCommand(configureHostRequest); + + openFilesForSession([file1], session); + let projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + let diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + + // #2. Ensure no errors when allowJs is false + const config2 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: false } }) + }; + + host = createServerHost([file1, file2, config2, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); + session = createSession(host); + + session.executeCommand(configureHostRequest); + + openFilesForSession([file1], session); + projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + + // #3. Ensure no errors when compiler options aren't specified + const config3 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({}) + }; + + host = createServerHost([file1, file2, config3, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); + session = createSession(host); + + session.executeCommand(configureHostRequest); + + openFilesForSession([file1], session); + projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + + // #4. Ensure no errors when files are explicitly specified in tsconfig + const config4 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true }, files: [file1.path, file2.path] }) + }; + + host = createServerHost([file1, file2, config4, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); + session = createSession(host); + + session.executeCommand(configureHostRequest); + + openFilesForSession([file1], session); + projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + + // #4. Ensure no errors when files are explicitly excluded in tsconfig + const config5 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: { allowJs: true }, exclude: [file2.path] }) + }; + + host = createServerHost([file1, file2, config5, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); + session = createSession(host); + + session.executeCommand(configureHostRequest); + + openFilesForSession([file1], session); + projectService = session.getProjectService(); + + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + + diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); + assert.deepEqual(diagnostics, []); + }); + + it("project structure update is deferred if files are not added\removed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `import {x} from "./f2"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: "export let x = 1" + }; + const host = createServerHost([file1, file2]); + const projectService = createProjectService(host); + + projectService.openClientFile(file1.path); + projectService.openClientFile(file2.path); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + projectService.applyChangesInOpenFiles( + /*openFiles*/ undefined, + /*changedFiles*/[{ fileName: file1.path, changes: [{ span: createTextSpan(0, file1.path.length), newText: "let y = 1" }] }], + /*closedFiles*/ undefined); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + projectService.ensureInferredProjectsUpToDate_TestOnly(); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + }); + + it("files with mixed content are handled correctly", () => { + const file1 = { + path: "/a/b/f1.html", + content: `