From e7895c59d43c9a088834de81446bd2fe7c078844 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 14 Apr 2015 15:05:08 -0700 Subject: [PATCH 01/13] Move commonSourceDirectory computation to its own function --- src/compiler/program.ts | 86 ++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 46466478029..64090f76344 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -453,6 +453,51 @@ module ts { } } + function computecommonSourceDirectory(sourceFiles: SourceFile[]): string { + let commonPathComponents: string[]; + forEach(files, sourceFile => { + // Each file contributes into common source file path + if (!(sourceFile.flags & NodeFlags.DeclarationFile) + && !fileExtensionIs(sourceFile.fileName, ".js")) { + let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); + sourcePathComponents.pop(); // FileName is not part of directory + if (commonPathComponents) { + for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + + // New common path found that is 0 -> i-1 + commonPathComponents.length = i; + break; + } + } + + // If the fileComponent path completely matched and less than already found update the length + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + } + else { + // first file + commonPathComponents = sourcePathComponents; + } + } + }); + + let commonSourceDirectory = getNormalizedPathFromPathComponents(commonPathComponents); + if (commonSourceDirectory) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path + commonSourceDirectory += directorySeparator; + } + + return commonSourceDirectory; + } + function verifyCompilerOptions() { if (options.separateCompilation) { if (options.sourceMap) { @@ -515,46 +560,7 @@ module ts { (options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated (!options.out || firstExternalModuleSourceFile !== undefined))) { - let commonPathComponents: string[]; - forEach(files, sourceFile => { - // Each file contributes into common source file path - if (!(sourceFile.flags & NodeFlags.DeclarationFile) - && !fileExtensionIs(sourceFile.fileName, ".js")) { - let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); // FileName is not part of directory - if (commonPathComponents) { - for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; - } - } - - // If the fileComponent path completely matched and less than already found update the length - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - // first file - commonPathComponents = sourcePathComponents; - } - } - }); - - commonSourceDirectory = getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { - // Make sure directory path ends with directory separator so this string can directly - // used to replace with "" to get the relative path of the source file and the relative path doesn't - // start with / making it rooted path - commonSourceDirectory += directorySeparator; - } + commonSourceDirectory = computecommonSourceDirectory(files); } if (options.noEmit) { From 261adffe50128708172c2185763fa856383c99d6 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 14 Apr 2015 22:11:25 -0700 Subject: [PATCH 02/13] Add rootDir option --- src/compiler/commandLineParser.ts | 7 ++ .../diagnosticInformationMap.generated.ts | 2 + src/compiler/diagnosticMessages.json | 9 ++ src/compiler/program.ts | 87 ++++++++++++------- src/compiler/types.ts | 1 + src/harness/projectsRunner.ts | 5 +- 6 files changed, 81 insertions(+), 30 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 8169421ca17..47f0594a76e 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -110,6 +110,13 @@ module ts { type: "boolean", description: Diagnostics.Do_not_emit_comments_to_output, }, + { + name: "rootDir", + type: "string", + isFilePath: true, + description: Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + paramType: Diagnostics.LOCATION, + }, { name: "separateCompilation", type: "boolean", diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 0271ac73105..7c9d9b56c63 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -495,6 +495,8 @@ module ts { Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, + File_0_is_not_under_rootDir_1_RootDir_is_expected_to_contain_all_source_files: { code: 6059, category: DiagnosticCategory.Error, key: "File '{0}' is not under rootDir '{1}'. RootDir is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 063a0d50ef5..31fc9090a6f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1968,6 +1968,15 @@ "category": "Message", "code": 6057 }, + "Specifies the root directory of input files. Use to control the output directory structure with --outDir.": { + "category": "Message", + "code": 6058 + }, + "File '{0}' is not under rootDir '{1}'. RootDir is expected to contain all source files.": { + "category": "Error", + "code": 6059 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 64090f76344..e3fe08d04eb 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -455,47 +455,62 @@ module ts { function computecommonSourceDirectory(sourceFiles: SourceFile[]): string { let commonPathComponents: string[]; + let currentDirectory = host.getCurrentDirectory(); forEach(files, sourceFile => { // Each file contributes into common source file path - if (!(sourceFile.flags & NodeFlags.DeclarationFile) - && !fileExtensionIs(sourceFile.fileName, ".js")) { - let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); // FileName is not part of directory - if (commonPathComponents) { - for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } + if (isDeclarationFile(sourceFile)) { + return; + } - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; + let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + sourcePathComponents.pop(); // FileName is not part of directory + if (commonPathComponents) { + for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; } - } - // If the fileComponent path completely matched and less than already found update the length - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; + // New common path found that is 0 -> i-1 + commonPathComponents.length = i; + break; } } - else { - // first file - commonPathComponents = sourcePathComponents; + + // If the fileComponent path completely matched and less than already found update the length + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; } } + else { + // first file + commonPathComponents = sourcePathComponents; + } + }); - let commonSourceDirectory = getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { - // Make sure directory path ends with directory separator so this string can directly - // used to replace with "" to get the relative path of the source file and the relative path doesn't - // start with / making it rooted path - commonSourceDirectory += directorySeparator; + return getNormalizedPathFromPathComponents(commonPathComponents); + } + + function checkSourceFilesBelongToPath(soruceFiles: SourceFile[], rootDirectory: string): boolean { + let allFilesBelongToPath = true; + if (files) { + let currentDirectory = host.getCurrentDirectory(); + let absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + + for (var sourceFile of files) { + if (!isDeclarationFile(sourceFile)) { + let absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_RootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + allFilesBelongToPath = false; + } + } + } } - return commonSourceDirectory; + return allFilesBelongToPath; } function verifyCompilerOptions() { @@ -560,7 +575,21 @@ module ts { (options.mapRoot && // there is --mapRoot specified and there would be multiple js files generated (!options.out || firstExternalModuleSourceFile !== undefined))) { - commonSourceDirectory = computecommonSourceDirectory(files); + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + // If a rootDir is specified and is valid use it as the commonSourceDirectory + commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); + } + else { + // Compute the commonSourceDirectory from the input files + commonSourceDirectory = computecommonSourceDirectory(files); + } + + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { + // Make sure directory path ends with directory separator so this string can directly + // used to replace with "" to get the relative path of the source file and the relative path doesn't + // start with / making it rooted path + commonSourceDirectory += directorySeparator; + } } if (options.noEmit) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 43c210331a5..0e7c089cc27 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1648,6 +1648,7 @@ module ts { preserveConstEnums?: boolean; project?: string; removeComments?: boolean; + rootDir?: string; sourceMap?: boolean; sourceRoot?: string; suppressImplicitAnyIndexErrors?: boolean; diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 3291128a7a5..6823bfafac2 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -18,6 +18,7 @@ interface ProjectRunnerTestCase { runTest?: boolean; // Run the resulting test bug?: string; // If there is any bug associated with this test case noResolve?: boolean; + rootDir?: string; // --rootDir } interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { @@ -160,7 +161,8 @@ class ProjectRunner extends RunnerBase { mapRoot: testCase.resolveMapRoot && testCase.mapRoot ? ts.sys.resolvePath(testCase.mapRoot) : testCase.mapRoot, sourceRoot: testCase.resolveSourceRoot && testCase.sourceRoot ? ts.sys.resolvePath(testCase.sourceRoot) : testCase.sourceRoot, module: moduleKind, - noResolve: testCase.noResolve + noResolve: testCase.noResolve, + rootDir: testCase.rootDir }; } @@ -344,6 +346,7 @@ class ProjectRunner extends RunnerBase { baselineCheck: testCase.baselineCheck, runTest: testCase.runTest, bug: testCase.bug, + rootDir: testCase.rootDir, resolvedInputFiles: ts.map(compilerResult.program.getSourceFiles(), inputFile => inputFile.fileName), emittedFiles: ts.map(compilerResult.outputFiles, outputFile => outputFile.emittedFileName) }; From 99c0adbc2adba8d1b74f761d117ba73dfed9519e Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 14 Apr 2015 22:19:59 -0700 Subject: [PATCH 03/13] Add rootDir tests --- .../outdir/simple/FolderB/FolderC/fileC.d.ts | 2 + .../outdir/simple/FolderB/FolderC/fileC.js | 5 + .../simple/FolderB/FolderC/fileC.js.map | 1 + .../amd/outdir/simple/FolderB/fileB.d.ts | 4 + .../amd/outdir/simple/FolderB/fileB.js | 6 + .../amd/outdir/simple/FolderB/fileB.js.map | 1 + .../rootDirectory/amd/rootDirectory.json | 22 ++++ .../amd/rootDirectory.sourcemap.txt | 123 ++++++++++++++++++ .../outdir/simple/FolderB/FolderC/fileC.d.ts | 2 + .../outdir/simple/FolderB/FolderC/fileC.js | 5 + .../simple/FolderB/FolderC/fileC.js.map | 1 + .../node/outdir/simple/FolderB/fileB.d.ts | 4 + .../node/outdir/simple/FolderB/fileB.js | 6 + .../node/outdir/simple/FolderB/fileB.js.map | 1 + .../rootDirectory/node/rootDirectory.json | 22 ++++ .../node/rootDirectory.sourcemap.txt | 123 ++++++++++++++++++ .../amd/outdir/simple/FolderC/fileC.d.ts | 2 + .../amd/outdir/simple/FolderC/fileC.js | 5 + .../amd/outdir/simple/fileB.d.ts | 4 + .../amd/outdir/simple/fileB.js | 6 + .../amd/rootDirectoryErrors.errors.txt | 14 ++ .../amd/rootDirectoryErrors.json | 22 ++++ .../node/outdir/simple/FolderC/fileC.d.ts | 2 + .../node/outdir/simple/FolderC/fileC.js | 5 + .../node/outdir/simple/fileB.d.ts | 4 + .../node/outdir/simple/fileB.js | 6 + .../node/rootDirectoryErrors.errors.txt | 14 ++ .../node/rootDirectoryErrors.json | 22 ++++ .../outdir/simple/FolderB/FolderC/fileC.js | 6 + .../simple/FolderB/FolderC/fileC.js.map | 1 + .../amd/outdir/simple/FolderB/fileB.js | 7 + .../amd/outdir/simple/FolderB/fileB.js.map | 1 + .../amd/rootDirectoryWithSourceRoot.json | 23 ++++ .../rootDirectoryWithSourceRoot.sourcemap.txt | 123 ++++++++++++++++++ .../outdir/simple/FolderB/FolderC/fileC.js | 6 + .../simple/FolderB/FolderC/fileC.js.map | 1 + .../node/outdir/simple/FolderB/fileB.js | 7 + .../node/outdir/simple/FolderB/fileB.js.map | 1 + .../node/rootDirectoryWithSourceRoot.json | 23 ++++ .../rootDirectoryWithSourceRoot.sourcemap.txt | 123 ++++++++++++++++++ tests/cases/project/rootDirectory.json | 12 ++ tests/cases/project/rootDirectoryErrors.json | 11 ++ .../project/rootDirectoryWithSourceRoot.json | 12 ++ .../FolderA/FolderB/FolderC/fileC.ts | 2 + .../rootDirectory/FolderA/FolderB/fileB.ts | 4 + 45 files changed, 797 insertions(+) create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map create mode 100644 tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json create mode 100644 tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map create mode 100644 tests/baselines/reference/project/rootDirectory/node/rootDirectory.json create mode 100644 tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt create mode 100644 tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json create mode 100644 tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt create mode 100644 tests/cases/project/rootDirectory.json create mode 100644 tests/cases/project/rootDirectoryErrors.json create mode 100644 tests/cases/project/rootDirectoryWithSourceRoot.json create mode 100644 tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts create mode 100644 tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts new file mode 100644 index 00000000000..8147620b211 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.d.ts @@ -0,0 +1,2 @@ +declare class C { +} diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js new file mode 100644 index 00000000000..325ac60ee32 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js @@ -0,0 +1,5 @@ +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map new file mode 100644 index 00000000000..de54805ee54 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts new file mode 100644 index 00000000000..4ff813c3839 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.d.ts @@ -0,0 +1,4 @@ +/// +declare class B { + c: C; +} diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js new file mode 100644 index 00000000000..99199ca1742 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js @@ -0,0 +1,6 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map new file mode 100644 index 00000000000..d1c844d3247 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json new file mode 100644 index 00000000000..111f0277ec1 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "rootDirectory: specify rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "rootDir": "FolderA", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js", + "outdir/simple/FolderB/FolderC/fileC.d.ts", + "outdir/simple/FolderB/fileB.js", + "outdir/simple/FolderB/fileB.d.ts" + ] +} \ 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 new file mode 100644 index 00000000000..83ee3b40181 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.sourcemap.txt @@ -0,0 +1,123 @@ +=================================================================== +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) name (C) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class C { + > +2 > } +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor) +2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor) +--- +>>> return C; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class C { + > } +1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C) +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 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +--- +>>>var B = (function () { +>>> function B() { +1 >^^^^ +2 > ^^-> +1 > + > +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class B { + > public c: C; + > +2 > } +1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor) +--- +>>> return B; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class B { + > public c: C; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B) +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/outdir/simple/FolderB/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts new file mode 100644 index 00000000000..8147620b211 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.d.ts @@ -0,0 +1,2 @@ +declare class C { +} diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js new file mode 100644 index 00000000000..325ac60ee32 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js @@ -0,0 +1,5 @@ +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map new file mode 100644 index 00000000000..de54805ee54 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileC.js","sourceRoot":"","sources":["../../../../FolderA/FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts new file mode 100644 index 00000000000..4ff813c3839 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.d.ts @@ -0,0 +1,4 @@ +/// +declare class B { + c: C; +} diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js new file mode 100644 index 00000000000..99199ca1742 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js @@ -0,0 +1,6 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map new file mode 100644 index 00000000000..d1c844d3247 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileB.js","sourceRoot":"","sources":["../../../FolderA/FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json new file mode 100644 index 00000000000..111f0277ec1 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json @@ -0,0 +1,22 @@ +{ + "scenario": "rootDirectory: specify rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "rootDir": "FolderA", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js", + "outdir/simple/FolderB/FolderC/fileC.d.ts", + "outdir/simple/FolderB/fileB.js", + "outdir/simple/FolderB/fileB.d.ts" + ] +} \ 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 new file mode 100644 index 00000000000..83ee3b40181 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.sourcemap.txt @@ -0,0 +1,123 @@ +=================================================================== +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) name (C) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class C { + > +2 > } +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor) +2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor) +--- +>>> return C; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class C { + > } +1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C) +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 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +--- +>>>var B = (function () { +>>> function B() { +1 >^^^^ +2 > ^^-> +1 > + > +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class B { + > public c: C; + > +2 > } +1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor) +--- +>>> return B; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class B { + > public c: C; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B) +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/outdir/simple/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts new file mode 100644 index 00000000000..8147620b211 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.d.ts @@ -0,0 +1,2 @@ +declare class C { +} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js new file mode 100644 index 00000000000..325ac60ee32 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/FolderC/fileC.js @@ -0,0 +1,5 @@ +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts new file mode 100644 index 00000000000..4ff813c3839 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.d.ts @@ -0,0 +1,4 @@ +/// +declare class B { + c: C; +} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js new file mode 100644 index 00000000000..99199ca1742 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/outdir/simple/fileB.js @@ -0,0 +1,6 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt new file mode 100644 index 00000000000..7e10d8fbcd9 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.errors.txt @@ -0,0 +1,14 @@ +error TS6059: File 'FolderA/FolderB/fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files. + + +!!! error TS6059: File 'fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files. +==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== + class C { + } + +==== FolderA/FolderB/fileB.ts (0 errors) ==== + /// + class B { + public c: C; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json new file mode 100644 index 00000000000..fdde42592ca --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/amd/rootDirectoryErrors.json @@ -0,0 +1,22 @@ +{ + "scenario": "rootDirectory: Files outside the rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "rootDir": "FolderA/FolderB/FolderC", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderC/fileC.js", + "outdir/simple/FolderC/fileC.d.ts", + "outdir/simple/fileB.js", + "outdir/simple/fileB.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts new file mode 100644 index 00000000000..8147620b211 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.d.ts @@ -0,0 +1,2 @@ +declare class C { +} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js new file mode 100644 index 00000000000..325ac60ee32 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/FolderC/fileC.js @@ -0,0 +1,5 @@ +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts new file mode 100644 index 00000000000..4ff813c3839 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.d.ts @@ -0,0 +1,4 @@ +/// +declare class B { + c: C; +} diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js new file mode 100644 index 00000000000..99199ca1742 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/outdir/simple/fileB.js @@ -0,0 +1,6 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt new file mode 100644 index 00000000000..7e10d8fbcd9 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.errors.txt @@ -0,0 +1,14 @@ +error TS6059: File 'FolderA/FolderB/fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files. + + +!!! error TS6059: File 'fileB.ts' is not under rootDir 'FolderA/FolderB/FolderC'. RootDir is expected to contain all source files. +==== FolderA/FolderB/FolderC/fileC.ts (0 errors) ==== + class C { + } + +==== FolderA/FolderB/fileB.ts (0 errors) ==== + /// + class B { + public c: C; + } + \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json new file mode 100644 index 00000000000..fdde42592ca --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryErrors/node/rootDirectoryErrors.json @@ -0,0 +1,22 @@ +{ + "scenario": "rootDirectory: Files outside the rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "declaration": true, + "baselineCheck": true, + "rootDir": "FolderA/FolderB/FolderC", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderC/fileC.js", + "outdir/simple/FolderC/fileC.d.ts", + "outdir/simple/fileB.js", + "outdir/simple/fileB.d.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js new file mode 100644 index 00000000000..8840c2117cf --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js @@ -0,0 +1,6 @@ +var C = (function () { + function C() { + } + return C; +})(); +//# sourceMappingURL=fileC.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map new file mode 100644 index 00000000000..9a35f3fbc3e --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/FolderC/fileC.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js new file mode 100644 index 00000000000..84af55d2d89 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js @@ -0,0 +1,7 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); +//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map new file mode 100644 index 00000000000..16a45385420 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/outdir/simple/FolderB/fileB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json new file mode 100644 index 00000000000..deb12150736 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.json @@ -0,0 +1,23 @@ +{ + "scenario": "rootDirectory: specify rootDirectory with sourceRoot", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "SourceRootPath", + "baselineCheck": true, + "rootDir": "FolderA", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js.map", + "outdir/simple/FolderB/FolderC/fileC.js", + "outdir/simple/FolderB/fileB.js.map", + "outdir/simple/FolderB/fileB.js" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt new file mode 100644 index 00000000000..7c5843bdd34 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/amd/rootDirectoryWithSourceRoot.sourcemap.txt @@ -0,0 +1,123 @@ +=================================================================== +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) name (C) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class C { + > +2 > } +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor) +2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor) +--- +>>> return C; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class C { + > } +1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C) +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 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +--- +>>>var B = (function () { +>>> function B() { +1 >^^^^ +2 > ^^-> +1 > + > +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class B { + > public c: C; + > +2 > } +1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor) +--- +>>> return B; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class B { + > public c: C; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B) +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/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js new file mode 100644 index 00000000000..8840c2117cf --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js @@ -0,0 +1,6 @@ +var C = (function () { + function C() { + } + return C; +})(); +//# sourceMappingURL=fileC.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map new file mode 100644 index 00000000000..9a35f3fbc3e --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/FolderC/fileC.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileC.js","sourceRoot":"SourceRootPath/","sources":["FolderB/FolderC/fileC.ts"],"names":["C","C.constructor"],"mappings":"AAAA;IAAAA;IACAC,CAACA;IAADD,QAACA;AAADA,CAACA,AADD,IACC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js new file mode 100644 index 00000000000..84af55d2d89 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js @@ -0,0 +1,7 @@ +/// +var B = (function () { + function B() { + } + return B; +})(); +//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map new file mode 100644 index 00000000000..16a45385420 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/outdir/simple/FolderB/fileB.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileB.js","sourceRoot":"SourceRootPath/","sources":["FolderB/fileB.ts"],"names":["B","B.constructor"],"mappings":"AACA,AADA,wCAAwC;;IACxCA;IAEAC,CAACA;IAADD,QAACA;AAADA,CAACA,AAFD,IAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json new file mode 100644 index 00000000000..deb12150736 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.json @@ -0,0 +1,23 @@ +{ + "scenario": "rootDirectory: specify rootDirectory with sourceRoot", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "sourceMap": true, + "sourceRoot": "SourceRootPath", + "baselineCheck": true, + "rootDir": "FolderA", + "resolvedInputFiles": [ + "lib.d.ts", + "FolderA/FolderB/FolderC/fileC.ts", + "FolderA/FolderB/fileB.ts" + ], + "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js.map", + "outdir/simple/FolderB/FolderC/fileC.js", + "outdir/simple/FolderB/fileB.js.map", + "outdir/simple/FolderB/fileB.js" + ] +} \ 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 new file mode 100644 index 00000000000..7c5843bdd34 --- /dev/null +++ b/tests/baselines/reference/project/rootDirectoryWithSourceRoot/node/rootDirectoryWithSourceRoot.sourcemap.txt @@ -0,0 +1,123 @@ +=================================================================== +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) name (C) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class C { + > +2 > } +1->Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (C.constructor) +2 >Emitted(3, 6) Source(2, 2) + SourceIndex(0) name (C.constructor) +--- +>>> return C; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(4, 5) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(4, 13) Source(2, 2) + SourceIndex(0) name (C) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class C { + > } +1 >Emitted(5, 1) Source(2, 1) + SourceIndex(0) name (C) +2 >Emitted(5, 2) Source(2, 2) + SourceIndex(0) name (C) +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 > +3 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 >/// + > +2 > +3 >/// +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +3 >Emitted(1, 41) Source(1, 41) + SourceIndex(0) +--- +>>>var B = (function () { +>>> function B() { +1 >^^^^ +2 > ^^-> +1 > + > +1 >Emitted(3, 5) Source(2, 1) + SourceIndex(0) name (B) +--- +>>> } +1->^^^^ +2 > ^ +3 > ^^^^^^^^^-> +1->class B { + > public c: C; + > +2 > } +1->Emitted(4, 5) Source(4, 1) + SourceIndex(0) name (B.constructor) +2 >Emitted(4, 6) Source(4, 2) + SourceIndex(0) name (B.constructor) +--- +>>> return B; +1->^^^^ +2 > ^^^^^^^^ +1-> +2 > } +1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(5, 13) Source(4, 2) + SourceIndex(0) name (B) +--- +>>>})(); +1 > +2 >^ +3 > +4 > ^^^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > +2 >} +3 > +4 > class B { + > public c: C; + > } +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) name (B) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) name (B) +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/cases/project/rootDirectory.json b/tests/cases/project/rootDirectory.json new file mode 100644 index 00000000000..6dad3982f93 --- /dev/null +++ b/tests/cases/project/rootDirectory.json @@ -0,0 +1,12 @@ +{ + "scenario": "rootDirectory: specify rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "rootDir": "FolderA", + "sourceMap": true, + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/rootDirectoryErrors.json b/tests/cases/project/rootDirectoryErrors.json new file mode 100644 index 00000000000..18a256486d0 --- /dev/null +++ b/tests/cases/project/rootDirectoryErrors.json @@ -0,0 +1,11 @@ +{ + "scenario": "rootDirectory: Files outside the rootDirectory", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "rootDir": "FolderA/FolderB/FolderC", + "declaration": true, + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/project/rootDirectoryWithSourceRoot.json b/tests/cases/project/rootDirectoryWithSourceRoot.json new file mode 100644 index 00000000000..227b55c13fd --- /dev/null +++ b/tests/cases/project/rootDirectoryWithSourceRoot.json @@ -0,0 +1,12 @@ +{ + "scenario": "rootDirectory: specify rootDirectory with sourceRoot", + "projectRoot": "tests/cases/projects/rootDirectory", + "inputFiles": [ + "FolderA/FolderB/fileB.ts" + ], + "outDir": "outdir/simple", + "rootDir": "FolderA", + "sourceMap": true, + "sourceRoot": "SourceRootPath", + "baselineCheck": true +} \ No newline at end of file diff --git a/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts b/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts new file mode 100644 index 00000000000..f4885b3ca74 --- /dev/null +++ b/tests/cases/projects/rootDirectory/FolderA/FolderB/FolderC/fileC.ts @@ -0,0 +1,2 @@ +class C { +} diff --git a/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts b/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts new file mode 100644 index 00000000000..03e0f4ad332 --- /dev/null +++ b/tests/cases/projects/rootDirectory/FolderA/FolderB/fileB.ts @@ -0,0 +1,4 @@ +/// +class B { + public c: C; +} From a2e888de13b6c99e950dd5d47d4de1d69279ce25 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 14 Apr 2015 22:20:08 -0700 Subject: [PATCH 04/13] Accept baselines --- .../reference/APISample_compile.types | 32 ++++----- .../reference/APISample_linter.types | 30 ++++---- .../reference/APISample_transform.types | 12 ++-- .../reference/APISample_watcher.types | 70 +++++++++---------- 4 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index d147ded3f0e..fef97ec9211 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -28,9 +28,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void var program = ts.createProgram(fileNames, options); >program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7)) >ts.createProgram(fileNames, options) : ts.Program ->ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1201, 113)) +>ts.createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1202, 113)) >ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20)) ->createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1201, 113)) +>createProgram : (rootNames: string[], options: ts.CompilerOptions, host?: ts.CompilerHost) => ts.Program, Symbol(ts.createProgram, Decl(typescript.d.ts, 1202, 113)) >fileNames : string[], Symbol(fileNames, Decl(APISample_compile.ts, 13, 24)) >options : ts.CompilerOptions, Symbol(options, Decl(APISample_compile.ts, 13, 44)) @@ -46,9 +46,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics) : ts.Diagnostic[] >ts.getPreEmitDiagnostics(program).concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) >ts.getPreEmitDiagnostics(program) : ts.Diagnostic[] ->ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1199, 98)) +>ts.getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1200, 98)) >ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20)) ->getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1199, 98)) +>getPreEmitDiagnostics : (program: ts.Program) => ts.Diagnostic[], Symbol(ts.getPreEmitDiagnostics, Decl(typescript.d.ts, 1200, 98)) >program : ts.Program, Symbol(program, Decl(APISample_compile.ts, 14, 7)) >concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) >emitResult.diagnostics : ts.Diagnostic[], Symbol(ts.EmitResult.diagnostics, Decl(typescript.d.ts, 820, 29)) @@ -67,11 +67,11 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void >line : number, Symbol(line, Decl(APISample_compile.ts, 20, 13)) >character : number, Symbol(character, Decl(APISample_compile.ts, 20, 19)) >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter ->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27)) >file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26)) ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27)) >start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25)) @@ -79,9 +79,9 @@ export function compile(fileNames: string[], options: ts.CompilerOptions): void var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); >message : string, Symbol(message, Decl(APISample_compile.ts, 21, 11)) >ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67)) +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1201, 67)) >ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20)) ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67)) +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1201, 67)) >diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_compile.ts, 19, 27)) >messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23)) @@ -153,16 +153,16 @@ compile(process.argv.slice(2), { target: ts.ScriptTarget.ES5, module: ts.ModuleKind.CommonJS >target : ts.ScriptTarget, Symbol(target, Decl(APISample_compile.ts, 31, 45)) ->ts.ScriptTarget.ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16)) ->ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5)) +>ts.ScriptTarget.ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1118, 16)) +>ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1116, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20)) ->ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5)) ->ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1117, 16)) +>ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1116, 5)) +>ES5 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES5, Decl(typescript.d.ts, 1118, 16)) >module : ts.ModuleKind, Symbol(module, Decl(APISample_compile.ts, 32, 32)) ->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) ->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) +>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) +>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_compile.ts, 9, 20)) ->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) ->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) +>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) +>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) }); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index c285bc15390..d9628c0fb0e 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -22,7 +22,7 @@ export function delint(sourceFile: ts.SourceFile) { >delint : (sourceFile: ts.SourceFile) => void, Symbol(delint, Decl(APISample_linter.ts, 11, 33)) >sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23)) >ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->SourceFile : ts.SourceFile, Symbol(ts.SourceFile, Decl(typescript.d.ts, 740, 5), Decl(typescript.d.ts, 1261, 5)) +>SourceFile : ts.SourceFile, Symbol(ts.SourceFile, Decl(typescript.d.ts, 740, 5), Decl(typescript.d.ts, 1262, 5)) delintNode(sourceFile); >delintNode(sourceFile) : void @@ -33,7 +33,7 @@ export function delint(sourceFile: ts.SourceFile) { >delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27)) >node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24)) >ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1221, 32)) +>Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1222, 32)) switch (node.kind) { >node.kind : ts.SyntaxKind, Symbol(ts.Node.kind, Decl(typescript.d.ts, 297, 38)) @@ -219,9 +219,9 @@ export function delint(sourceFile: ts.SourceFile) { ts.forEachChild(node, delintNode); >ts.forEachChild(node, delintNode) : void ->ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1186, 48)) +>ts.forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1187, 48)) >ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1186, 48)) +>forEachChild : (node: ts.Node, cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T) => T, Symbol(ts.forEachChild, Decl(typescript.d.ts, 1187, 48)) >node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 16, 24)) >delintNode : (node: ts.Node) => void, Symbol(delintNode, Decl(APISample_linter.ts, 14, 27)) } @@ -230,20 +230,20 @@ export function delint(sourceFile: ts.SourceFile) { >report : (node: ts.Node, message: string) => void, Symbol(report, Decl(APISample_linter.ts, 48, 5)) >node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20)) >ts : any, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1221, 32)) +>Node : ts.Node, Symbol(ts.Node, Decl(typescript.d.ts, 296, 5), Decl(typescript.d.ts, 1222, 32)) >message : string, Symbol(message, Decl(APISample_linter.ts, 50, 34)) let { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart()); >line : number, Symbol(line, Decl(APISample_linter.ts, 51, 13)) >character : number, Symbol(character, Decl(APISample_linter.ts, 51, 19)) >sourceFile.getLineAndCharacterOfPosition(node.getStart()) : ts.LineAndCharacter ->sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>sourceFile.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 13, 23)) ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >node.getStart() : number ->node.getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1226, 53)) +>node.getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1227, 53)) >node : ts.Node, Symbol(node, Decl(APISample_linter.ts, 50, 20)) ->getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1226, 53)) +>getStart : (sourceFile?: ts.SourceFile) => number, Symbol(ts.Node.getStart, Decl(typescript.d.ts, 1227, 53)) console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`); >console.log(`${sourceFile.fileName} (${line + 1},${character + 1}): ${message}`) : any @@ -286,9 +286,9 @@ fileNames.forEach(fileName => { let sourceFile = ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true); >sourceFile : ts.SourceFile, Symbol(sourceFile, Decl(APISample_linter.ts, 59, 7)) >ts.createSourceFile(fileName, readFileSync(fileName).toString(), ts.ScriptTarget.ES6, /*setParentNodes */ true) : ts.SourceFile ->ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1190, 62)) +>ts.createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1191, 62)) >ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1190, 62)) +>createSourceFile : (fileName: string, sourceText: string, languageVersion: ts.ScriptTarget, setParentNodes?: boolean) => ts.SourceFile, Symbol(ts.createSourceFile, Decl(typescript.d.ts, 1191, 62)) >fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18)) >readFileSync(fileName).toString() : any >readFileSync(fileName).toString : any @@ -296,11 +296,11 @@ fileNames.forEach(fileName => { >readFileSync : any, Symbol(readFileSync, Decl(APISample_linter.ts, 9, 11)) >fileName : any, Symbol(fileName, Decl(APISample_linter.ts, 57, 18)) >toString : any ->ts.ScriptTarget.ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16)) ->ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5)) +>ts.ScriptTarget.ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1119, 16)) +>ts.ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1116, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_linter.ts, 11, 6)) ->ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1115, 5)) ->ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1118, 16)) +>ScriptTarget : typeof ts.ScriptTarget, Symbol(ts.ScriptTarget, Decl(typescript.d.ts, 1116, 5)) +>ES6 : ts.ScriptTarget, Symbol(ts.ScriptTarget.ES6, Decl(typescript.d.ts, 1119, 16)) >true : boolean // delint it diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index 6e27f70d877..4bd9052bffb 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -19,17 +19,17 @@ const source = "let x: string = 'string'"; let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS }); >result : string, Symbol(result, Decl(APISample_transform.ts, 13, 3)) >ts.transpile(source, { module: ts.ModuleKind.CommonJS }) : string ->ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1729, 5)) +>ts.transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1730, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6)) ->transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1729, 5)) +>transpile : (input: string, compilerOptions?: ts.CompilerOptions, fileName?: string, diagnostics?: ts.Diagnostic[]) => string, Symbol(ts.transpile, Decl(typescript.d.ts, 1730, 5)) >source : string, Symbol(source, Decl(APISample_transform.ts, 11, 5)) >{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } >module : ts.ModuleKind, Symbol(module, Decl(APISample_transform.ts, 13, 35)) ->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) ->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) +>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) +>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_transform.ts, 9, 6)) ->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) ->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) +>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) +>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) console.log(JSON.stringify(result)); >console.log(JSON.stringify(result)) : any diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index abc915e3776..a1902c98e48 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -59,7 +59,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { const servicesHost: ts.LanguageServiceHost = { >servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9)) >ts : any, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->LanguageServiceHost : ts.LanguageServiceHost, Symbol(ts.LanguageServiceHost, Decl(typescript.d.ts, 1295, 5)) +>LanguageServiceHost : ts.LanguageServiceHost, Symbol(ts.LanguageServiceHost, Decl(typescript.d.ts, 1296, 5)) >{ getScriptFileNames: () => rootFileNames, getScriptVersion: (fileName) => files[fileName] && files[fileName].version.toString(), getScriptSnapshot: (fileName) => { if (!fs.existsSync(fileName)) { return undefined; } return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); }, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => options, getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), } : { getScriptFileNames: () => string[]; getScriptVersion: (fileName: string) => string; getScriptSnapshot: (fileName: string) => ts.IScriptSnapshot; getCurrentDirectory: () => any; getCompilationSettings: () => ts.CompilerOptions; getDefaultLibFileName: (options: ts.CompilerOptions) => string; } getScriptFileNames: () => rootFileNames, @@ -103,11 +103,11 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); >ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()) : ts.IScriptSnapshot ->ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1288, 27)) ->ts.ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1287, 5)) +>ts.ScriptSnapshot.fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1289, 27)) +>ts.ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1288, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1287, 5)) ->fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1288, 27)) +>ScriptSnapshot : typeof ts.ScriptSnapshot, Symbol(ts.ScriptSnapshot, Decl(typescript.d.ts, 1288, 5)) +>fromString : (text: string) => ts.IScriptSnapshot, Symbol(ts.ScriptSnapshot.fromString, Decl(typescript.d.ts, 1289, 27)) >fs.readFileSync(fileName).toString() : any >fs.readFileSync(fileName).toString : any >fs.readFileSync(fileName) : any @@ -136,9 +136,9 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >(options) => ts.getDefaultLibFilePath(options) : (options: ts.CompilerOptions) => string >options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32)) >ts.getDefaultLibFilePath(options) : string ->ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1737, 44)) +>ts.getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1738, 44)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1737, 44)) +>getDefaultLibFilePath : (options: ts.CompilerOptions) => string, Symbol(ts.getDefaultLibFilePath, Decl(typescript.d.ts, 1738, 44)) >options : ts.CompilerOptions, Symbol(options, Decl(APISample_watcher.ts, 35, 32)) }; @@ -147,14 +147,14 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { const services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) >services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9)) >ts.createLanguageService(servicesHost, ts.createDocumentRegistry()) : ts.LanguageService ->ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1735, 97)) +>ts.createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1736, 97)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1735, 97)) +>createLanguageService : (host: ts.LanguageServiceHost, documentRegistry?: ts.DocumentRegistry) => ts.LanguageService, Symbol(ts.createLanguageService, Decl(typescript.d.ts, 1736, 97)) >servicesHost : ts.LanguageServiceHost, Symbol(servicesHost, Decl(APISample_watcher.ts, 23, 9)) >ts.createDocumentRegistry() : ts.DocumentRegistry ->ts.createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1733, 193)) +>ts.createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1734, 193)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1733, 193)) +>createDocumentRegistry : () => ts.DocumentRegistry, Symbol(ts.createDocumentRegistry, Decl(typescript.d.ts, 1734, 193)) // Now let's watch the files rootFileNames.forEach(fileName => { @@ -231,16 +231,16 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { let output = services.getEmitOutput(fileName); >output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11)) >services.getEmitOutput(fileName) : ts.EmitOutput ->services.getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1339, 132)) +>services.getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1340, 132)) >services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9)) ->getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1339, 132)) +>getEmitOutput : (fileName: string) => ts.EmitOutput, Symbol(ts.LanguageService.getEmitOutput, Decl(typescript.d.ts, 1340, 132)) >fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 63, 22)) if (!output.emitSkipped) { >!output.emitSkipped : boolean ->output.emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1542, 34)) +>output.emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1543, 34)) >output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11)) ->emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1542, 34)) +>emitSkipped : boolean, Symbol(ts.EmitOutput.emitSkipped, Decl(typescript.d.ts, 1543, 34)) console.log(`Emitting ${fileName}`); >console.log(`Emitting ${fileName}`) : any @@ -268,9 +268,9 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { output.outputFiles.forEach(o => { >output.outputFiles.forEach(o => { fs.writeFileSync(o.name, o.text, "utf8"); }) : void >output.outputFiles.forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) ->output.outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1541, 26)) +>output.outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1542, 26)) >output : ts.EmitOutput, Symbol(output, Decl(APISample_watcher.ts, 64, 11)) ->outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1541, 26)) +>outputFiles : ts.OutputFile[], Symbol(ts.EmitOutput.outputFiles, Decl(typescript.d.ts, 1542, 26)) >forEach : (callbackfn: (value: ts.OutputFile, index: number, array: ts.OutputFile[]) => void, thisArg?: any) => void, Symbol(Array.forEach, Decl(lib.d.ts, 1108, 95)) >o => { fs.writeFileSync(o.name, o.text, "utf8"); } : (o: ts.OutputFile) => void >o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35)) @@ -280,12 +280,12 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >fs.writeFileSync : any >fs : any, Symbol(fs, Decl(APISample_watcher.ts, 9, 11)) >writeFileSync : any ->o.name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1550, 26)) +>o.name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1551, 26)) >o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35)) ->name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1550, 26)) ->o.text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1552, 36)) +>name : string, Symbol(ts.OutputFile.name, Decl(typescript.d.ts, 1551, 26)) +>o.text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1553, 36)) >o : ts.OutputFile, Symbol(o, Decl(APISample_watcher.ts, 74, 35)) ->text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1552, 36)) +>text : string, Symbol(ts.OutputFile.text, Decl(typescript.d.ts, 1553, 36)) >"utf8" : string }); @@ -302,24 +302,24 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >services.getCompilerOptionsDiagnostics() .concat(services.getSyntacticDiagnostics(fileName)) : ts.Diagnostic[] >services.getCompilerOptionsDiagnostics() .concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) >services.getCompilerOptionsDiagnostics() : ts.Diagnostic[] ->services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1313, 63)) +>services.getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1314, 63)) >services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9)) ->getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1313, 63)) +>getCompilerOptionsDiagnostics : () => ts.Diagnostic[], Symbol(ts.LanguageService.getCompilerOptionsDiagnostics, Decl(typescript.d.ts, 1314, 63)) .concat(services.getSyntacticDiagnostics(fileName)) >concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) >services.getSyntacticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1311, 37)) +>services.getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1312, 37)) >services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9)) ->getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1311, 37)) +>getSyntacticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSyntacticDiagnostics, Decl(typescript.d.ts, 1312, 37)) >fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23)) .concat(services.getSemanticDiagnostics(fileName)); >concat : { (...items: U[]): ts.Diagnostic[]; (...items: ts.Diagnostic[]): ts.Diagnostic[]; }, Symbol(Array.concat, Decl(lib.d.ts, 1025, 13), Decl(lib.d.ts, 1030, 46)) >services.getSemanticDiagnostics(fileName) : ts.Diagnostic[] ->services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1312, 64)) +>services.getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1313, 64)) >services : ts.LanguageService, Symbol(services, Decl(APISample_watcher.ts, 39, 9)) ->getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1312, 64)) +>getSemanticDiagnostics : (fileName: string) => ts.Diagnostic[], Symbol(ts.LanguageService.getSemanticDiagnostics, Decl(typescript.d.ts, 1313, 64)) >fileName : string, Symbol(fileName, Decl(APISample_watcher.ts, 79, 23)) allDiagnostics.forEach(diagnostic => { @@ -333,9 +333,9 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); >message : string, Symbol(message, Decl(APISample_watcher.ts, 85, 15)) >ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n") : string ->ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67)) +>ts.flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1201, 67)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1200, 67)) +>flattenDiagnosticMessageText : (messageText: string | ts.DiagnosticMessageChain, newLine: string) => string, Symbol(ts.flattenDiagnosticMessageText, Decl(typescript.d.ts, 1201, 67)) >diagnostic.messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31)) >messageText : string | ts.DiagnosticMessageChain, Symbol(ts.Diagnostic.messageText, Decl(typescript.d.ts, 1065, 23)) @@ -350,11 +350,11 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) { >line : number, Symbol(line, Decl(APISample_watcher.ts, 87, 21)) >character : number, Symbol(character, Decl(APISample_watcher.ts, 87, 27)) >diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : ts.LineAndCharacter ->diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>diagnostic.file.getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >diagnostic.file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31)) >file : ts.SourceFile, Symbol(ts.Diagnostic.file, Decl(typescript.d.ts, 1062, 26)) ->getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1263, 46)) +>getLineAndCharacterOfPosition : (pos: number) => ts.LineAndCharacter, Symbol(ts.SourceFile.getLineAndCharacterOfPosition, Decl(typescript.d.ts, 1264, 46)) >diagnostic.start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25)) >diagnostic : ts.Diagnostic, Symbol(diagnostic, Decl(APISample_watcher.ts, 84, 31)) >start : number, Symbol(ts.Diagnostic.start, Decl(typescript.d.ts, 1063, 25)) @@ -435,9 +435,9 @@ watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS }); >currentDirectoryFiles : any, Symbol(currentDirectoryFiles, Decl(APISample_watcher.ts, 98, 5)) >{ module: ts.ModuleKind.CommonJS } : { [x: string]: ts.ModuleKind; module: ts.ModuleKind; } >module : ts.ModuleKind, Symbol(module, Decl(APISample_watcher.ts, 102, 30)) ->ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) ->ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) +>ts.ModuleKind.CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) +>ts.ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) >ts : typeof ts, Symbol(ts, Decl(APISample_watcher.ts, 12, 6)) ->ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1106, 5)) ->CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1108, 17)) +>ModuleKind : typeof ts.ModuleKind, Symbol(ts.ModuleKind, Decl(typescript.d.ts, 1107, 5)) +>CommonJS : ts.ModuleKind, Symbol(ts.ModuleKind.CommonJS, Decl(typescript.d.ts, 1109, 17)) From 16bbedcbf9ab0b8eae2fd797f3edf87e2f842d12 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 14 Apr 2015 22:27:42 -0700 Subject: [PATCH 05/13] Add source maps to rootdir tests --- .../rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js | 1 + .../project/rootDirectory/amd/outdir/simple/FolderB/fileB.js | 1 + .../reference/project/rootDirectory/amd/rootDirectory.json | 3 +++ .../rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js | 1 + .../project/rootDirectory/node/outdir/simple/FolderB/fileB.js | 1 + .../reference/project/rootDirectory/node/rootDirectory.json | 3 +++ 6 files changed, 10 insertions(+) diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js index 325ac60ee32..8840c2117cf 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/FolderC/fileC.js @@ -3,3 +3,4 @@ var C = (function () { } return C; })(); +//# sourceMappingURL=fileC.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js index 99199ca1742..84af55d2d89 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectory/amd/outdir/simple/FolderB/fileB.js @@ -4,3 +4,4 @@ var B = (function () { } return B; })(); +//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json index 111f0277ec1..2ec18b3ac5a 100644 --- a/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json +++ b/tests/baselines/reference/project/rootDirectory/amd/rootDirectory.json @@ -5,6 +5,7 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "sourceMap": true, "declaration": true, "baselineCheck": true, "rootDir": "FolderA", @@ -14,8 +15,10 @@ "FolderA/FolderB/fileB.ts" ], "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js.map", "outdir/simple/FolderB/FolderC/fileC.js", "outdir/simple/FolderB/FolderC/fileC.d.ts", + "outdir/simple/FolderB/fileB.js.map", "outdir/simple/FolderB/fileB.js", "outdir/simple/FolderB/fileB.d.ts" ] diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js index 325ac60ee32..8840c2117cf 100644 --- a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/FolderC/fileC.js @@ -3,3 +3,4 @@ var C = (function () { } return C; })(); +//# sourceMappingURL=fileC.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js index 99199ca1742..84af55d2d89 100644 --- a/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js +++ b/tests/baselines/reference/project/rootDirectory/node/outdir/simple/FolderB/fileB.js @@ -4,3 +4,4 @@ var B = (function () { } return B; })(); +//# sourceMappingURL=fileB.js.map \ No newline at end of file diff --git a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json index 111f0277ec1..2ec18b3ac5a 100644 --- a/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json +++ b/tests/baselines/reference/project/rootDirectory/node/rootDirectory.json @@ -5,6 +5,7 @@ "FolderA/FolderB/fileB.ts" ], "outDir": "outdir/simple", + "sourceMap": true, "declaration": true, "baselineCheck": true, "rootDir": "FolderA", @@ -14,8 +15,10 @@ "FolderA/FolderB/fileB.ts" ], "emittedFiles": [ + "outdir/simple/FolderB/FolderC/fileC.js.map", "outdir/simple/FolderB/FolderC/fileC.js", "outdir/simple/FolderB/FolderC/fileC.d.ts", + "outdir/simple/FolderB/fileB.js.map", "outdir/simple/FolderB/fileB.js", "outdir/simple/FolderB/fileB.d.ts" ] From b6ef32346b7d563570f6741bfd526c23c8d34215 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 16 Apr 2015 16:35:48 -0700 Subject: [PATCH 06/13] Respond to code review comments --- src/compiler/diagnosticInformationMap.generated.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- src/compiler/program.ts | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 7c9d9b56c63..0b4200455b1 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -496,7 +496,7 @@ module ts { Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, - File_0_is_not_under_rootDir_1_RootDir_is_expected_to_contain_all_source_files: { code: 6059, category: DiagnosticCategory.Error, key: "File '{0}' is not under rootDir '{1}'. RootDir is expected to contain all source files." }, + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 31fc9090a6f..38d8a43e4c1 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1972,7 +1972,7 @@ "category": "Message", "code": 6058 }, - "File '{0}' is not under rootDir '{1}'. RootDir is expected to contain all source files.": { + "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files.": { "category": "Error", "code": 6059 }, diff --git a/src/compiler/program.ts b/src/compiler/program.ts index e3fe08d04eb..0d0c5b16d32 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -453,7 +453,7 @@ module ts { } } - function computecommonSourceDirectory(sourceFiles: SourceFile[]): string { + function computeCommonSourceDirectory(sourceFiles: SourceFile[]): string { let commonPathComponents: string[]; let currentDirectory = host.getCurrentDirectory(); forEach(files, sourceFile => { @@ -465,7 +465,7 @@ module ts { let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory); sourcePathComponents.pop(); // FileName is not part of directory if (commonPathComponents) { - for (let i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { + for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { if (commonPathComponents[i] !== sourcePathComponents[i]) { if (i === 0) { diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); @@ -486,8 +486,8 @@ module ts { else { // first file commonPathComponents = sourcePathComponents; + return; } - }); return getNormalizedPathFromPathComponents(commonPathComponents); @@ -495,15 +495,15 @@ module ts { function checkSourceFilesBelongToPath(soruceFiles: SourceFile[], rootDirectory: string): boolean { let allFilesBelongToPath = true; - if (files) { + if (soruceFiles) { let currentDirectory = host.getCurrentDirectory(); let absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var sourceFile of files) { + for (var sourceFile of soruceFiles) { if (!isDeclarationFile(sourceFile)) { let absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { - diagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_RootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + diagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); allFilesBelongToPath = false; } } @@ -581,7 +581,7 @@ module ts { } else { // Compute the commonSourceDirectory from the input files - commonSourceDirectory = computecommonSourceDirectory(files); + commonSourceDirectory = computeCommonSourceDirectory(files); } if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { From b3fcae88b9c7d3d9740f7a3d57c44a0ae6889e9c Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Sun, 19 Apr 2015 13:24:39 -0700 Subject: [PATCH 07/13] Fix typo --- src/compiler/program.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 10559208cb4..70e55000d85 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -494,13 +494,13 @@ module ts { return getNormalizedPathFromPathComponents(commonPathComponents); } - function checkSourceFilesBelongToPath(soruceFiles: SourceFile[], rootDirectory: string): boolean { + function checkSourceFilesBelongToPath(sourceFiles: SourceFile[], rootDirectory: string): boolean { let allFilesBelongToPath = true; - if (soruceFiles) { + if (sourceFiles) { let currentDirectory = host.getCurrentDirectory(); let absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var sourceFile of soruceFiles) { + for (var sourceFile of sourceFiles) { if (!isDeclarationFile(sourceFile)) { let absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { From 08a869212b67f86551586363aa703ef36bb46351 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 20 Apr 2015 14:23:24 -0700 Subject: [PATCH 08/13] Respond to code review commmetns --- src/compiler/program.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index bb88f332453..d49e01bd45d 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -465,31 +465,31 @@ module ts { } let sourcePathComponents = getNormalizedPathComponents(sourceFile.fileName, currentDirectory); - sourcePathComponents.pop(); // FileName is not part of directory - if (commonPathComponents) { - for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } + sourcePathComponents.pop(); // The base file name is not part of the common directory path - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; - } - } - - // If the fileComponent path completely matched and less than already found update the length - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { + if (!commonPathComponents) { // first file commonPathComponents = sourcePathComponents; return; } + + for (let i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + + // New common path found that is 0 -> i-1 + commonPathComponents.length = i; + break; + } + } + + // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } }); return getNormalizedPathFromPathComponents(commonPathComponents); From 1295519b8f397729e68b9cffec78094554a3a334 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 21 Apr 2015 14:10:37 -0700 Subject: [PATCH 09/13] Updated emit for __decorator and __metadata helpers --- src/compiler/emitter.ts | 7 +- .../classExpressionWithDecorator1.js | 3 +- .../decoratedClassFromExternalModule.js | 3 +- .../baselines/reference/decoratorOnClass1.js | 3 +- .../baselines/reference/decoratorOnClass2.js | 3 +- .../baselines/reference/decoratorOnClass3.js | 3 +- .../baselines/reference/decoratorOnClass4.js | 3 +- .../baselines/reference/decoratorOnClass5.js | 3 +- .../baselines/reference/decoratorOnClass8.js | 3 +- .../reference/decoratorOnClassAccessor1.js | 3 +- .../reference/decoratorOnClassAccessor2.js | 3 +- .../reference/decoratorOnClassAccessor3.js | 3 +- .../reference/decoratorOnClassAccessor4.js | 3 +- .../reference/decoratorOnClassAccessor5.js | 3 +- .../reference/decoratorOnClassAccessor6.js | 3 +- .../decoratorOnClassConstructorParameter1.js | 3 +- .../decoratorOnClassConstructorParameter4.js | 3 +- .../reference/decoratorOnClassMethod1.js | 3 +- .../reference/decoratorOnClassMethod10.js | 3 +- .../reference/decoratorOnClassMethod11.js | 3 +- .../reference/decoratorOnClassMethod12.js | 3 +- .../reference/decoratorOnClassMethod13.js | 3 +- .../reference/decoratorOnClassMethod2.js | 3 +- .../reference/decoratorOnClassMethod3.js | 3 +- .../reference/decoratorOnClassMethod4.js | 3 +- .../reference/decoratorOnClassMethod5.js | 3 +- .../reference/decoratorOnClassMethod6.js | 3 +- .../reference/decoratorOnClassMethod7.js | 3 +- .../reference/decoratorOnClassMethod8.js | 3 +- .../decoratorOnClassMethodParameter1.js | 3 +- .../reference/decoratorOnClassProperty1.js | 3 +- .../reference/decoratorOnClassProperty10.js | 3 +- .../reference/decoratorOnClassProperty11.js | 3 +- .../reference/decoratorOnClassProperty2.js | 3 +- .../reference/decoratorOnClassProperty3.js | 3 +- .../reference/decoratorOnClassProperty6.js | 3 +- .../reference/decoratorOnClassProperty7.js | 3 +- .../sourceMapValidationDecorators.js | 3 +- .../sourceMapValidationDecorators.js.map | 2 +- ...ourceMapValidationDecorators.sourcemap.txt | 405 +++++++++--------- 40 files changed, 283 insertions(+), 242 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 226c682d2d7..f4aa0fe1022 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -34,7 +34,8 @@ var __extends = this.__extends || function (d, b) { // emit output for the __decorate helper function const decorateHelper = ` -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); @@ -44,7 +45,9 @@ var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.deco // emit output for the __metadata helper function const metadataHelper = ` -var __metadata = this.__metadata || (typeof Reflect === "object" && Reflect.metadata) || function () { };`; +var __metadata = this.__metadata || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +};`; // emit output for the __param helper function const paramHelper = ` diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js index 3e255398904..964a92bb277 100644 --- a/tests/baselines/reference/classExpressionWithDecorator1.js +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -2,7 +2,8 @@ var v = @decorate class C { static p = 1 }; //// [classExpressionWithDecorator1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratedClassFromExternalModule.js b/tests/baselines/reference/decoratedClassFromExternalModule.js index a58eb01a426..62c03937a50 100644 --- a/tests/baselines/reference/decoratedClassFromExternalModule.js +++ b/tests/baselines/reference/decoratedClassFromExternalModule.js @@ -10,7 +10,8 @@ export default class Decorated { } import Decorated from 'decorated'; //// [decorated.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass1.js b/tests/baselines/reference/decoratorOnClass1.js index cd5c51e7a93..679561e2b2f 100644 --- a/tests/baselines/reference/decoratorOnClass1.js +++ b/tests/baselines/reference/decoratorOnClass1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClass1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass2.js b/tests/baselines/reference/decoratorOnClass2.js index fbd9a106ddf..43a67745ae8 100644 --- a/tests/baselines/reference/decoratorOnClass2.js +++ b/tests/baselines/reference/decoratorOnClass2.js @@ -6,7 +6,8 @@ export class C { } //// [decoratorOnClass2.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass3.js b/tests/baselines/reference/decoratorOnClass3.js index 21536028091..05e01f7c382 100644 --- a/tests/baselines/reference/decoratorOnClass3.js +++ b/tests/baselines/reference/decoratorOnClass3.js @@ -7,7 +7,8 @@ class C { } //// [decoratorOnClass3.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass4.js b/tests/baselines/reference/decoratorOnClass4.js index 5099d16b5b4..747a68a790e 100644 --- a/tests/baselines/reference/decoratorOnClass4.js +++ b/tests/baselines/reference/decoratorOnClass4.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClass4.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass5.js b/tests/baselines/reference/decoratorOnClass5.js index 0555f618e7e..5c7799937d6 100644 --- a/tests/baselines/reference/decoratorOnClass5.js +++ b/tests/baselines/reference/decoratorOnClass5.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClass5.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClass8.js b/tests/baselines/reference/decoratorOnClass8.js index fad73c0c8fc..86c52b50b44 100644 --- a/tests/baselines/reference/decoratorOnClass8.js +++ b/tests/baselines/reference/decoratorOnClass8.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClass8.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.js b/tests/baselines/reference/decoratorOnClassAccessor1.js index 68fa7ccec0a..5143f7daceb 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.js +++ b/tests/baselines/reference/decoratorOnClassAccessor1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor2.js b/tests/baselines/reference/decoratorOnClassAccessor2.js index 17d3e2e422d..fc5da177eaa 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor2.js +++ b/tests/baselines/reference/decoratorOnClassAccessor2.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor2.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor3.js b/tests/baselines/reference/decoratorOnClassAccessor3.js index 23e689f3114..08032785683 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor3.js +++ b/tests/baselines/reference/decoratorOnClassAccessor3.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor3.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor4.js b/tests/baselines/reference/decoratorOnClassAccessor4.js index 77bcb568fe1..f43ad96771b 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor4.js +++ b/tests/baselines/reference/decoratorOnClassAccessor4.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor4.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor5.js b/tests/baselines/reference/decoratorOnClassAccessor5.js index 37fc33abefd..781585eb4d4 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor5.js +++ b/tests/baselines/reference/decoratorOnClassAccessor5.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor5.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassAccessor6.js b/tests/baselines/reference/decoratorOnClassAccessor6.js index 465e13ebb1d..74feb09088b 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor6.js +++ b/tests/baselines/reference/decoratorOnClassAccessor6.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassAccessor6.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js index a1748a725ba..efd290b0668 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter1.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassConstructorParameter1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js index 9d2b4a690ab..c1869d6050b 100644 --- a/tests/baselines/reference/decoratorOnClassConstructorParameter4.js +++ b/tests/baselines/reference/decoratorOnClassConstructorParameter4.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassConstructorParameter4.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod1.js b/tests/baselines/reference/decoratorOnClassMethod1.js index 23be1094305..b13928ab75e 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.js +++ b/tests/baselines/reference/decoratorOnClassMethod1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod10.js b/tests/baselines/reference/decoratorOnClassMethod10.js index f87e3137777..5faf5f5adfd 100644 --- a/tests/baselines/reference/decoratorOnClassMethod10.js +++ b/tests/baselines/reference/decoratorOnClassMethod10.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod10.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod11.js b/tests/baselines/reference/decoratorOnClassMethod11.js index f8276de2fe3..2250eef2d88 100644 --- a/tests/baselines/reference/decoratorOnClassMethod11.js +++ b/tests/baselines/reference/decoratorOnClassMethod11.js @@ -9,7 +9,8 @@ module M { } //// [decoratorOnClassMethod11.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod12.js b/tests/baselines/reference/decoratorOnClassMethod12.js index 7f23947929c..36874663abd 100644 --- a/tests/baselines/reference/decoratorOnClassMethod12.js +++ b/tests/baselines/reference/decoratorOnClassMethod12.js @@ -16,7 +16,8 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod13.js b/tests/baselines/reference/decoratorOnClassMethod13.js index 4321bbb0156..36dfcf750c0 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.js +++ b/tests/baselines/reference/decoratorOnClassMethod13.js @@ -7,7 +7,8 @@ class C { } //// [decoratorOnClassMethod13.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod2.js b/tests/baselines/reference/decoratorOnClassMethod2.js index 33a22f419d4..7089c4701e4 100644 --- a/tests/baselines/reference/decoratorOnClassMethod2.js +++ b/tests/baselines/reference/decoratorOnClassMethod2.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod2.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod3.js b/tests/baselines/reference/decoratorOnClassMethod3.js index f93b7d7a6b2..6c09a14c1a3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod3.js +++ b/tests/baselines/reference/decoratorOnClassMethod3.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod3.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod4.js b/tests/baselines/reference/decoratorOnClassMethod4.js index 038432f2cf0..1e5f03a0ad4 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.js +++ b/tests/baselines/reference/decoratorOnClassMethod4.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod4.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod5.js b/tests/baselines/reference/decoratorOnClassMethod5.js index 460c11f145b..fd6520f99da 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.js +++ b/tests/baselines/reference/decoratorOnClassMethod5.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod5.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod6.js b/tests/baselines/reference/decoratorOnClassMethod6.js index 9f120599183..b99cacd6ca0 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.js +++ b/tests/baselines/reference/decoratorOnClassMethod6.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod6.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod7.js b/tests/baselines/reference/decoratorOnClassMethod7.js index 6ab01e68bba..e86480e9895 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.js +++ b/tests/baselines/reference/decoratorOnClassMethod7.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod7.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethod8.js b/tests/baselines/reference/decoratorOnClassMethod8.js index 3e88f8c2793..c9048ce30f3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod8.js +++ b/tests/baselines/reference/decoratorOnClassMethod8.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethod8.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.js b/tests/baselines/reference/decoratorOnClassMethodParameter1.js index d228ed9302b..3d62dfe3d96 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.js +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassMethodParameter1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty1.js b/tests/baselines/reference/decoratorOnClassProperty1.js index aa38252b995..45307cfc57e 100644 --- a/tests/baselines/reference/decoratorOnClassProperty1.js +++ b/tests/baselines/reference/decoratorOnClassProperty1.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty1.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty10.js b/tests/baselines/reference/decoratorOnClassProperty10.js index bccbc0bb737..1479d2033c9 100644 --- a/tests/baselines/reference/decoratorOnClassProperty10.js +++ b/tests/baselines/reference/decoratorOnClassProperty10.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty10.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty11.js b/tests/baselines/reference/decoratorOnClassProperty11.js index f31e40d3c40..e86c112f436 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.js +++ b/tests/baselines/reference/decoratorOnClassProperty11.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty11.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty2.js b/tests/baselines/reference/decoratorOnClassProperty2.js index 477320b40fa..fed6e57116e 100644 --- a/tests/baselines/reference/decoratorOnClassProperty2.js +++ b/tests/baselines/reference/decoratorOnClassProperty2.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty2.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty3.js b/tests/baselines/reference/decoratorOnClassProperty3.js index 05476c66e7d..0b81416b3fd 100644 --- a/tests/baselines/reference/decoratorOnClassProperty3.js +++ b/tests/baselines/reference/decoratorOnClassProperty3.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty3.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty6.js b/tests/baselines/reference/decoratorOnClassProperty6.js index 46e2d5fc069..740ad346aa3 100644 --- a/tests/baselines/reference/decoratorOnClassProperty6.js +++ b/tests/baselines/reference/decoratorOnClassProperty6.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty6.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/decoratorOnClassProperty7.js b/tests/baselines/reference/decoratorOnClassProperty7.js index 14ca0612cb1..1b34d5dac07 100644 --- a/tests/baselines/reference/decoratorOnClassProperty7.js +++ b/tests/baselines/reference/decoratorOnClassProperty7.js @@ -6,7 +6,8 @@ class C { } //// [decoratorOnClassProperty7.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js b/tests/baselines/reference/sourceMapValidationDecorators.js index 5577a6967cd..d5a63997ea7 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js +++ b/tests/baselines/reference/sourceMapValidationDecorators.js @@ -55,7 +55,8 @@ class Greeter { } //// [sourceMapValidationDecorators.js] -var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +var __decorate = this.__decorate || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js.map b/tests/baselines/reference/sourceMapValidationDecorators.js.map index 84ebad316fa..d0e29441661 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js.map +++ b/tests/baselines/reference/sourceMapValidationDecorators.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDecorators.js.map] -{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,UAGEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OAPAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,sBAEAA,0BAAKA;;YAFJA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;WACvBA,0BAAKA,kCAALA,0BAAKA,IAEJA;IAEDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACfA,sBAACA,EAASA;IAMlBA,sBAAQA,uBAAEA;;YACRA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WAFlBA,uBAAEA,kCAAFA,uBAAEA,IAKTA;IAEDA,sBAEIA,8BAASA;;YAFZA,kBAAkBA;YAClBA,kBAAkBA,CAACA,EAAEA,CAACA;YAMrBA,WAACA,mBAAmBA,CAAAA;YACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;WANtBA,8BAASA,kCAATA,8BAASA,IAEZA;IAfDA;QAACA,kBAAkBA;QAClBA,kBAAkBA,CAACA,EAAEA,CAACA;OACRA,aAAEA,EAAcA;IAzBnCA;QAACA,eAAeA;QACfA,eAAeA,CAACA,EAAEA,CAACA;QAGdA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;QAGxBA,WAACA,mBAAmBA,CAAAA;QACpBA,WAACA,mBAAmBA,CAACA,EAAEA,CAACA,CAAAA;gBAqC7BA;IAADA,cAACA;AAADA,CAACA,AA9CD,IA8CC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index f4c64c49579..cde46038669 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -8,7 +8,8 @@ sources: sourceMapValidationDecorators.ts emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js sourceFile:sourceMapValidationDecorators.ts ------------------------------------------------------------------- ->>>var __decorate = this.__decorate || (typeof Reflect === "object" && Reflect.decorate) || function (decorators, target, key, desc) { +>>>var __decorate = this.__decorate || function (decorators, target, key, desc) { +>>> if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); >>> switch (arguments.length) { >>> case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); >>> case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); @@ -27,7 +28,7 @@ sourceFile:sourceMapValidationDecorators.ts >declare function ParameterDecorator2(x: number): (target: Function, key: string | symbol, paramIndex: number) => void; > > -1 >Emitted(9, 1) Source(8, 1) + SourceIndex(0) +1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) --- >>> function Greeter(greeting) { 1->^^^^ @@ -42,9 +43,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(20) > public 3 > greeting: string -1->Emitted(10, 5) Source(11, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(10, 22) Source(14, 14) + SourceIndex(0) name (Greeter) -3 >Emitted(10, 30) Source(14, 30) + SourceIndex(0) name (Greeter) +1->Emitted(11, 5) Source(11, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(11, 22) Source(14, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(11, 30) Source(14, 30) + SourceIndex(0) name (Greeter) --- >>> var b = []; 1 >^^^^^^^^ @@ -56,8 +57,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(11, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(11, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(12, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(12, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> for (var _i = 1; _i < arguments.length; _i++) { 1->^^^^^^^^^^^^^ @@ -78,12 +79,12 @@ sourceFile:sourceMapValidationDecorators.ts 6 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1->Emitted(12, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(12, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(12, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(12, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(12, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -6 >Emitted(12, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1->Emitted(13, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(13, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(13, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(13, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(13, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +6 >Emitted(13, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> b[_i - 1] = arguments[_i]; 1 >^^^^^^^^^^^^ @@ -92,8 +93,8 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ParameterDecorator1 > @ParameterDecorator2(30) > ...b: string[] -1 >Emitted(13, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(13, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(14, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(14, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor) --- >>> } >>> this.greeting = greeting; @@ -107,11 +108,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > 4 > greeting 5 > : string -1 >Emitted(15, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(15, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -3 >Emitted(15, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) -4 >Emitted(15, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) -5 >Emitted(15, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(16, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(16, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +3 >Emitted(16, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor) +4 >Emitted(16, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor) +5 >Emitted(16, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor) --- >>> } 1 >^^^^ @@ -124,8 +125,8 @@ sourceFile:sourceMapValidationDecorators.ts > ...b: string[]) { > 2 > } -1 >Emitted(16, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) -2 >Emitted(16, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) +1 >Emitted(17, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor) +2 >Emitted(17, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor) --- >>> Greeter.prototype.greet = function () { 1->^^^^ @@ -139,9 +140,9 @@ sourceFile:sourceMapValidationDecorators.ts > 2 > greet 3 > -1->Emitted(17, 5) Source(23, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(17, 28) Source(23, 10) + SourceIndex(0) name (Greeter) -3 >Emitted(17, 31) Source(21, 5) + SourceIndex(0) name (Greeter) +1->Emitted(18, 5) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(18, 28) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(18, 31) Source(21, 5) + SourceIndex(0) name (Greeter) --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^ @@ -169,17 +170,17 @@ sourceFile:sourceMapValidationDecorators.ts 9 > + 10> "" 11> ; -1->Emitted(18, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(18, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) -3 >Emitted(18, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) -4 >Emitted(18, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) -5 >Emitted(18, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) -6 >Emitted(18, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) -7 >Emitted(18, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) -8 >Emitted(18, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) -9 >Emitted(18, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) -10>Emitted(18, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) -11>Emitted(18, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) +1->Emitted(19, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(19, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet) +3 >Emitted(19, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet) +4 >Emitted(19, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet) +5 >Emitted(19, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet) +6 >Emitted(19, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet) +7 >Emitted(19, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet) +8 >Emitted(19, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet) +9 >Emitted(19, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet) +10>Emitted(19, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet) +11>Emitted(19, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet) --- >>> }; 1 >^^^^ @@ -188,8 +189,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(19, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) -2 >Emitted(19, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) +1 >Emitted(20, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet) +2 >Emitted(20, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet) --- >>> Greeter.prototype.fn = function (x) { 1->^^^^ @@ -215,11 +216,11 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(70) > 5 > x: number -1->Emitted(20, 5) Source(35, 13) + SourceIndex(0) name (Greeter) -2 >Emitted(20, 25) Source(35, 15) + SourceIndex(0) name (Greeter) -3 >Emitted(20, 28) Source(35, 5) + SourceIndex(0) name (Greeter) -4 >Emitted(20, 38) Source(38, 7) + SourceIndex(0) name (Greeter) -5 >Emitted(20, 39) Source(38, 16) + SourceIndex(0) name (Greeter) +1->Emitted(21, 5) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(21, 25) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(21, 28) Source(35, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(21, 38) Source(38, 7) + SourceIndex(0) name (Greeter) +5 >Emitted(21, 39) Source(38, 16) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1 >^^^^^^^^ @@ -237,13 +238,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1 >Emitted(21, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(21, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) -3 >Emitted(21, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) -4 >Emitted(21, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) -5 >Emitted(21, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) -6 >Emitted(21, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) -7 >Emitted(21, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(22, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(22, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn) +3 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn) +4 >Emitted(22, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn) +5 >Emitted(22, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn) +6 >Emitted(22, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn) +7 >Emitted(22, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn) --- >>> }; 1 >^^^^ @@ -252,8 +253,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(22, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) -2 >Emitted(22, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) +1 >Emitted(23, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn) +2 >Emitted(23, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn) --- >>> Object.defineProperty(Greeter.prototype, "greetings", { 1->^^^^ @@ -266,15 +267,15 @@ sourceFile:sourceMapValidationDecorators.ts > @PropertyDecorator2(80) > get 3 > greetings -1->Emitted(23, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(23, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(23, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +1->Emitted(24, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(24, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(24, 57) Source(44, 18) + SourceIndex(0) name (Greeter) --- >>> get: function () { 1 >^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(24, 14) Source(42, 5) + SourceIndex(0) name (Greeter) +1 >Emitted(25, 14) Source(42, 5) + SourceIndex(0) name (Greeter) --- >>> return this.greeting; 1->^^^^^^^^^^^^ @@ -294,13 +295,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > . 6 > greeting 7 > ; -1->Emitted(25, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(25, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(25, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(25, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(25, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(25, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(25, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(26, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(26, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(26, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(26, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(26, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(26, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(26, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -309,8 +310,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(26, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(26, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(27, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(27, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> set: function (greetings) { 1->^^^^^^^^^^^^^ @@ -325,9 +326,9 @@ sourceFile:sourceMapValidationDecorators.ts > @ParameterDecorator2(90) > 3 > greetings: string -1->Emitted(27, 14) Source(48, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(27, 24) Source(51, 7) + SourceIndex(0) name (Greeter) -3 >Emitted(27, 33) Source(51, 24) + SourceIndex(0) name (Greeter) +1->Emitted(28, 14) Source(48, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(28, 24) Source(51, 7) + SourceIndex(0) name (Greeter) +3 >Emitted(28, 33) Source(51, 24) + SourceIndex(0) name (Greeter) --- >>> this.greeting = greetings; 1->^^^^^^^^^^^^ @@ -345,13 +346,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > = 6 > greetings 7 > ; -1->Emitted(28, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(28, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) -3 >Emitted(28, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) -4 >Emitted(28, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) -5 >Emitted(28, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) -6 >Emitted(28, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) -7 >Emitted(28, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) +1->Emitted(29, 13) Source(52, 9) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(29, 17) Source(52, 13) + SourceIndex(0) name (Greeter.greetings) +3 >Emitted(29, 18) Source(52, 14) + SourceIndex(0) name (Greeter.greetings) +4 >Emitted(29, 26) Source(52, 22) + SourceIndex(0) name (Greeter.greetings) +5 >Emitted(29, 29) Source(52, 25) + SourceIndex(0) name (Greeter.greetings) +6 >Emitted(29, 38) Source(52, 34) + SourceIndex(0) name (Greeter.greetings) +7 >Emitted(29, 39) Source(52, 35) + SourceIndex(0) name (Greeter.greetings) --- >>> }, 1 >^^^^^^^^ @@ -360,8 +361,8 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > 2 > } -1 >Emitted(29, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) -2 >Emitted(29, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) +1 >Emitted(30, 9) Source(53, 5) + SourceIndex(0) name (Greeter.greetings) +2 >Emitted(30, 10) Source(53, 6) + SourceIndex(0) name (Greeter.greetings) --- >>> enumerable: true, >>> configurable: true @@ -369,7 +370,7 @@ sourceFile:sourceMapValidationDecorators.ts 1->^^^^^^^ 2 > ^^^^^^^^^^^^^^-> 1-> -1->Emitted(32, 8) Source(46, 6) + SourceIndex(0) name (Greeter) +1->Emitted(33, 8) Source(46, 6) + SourceIndex(0) name (Greeter) --- >>> Greeter.x1 = 10; 1->^^^^ @@ -383,11 +384,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > : number = 4 > 10 5 > ; -1->Emitted(33, 5) Source(33, 20) + SourceIndex(0) name (Greeter) -2 >Emitted(33, 15) Source(33, 22) + SourceIndex(0) name (Greeter) -3 >Emitted(33, 18) Source(33, 33) + SourceIndex(0) name (Greeter) -4 >Emitted(33, 20) Source(33, 35) + SourceIndex(0) name (Greeter) -5 >Emitted(33, 21) Source(33, 36) + SourceIndex(0) name (Greeter) +1->Emitted(34, 5) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(34, 15) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(34, 18) Source(33, 33) + SourceIndex(0) name (Greeter) +4 >Emitted(34, 20) Source(33, 35) + SourceIndex(0) name (Greeter) +5 >Emitted(34, 21) Source(33, 36) + SourceIndex(0) name (Greeter) --- >>> Object.defineProperty(Greeter.prototype, "greet", 1->^^^^ @@ -398,9 +399,9 @@ sourceFile:sourceMapValidationDecorators.ts > @PropertyDecorator2(40) > 3 > greet -1->Emitted(34, 5) Source(21, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(34, 27) Source(23, 5) + SourceIndex(0) name (Greeter) -3 >Emitted(34, 53) Source(23, 10) + SourceIndex(0) name (Greeter) +1->Emitted(35, 5) Source(21, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(35, 27) Source(23, 5) + SourceIndex(0) name (Greeter) +3 >Emitted(35, 53) Source(23, 10) + SourceIndex(0) name (Greeter) --- >>> __decorate([ >>> PropertyDecorator1, @@ -409,8 +410,8 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^^^-> 1 > 2 > PropertyDecorator1 -1 >Emitted(36, 13) Source(21, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(36, 31) Source(21, 24) + SourceIndex(0) name (Greeter) +1 >Emitted(37, 13) Source(21, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(37, 31) Source(21, 24) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator2(40) 1->^^^^^^^^^^^^ @@ -425,11 +426,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ( 4 > 40 5 > ) -1->Emitted(37, 13) Source(22, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(37, 31) Source(22, 24) + SourceIndex(0) name (Greeter) -3 >Emitted(37, 32) Source(22, 25) + SourceIndex(0) name (Greeter) -4 >Emitted(37, 34) Source(22, 27) + SourceIndex(0) name (Greeter) -5 >Emitted(37, 35) Source(22, 28) + SourceIndex(0) name (Greeter) +1->Emitted(38, 13) Source(22, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(38, 31) Source(22, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(38, 32) Source(22, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(38, 34) Source(22, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(38, 35) Source(22, 28) + SourceIndex(0) name (Greeter) --- >>> ], Greeter.prototype, "greet", Object.getOwnPropertyDescriptor(Greeter.prototype, "greet"))); 1->^^^^^^^^^^^ @@ -445,11 +446,11 @@ sourceFile:sourceMapValidationDecorators.ts 5 > () { > return "

" + this.greeting + "

"; > } -1->Emitted(38, 12) Source(23, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(38, 38) Source(23, 10) + SourceIndex(0) name (Greeter) -3 >Emitted(38, 72) Source(23, 5) + SourceIndex(0) name (Greeter) -4 >Emitted(38, 98) Source(23, 10) + SourceIndex(0) name (Greeter) -5 >Emitted(38, 102) Source(25, 6) + SourceIndex(0) name (Greeter) +1->Emitted(39, 12) Source(23, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(39, 38) Source(23, 10) + SourceIndex(0) name (Greeter) +3 >Emitted(39, 72) Source(23, 5) + SourceIndex(0) name (Greeter) +4 >Emitted(39, 98) Source(23, 10) + SourceIndex(0) name (Greeter) +5 >Emitted(39, 102) Source(25, 6) + SourceIndex(0) name (Greeter) --- >>> __decorate([ 1 >^^^^ @@ -457,7 +458,7 @@ sourceFile:sourceMapValidationDecorators.ts 1 > > > -1 >Emitted(39, 5) Source(27, 5) + SourceIndex(0) name (Greeter) +1 >Emitted(40, 5) Source(27, 5) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator1, 1->^^^^^^^^ @@ -465,8 +466,8 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^^^-> 1->@ 2 > PropertyDecorator1 -1->Emitted(40, 9) Source(27, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(40, 27) Source(27, 24) + SourceIndex(0) name (Greeter) +1->Emitted(41, 9) Source(27, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(41, 27) Source(27, 24) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator2(50) 1->^^^^^^^^ @@ -481,11 +482,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ( 4 > 50 5 > ) -1->Emitted(41, 9) Source(28, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(41, 27) Source(28, 24) + SourceIndex(0) name (Greeter) -3 >Emitted(41, 28) Source(28, 25) + SourceIndex(0) name (Greeter) -4 >Emitted(41, 30) Source(28, 27) + SourceIndex(0) name (Greeter) -5 >Emitted(41, 31) Source(28, 28) + SourceIndex(0) name (Greeter) +1->Emitted(42, 9) Source(28, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(42, 27) Source(28, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(42, 28) Source(28, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(42, 30) Source(28, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(42, 31) Source(28, 28) + SourceIndex(0) name (Greeter) --- >>> ], Greeter.prototype, "x"); 1->^^^^^^^ @@ -496,9 +497,9 @@ sourceFile:sourceMapValidationDecorators.ts > private 2 > x 3 > : string; -1->Emitted(42, 8) Source(29, 13) + SourceIndex(0) name (Greeter) -2 >Emitted(42, 30) Source(29, 14) + SourceIndex(0) name (Greeter) -3 >Emitted(42, 32) Source(29, 23) + SourceIndex(0) name (Greeter) +1->Emitted(43, 8) Source(29, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(43, 30) Source(29, 14) + SourceIndex(0) name (Greeter) +3 >Emitted(43, 32) Source(29, 23) + SourceIndex(0) name (Greeter) --- >>> Object.defineProperty(Greeter.prototype, "fn", 1->^^^^ @@ -513,9 +514,9 @@ sourceFile:sourceMapValidationDecorators.ts > 2 > private 3 > fn -1->Emitted(43, 5) Source(35, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(43, 27) Source(35, 13) + SourceIndex(0) name (Greeter) -3 >Emitted(43, 50) Source(35, 15) + SourceIndex(0) name (Greeter) +1->Emitted(44, 5) Source(35, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(44, 27) Source(35, 13) + SourceIndex(0) name (Greeter) +3 >Emitted(44, 50) Source(35, 15) + SourceIndex(0) name (Greeter) --- >>> __decorate([ >>> __param(0, ParameterDecorator1), @@ -529,10 +530,10 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ 3 > ParameterDecorator1 4 > -1 >Emitted(45, 13) Source(36, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(45, 24) Source(36, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(45, 43) Source(36, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(45, 44) Source(36, 27) + SourceIndex(0) name (Greeter) +1 >Emitted(46, 13) Source(36, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(46, 24) Source(36, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(46, 43) Source(36, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(46, 44) Source(36, 27) + SourceIndex(0) name (Greeter) --- >>> __param(0, ParameterDecorator2(70)) 1->^^^^^^^^^^^^ @@ -551,13 +552,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > 70 6 > ) 7 > -1->Emitted(46, 13) Source(37, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(46, 24) Source(37, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(46, 43) Source(37, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(46, 44) Source(37, 28) + SourceIndex(0) name (Greeter) -5 >Emitted(46, 46) Source(37, 30) + SourceIndex(0) name (Greeter) -6 >Emitted(46, 47) Source(37, 31) + SourceIndex(0) name (Greeter) -7 >Emitted(46, 48) Source(37, 31) + SourceIndex(0) name (Greeter) +1->Emitted(47, 13) Source(37, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(47, 24) Source(37, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(47, 43) Source(37, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(47, 44) Source(37, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(47, 46) Source(37, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(47, 47) Source(37, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(47, 48) Source(37, 31) + SourceIndex(0) name (Greeter) --- >>> ], Greeter.prototype, "fn", Object.getOwnPropertyDescriptor(Greeter.prototype, "fn"))); 1->^^^^^^^^^^^ @@ -575,11 +576,11 @@ sourceFile:sourceMapValidationDecorators.ts > x: number) { > return this.greeting; > } -1->Emitted(47, 12) Source(35, 13) + SourceIndex(0) name (Greeter) -2 >Emitted(47, 35) Source(35, 15) + SourceIndex(0) name (Greeter) -3 >Emitted(47, 69) Source(35, 13) + SourceIndex(0) name (Greeter) -4 >Emitted(47, 92) Source(35, 15) + SourceIndex(0) name (Greeter) -5 >Emitted(47, 96) Source(40, 6) + SourceIndex(0) name (Greeter) +1->Emitted(48, 12) Source(35, 13) + SourceIndex(0) name (Greeter) +2 >Emitted(48, 35) Source(35, 15) + SourceIndex(0) name (Greeter) +3 >Emitted(48, 69) Source(35, 13) + SourceIndex(0) name (Greeter) +4 >Emitted(48, 92) Source(35, 15) + SourceIndex(0) name (Greeter) +5 >Emitted(48, 96) Source(40, 6) + SourceIndex(0) name (Greeter) --- >>> Object.defineProperty(Greeter.prototype, "greetings", 1 >^^^^ @@ -592,9 +593,9 @@ sourceFile:sourceMapValidationDecorators.ts > @PropertyDecorator2(80) > get 3 > greetings -1 >Emitted(48, 5) Source(42, 5) + SourceIndex(0) name (Greeter) -2 >Emitted(48, 27) Source(44, 9) + SourceIndex(0) name (Greeter) -3 >Emitted(48, 57) Source(44, 18) + SourceIndex(0) name (Greeter) +1 >Emitted(49, 5) Source(42, 5) + SourceIndex(0) name (Greeter) +2 >Emitted(49, 27) Source(44, 9) + SourceIndex(0) name (Greeter) +3 >Emitted(49, 57) Source(44, 18) + SourceIndex(0) name (Greeter) --- >>> __decorate([ >>> PropertyDecorator1, @@ -603,8 +604,8 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^^^^-> 1 > 2 > PropertyDecorator1 -1 >Emitted(50, 13) Source(42, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(50, 31) Source(42, 24) + SourceIndex(0) name (Greeter) +1 >Emitted(51, 13) Source(42, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(51, 31) Source(42, 24) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator2(80), 1->^^^^^^^^^^^^ @@ -619,11 +620,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ( 4 > 80 5 > ) -1->Emitted(51, 13) Source(43, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(51, 31) Source(43, 24) + SourceIndex(0) name (Greeter) -3 >Emitted(51, 32) Source(43, 25) + SourceIndex(0) name (Greeter) -4 >Emitted(51, 34) Source(43, 27) + SourceIndex(0) name (Greeter) -5 >Emitted(51, 35) Source(43, 28) + SourceIndex(0) name (Greeter) +1->Emitted(52, 13) Source(43, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(52, 31) Source(43, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(52, 32) Source(43, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(52, 34) Source(43, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(52, 35) Source(43, 28) + SourceIndex(0) name (Greeter) --- >>> __param(0, ParameterDecorator1), 1->^^^^^^^^^^^^ @@ -641,10 +642,10 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ 3 > ParameterDecorator1 4 > -1->Emitted(52, 13) Source(49, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(52, 24) Source(49, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(52, 43) Source(49, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(52, 44) Source(49, 27) + SourceIndex(0) name (Greeter) +1->Emitted(53, 13) Source(49, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(53, 24) Source(49, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(53, 43) Source(49, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(53, 44) Source(49, 27) + SourceIndex(0) name (Greeter) --- >>> __param(0, ParameterDecorator2(90)) 1->^^^^^^^^^^^^ @@ -663,13 +664,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > 90 6 > ) 7 > -1->Emitted(53, 13) Source(50, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(53, 24) Source(50, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(53, 43) Source(50, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(53, 44) Source(50, 28) + SourceIndex(0) name (Greeter) -5 >Emitted(53, 46) Source(50, 30) + SourceIndex(0) name (Greeter) -6 >Emitted(53, 47) Source(50, 31) + SourceIndex(0) name (Greeter) -7 >Emitted(53, 48) Source(50, 31) + SourceIndex(0) name (Greeter) +1->Emitted(54, 13) Source(50, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(54, 24) Source(50, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(54, 43) Source(50, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(54, 44) Source(50, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(54, 46) Source(50, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(54, 47) Source(50, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(54, 48) Source(50, 31) + SourceIndex(0) name (Greeter) --- >>> ], Greeter.prototype, "greetings", Object.getOwnPropertyDescriptor(Greeter.prototype, "greetings"))); 1->^^^^^^^^^^^ @@ -684,17 +685,17 @@ sourceFile:sourceMapValidationDecorators.ts 5 > () { > return this.greeting; > } -1->Emitted(54, 12) Source(44, 9) + SourceIndex(0) name (Greeter) -2 >Emitted(54, 42) Source(44, 18) + SourceIndex(0) name (Greeter) -3 >Emitted(54, 76) Source(44, 9) + SourceIndex(0) name (Greeter) -4 >Emitted(54, 106) Source(44, 18) + SourceIndex(0) name (Greeter) -5 >Emitted(54, 110) Source(46, 6) + SourceIndex(0) name (Greeter) +1->Emitted(55, 12) Source(44, 9) + SourceIndex(0) name (Greeter) +2 >Emitted(55, 42) Source(44, 18) + SourceIndex(0) name (Greeter) +3 >Emitted(55, 76) Source(44, 9) + SourceIndex(0) name (Greeter) +4 >Emitted(55, 106) Source(44, 18) + SourceIndex(0) name (Greeter) +5 >Emitted(55, 110) Source(46, 6) + SourceIndex(0) name (Greeter) --- >>> __decorate([ 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(55, 5) Source(31, 5) + SourceIndex(0) name (Greeter) +1 >Emitted(56, 5) Source(31, 5) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator1, 1->^^^^^^^^ @@ -702,8 +703,8 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^^^-> 1->@ 2 > PropertyDecorator1 -1->Emitted(56, 9) Source(31, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(56, 27) Source(31, 24) + SourceIndex(0) name (Greeter) +1->Emitted(57, 9) Source(31, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(57, 27) Source(31, 24) + SourceIndex(0) name (Greeter) --- >>> PropertyDecorator2(60) 1->^^^^^^^^ @@ -717,11 +718,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ( 4 > 60 5 > ) -1->Emitted(57, 9) Source(32, 6) + SourceIndex(0) name (Greeter) -2 >Emitted(57, 27) Source(32, 24) + SourceIndex(0) name (Greeter) -3 >Emitted(57, 28) Source(32, 25) + SourceIndex(0) name (Greeter) -4 >Emitted(57, 30) Source(32, 27) + SourceIndex(0) name (Greeter) -5 >Emitted(57, 31) Source(32, 28) + SourceIndex(0) name (Greeter) +1->Emitted(58, 9) Source(32, 6) + SourceIndex(0) name (Greeter) +2 >Emitted(58, 27) Source(32, 24) + SourceIndex(0) name (Greeter) +3 >Emitted(58, 28) Source(32, 25) + SourceIndex(0) name (Greeter) +4 >Emitted(58, 30) Source(32, 27) + SourceIndex(0) name (Greeter) +5 >Emitted(58, 31) Source(32, 28) + SourceIndex(0) name (Greeter) --- >>> ], Greeter, "x1"); 1 >^^^^^^^ @@ -732,15 +733,15 @@ sourceFile:sourceMapValidationDecorators.ts > private static 2 > x1 3 > : number = 10; -1 >Emitted(58, 8) Source(33, 20) + SourceIndex(0) name (Greeter) -2 >Emitted(58, 21) Source(33, 22) + SourceIndex(0) name (Greeter) -3 >Emitted(58, 23) Source(33, 36) + SourceIndex(0) name (Greeter) +1 >Emitted(59, 8) Source(33, 20) + SourceIndex(0) name (Greeter) +2 >Emitted(59, 21) Source(33, 22) + SourceIndex(0) name (Greeter) +3 >Emitted(59, 23) Source(33, 36) + SourceIndex(0) name (Greeter) --- >>> Greeter = __decorate([ 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^-> 1-> -1->Emitted(59, 5) Source(8, 1) + SourceIndex(0) name (Greeter) +1->Emitted(60, 5) Source(8, 1) + SourceIndex(0) name (Greeter) --- >>> ClassDecorator1, 1->^^^^^^^^ @@ -748,8 +749,8 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ^^^^^^-> 1->@ 2 > ClassDecorator1 -1->Emitted(60, 9) Source(8, 2) + SourceIndex(0) name (Greeter) -2 >Emitted(60, 24) Source(8, 17) + SourceIndex(0) name (Greeter) +1->Emitted(61, 9) Source(8, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(61, 24) Source(8, 17) + SourceIndex(0) name (Greeter) --- >>> ClassDecorator2(10), 1->^^^^^^^^ @@ -764,11 +765,11 @@ sourceFile:sourceMapValidationDecorators.ts 3 > ( 4 > 10 5 > ) -1->Emitted(61, 9) Source(9, 2) + SourceIndex(0) name (Greeter) -2 >Emitted(61, 24) Source(9, 17) + SourceIndex(0) name (Greeter) -3 >Emitted(61, 25) Source(9, 18) + SourceIndex(0) name (Greeter) -4 >Emitted(61, 27) Source(9, 20) + SourceIndex(0) name (Greeter) -5 >Emitted(61, 28) Source(9, 21) + SourceIndex(0) name (Greeter) +1->Emitted(62, 9) Source(9, 2) + SourceIndex(0) name (Greeter) +2 >Emitted(62, 24) Source(9, 17) + SourceIndex(0) name (Greeter) +3 >Emitted(62, 25) Source(9, 18) + SourceIndex(0) name (Greeter) +4 >Emitted(62, 27) Source(9, 20) + SourceIndex(0) name (Greeter) +5 >Emitted(62, 28) Source(9, 21) + SourceIndex(0) name (Greeter) --- >>> __param(0, ParameterDecorator1), 1->^^^^^^^^ @@ -783,10 +784,10 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ 3 > ParameterDecorator1 4 > -1->Emitted(62, 9) Source(12, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(62, 20) Source(12, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(62, 39) Source(12, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(62, 40) Source(12, 27) + SourceIndex(0) name (Greeter) +1->Emitted(63, 9) Source(12, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(63, 20) Source(12, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(63, 39) Source(12, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(63, 40) Source(12, 27) + SourceIndex(0) name (Greeter) --- >>> __param(0, ParameterDecorator2(20)), 1->^^^^^^^^ @@ -804,13 +805,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > 20 6 > ) 7 > -1->Emitted(63, 9) Source(13, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(63, 20) Source(13, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(63, 39) Source(13, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(63, 40) Source(13, 28) + SourceIndex(0) name (Greeter) -5 >Emitted(63, 42) Source(13, 30) + SourceIndex(0) name (Greeter) -6 >Emitted(63, 43) Source(13, 31) + SourceIndex(0) name (Greeter) -7 >Emitted(63, 44) Source(13, 31) + SourceIndex(0) name (Greeter) +1->Emitted(64, 9) Source(13, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(64, 20) Source(13, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(64, 39) Source(13, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(64, 40) Source(13, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(64, 42) Source(13, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(64, 43) Source(13, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(64, 44) Source(13, 31) + SourceIndex(0) name (Greeter) --- >>> __param(1, ParameterDecorator1), 1 >^^^^^^^^ @@ -825,10 +826,10 @@ sourceFile:sourceMapValidationDecorators.ts 2 > @ 3 > ParameterDecorator1 4 > -1 >Emitted(64, 9) Source(16, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(64, 20) Source(16, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(64, 39) Source(16, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(64, 40) Source(16, 27) + SourceIndex(0) name (Greeter) +1 >Emitted(65, 9) Source(16, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(65, 20) Source(16, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(65, 39) Source(16, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(65, 40) Source(16, 27) + SourceIndex(0) name (Greeter) --- >>> __param(1, ParameterDecorator2(30)) 1->^^^^^^^^ @@ -846,13 +847,13 @@ sourceFile:sourceMapValidationDecorators.ts 5 > 30 6 > ) 7 > -1->Emitted(65, 9) Source(17, 7) + SourceIndex(0) name (Greeter) -2 >Emitted(65, 20) Source(17, 8) + SourceIndex(0) name (Greeter) -3 >Emitted(65, 39) Source(17, 27) + SourceIndex(0) name (Greeter) -4 >Emitted(65, 40) Source(17, 28) + SourceIndex(0) name (Greeter) -5 >Emitted(65, 42) Source(17, 30) + SourceIndex(0) name (Greeter) -6 >Emitted(65, 43) Source(17, 31) + SourceIndex(0) name (Greeter) -7 >Emitted(65, 44) Source(17, 31) + SourceIndex(0) name (Greeter) +1->Emitted(66, 9) Source(17, 7) + SourceIndex(0) name (Greeter) +2 >Emitted(66, 20) Source(17, 8) + SourceIndex(0) name (Greeter) +3 >Emitted(66, 39) Source(17, 27) + SourceIndex(0) name (Greeter) +4 >Emitted(66, 40) Source(17, 28) + SourceIndex(0) name (Greeter) +5 >Emitted(66, 42) Source(17, 30) + SourceIndex(0) name (Greeter) +6 >Emitted(66, 43) Source(17, 31) + SourceIndex(0) name (Greeter) +7 >Emitted(66, 44) Source(17, 31) + SourceIndex(0) name (Greeter) --- >>> ], Greeter); 1 >^^^^^^^^^^^^^^^^ @@ -895,15 +896,15 @@ sourceFile:sourceMapValidationDecorators.ts > this.greeting = greetings; > } >} -1 >Emitted(66, 17) Source(54, 2) + SourceIndex(0) name (Greeter) +1 >Emitted(67, 17) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>> return Greeter; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(67, 5) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(67, 19) Source(54, 2) + SourceIndex(0) name (Greeter) +1->Emitted(68, 5) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(68, 19) Source(54, 2) + SourceIndex(0) name (Greeter) --- >>>})(); 1 > @@ -961,9 +962,9 @@ sourceFile:sourceMapValidationDecorators.ts > this.greeting = greetings; > } > } -1 >Emitted(68, 1) Source(54, 1) + SourceIndex(0) name (Greeter) -2 >Emitted(68, 2) Source(54, 2) + SourceIndex(0) name (Greeter) -3 >Emitted(68, 2) Source(8, 1) + SourceIndex(0) -4 >Emitted(68, 6) Source(54, 2) + SourceIndex(0) +1 >Emitted(69, 1) Source(54, 1) + SourceIndex(0) name (Greeter) +2 >Emitted(69, 2) Source(54, 2) + SourceIndex(0) name (Greeter) +3 >Emitted(69, 2) Source(8, 1) + SourceIndex(0) +4 >Emitted(69, 6) Source(54, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDecorators.js.map \ No newline at end of file From 3657d99a5e68f4e0df18ccb6640164e5862723de Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 21 Apr 2015 16:46:37 -0700 Subject: [PATCH 10/13] Updated LKG --- bin/lib.d.ts | 46 +++++++------- bin/lib.dom.d.ts | 46 +++++++------- bin/lib.es6.d.ts | 46 +++++++------- bin/tsc.js | 107 ++++++++++++++++++++++----------- bin/tsserver.js | 110 ++++++++++++++++++++++----------- bin/typescript.d.ts | 1 + bin/typescript.js | 117 ++++++++++++++++++++++++------------ bin/typescriptServices.d.ts | 1 + bin/typescriptServices.js | 117 ++++++++++++++++++++++++------------ 9 files changed, 370 insertions(+), 221 deletions(-) diff --git a/bin/lib.d.ts b/bin/lib.d.ts index 82a6fa8345c..5eaa933d164 100644 --- a/bin/lib.d.ts +++ b/bin/lib.d.ts @@ -13878,7 +13878,7 @@ interface SourceBuffer extends EventTarget { videoTracks: VideoTrackList; abort(): void; appendBuffer(data: ArrayBuffer): void; - appendBuffer(data: any): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; remove(start: number, end: number): void; } @@ -13986,31 +13986,31 @@ declare var StyleSheetPageList: { } interface SubtleCrypto { - decrypt(algorithm: string, key: CryptoKey, data: any): any; - decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - digest(algorithm: string, data: any): any; - digest(algorithm: Algorithm, data: any): any; - encrypt(algorithm: string, key: CryptoKey, data: any): any; - encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; exportKey(format: string, key: CryptoKey): any; generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - sign(algorithm: string, key: CryptoKey, data: any): any; - sign(algorithm: Algorithm, key: CryptoKey, data: any): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - verify(algorithm: string, key: CryptoKey, signature: any, data: any): any; - verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; } @@ -14522,9 +14522,9 @@ interface WebGLRenderingContext { blendFunc(sfactor: number, dfactor: number): void; blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; bufferData(target: number, size: any, usage: number): void; - bufferData(target: number, size: any, usage: number): void; - bufferSubData(target: number, offset: number, data: any): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; bufferSubData(target: number, offset: number, data: any): void; checkFramebufferStatus(target: number): number; clear(mask: number): void; @@ -14533,8 +14533,8 @@ interface WebGLRenderingContext { clearStencil(s: number): void; colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; compileShader(shader: WebGLShader): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; createBuffer(): WebGLBuffer; @@ -14602,7 +14602,7 @@ interface WebGLRenderingContext { linkProgram(program: WebGLProgram): void; pixelStorei(pname: number, param: number): void; polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; sampleCoverage(value: number, invert: boolean): void; scissor(x: number, y: number, width: number, height: number): void; @@ -16026,7 +16026,7 @@ interface NodeSelector { } interface RandomSource { - getRandomValues(array: any): any; + getRandomValues(array: ArrayBufferView): ArrayBufferView; } interface SVGAnimatedPathData { diff --git a/bin/lib.dom.d.ts b/bin/lib.dom.d.ts index d66afb9b27f..2c970a1cf52 100644 --- a/bin/lib.dom.d.ts +++ b/bin/lib.dom.d.ts @@ -12708,7 +12708,7 @@ interface SourceBuffer extends EventTarget { videoTracks: VideoTrackList; abort(): void; appendBuffer(data: ArrayBuffer): void; - appendBuffer(data: any): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; remove(start: number, end: number): void; } @@ -12816,31 +12816,31 @@ declare var StyleSheetPageList: { } interface SubtleCrypto { - decrypt(algorithm: string, key: CryptoKey, data: any): any; - decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - digest(algorithm: string, data: any): any; - digest(algorithm: Algorithm, data: any): any; - encrypt(algorithm: string, key: CryptoKey, data: any): any; - encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; exportKey(format: string, key: CryptoKey): any; generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - sign(algorithm: string, key: CryptoKey, data: any): any; - sign(algorithm: Algorithm, key: CryptoKey, data: any): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - verify(algorithm: string, key: CryptoKey, signature: any, data: any): any; - verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; } @@ -13352,9 +13352,9 @@ interface WebGLRenderingContext { blendFunc(sfactor: number, dfactor: number): void; blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; bufferData(target: number, size: any, usage: number): void; - bufferData(target: number, size: any, usage: number): void; - bufferSubData(target: number, offset: number, data: any): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; bufferSubData(target: number, offset: number, data: any): void; checkFramebufferStatus(target: number): number; clear(mask: number): void; @@ -13363,8 +13363,8 @@ interface WebGLRenderingContext { clearStencil(s: number): void; colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; compileShader(shader: WebGLShader): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; createBuffer(): WebGLBuffer; @@ -13432,7 +13432,7 @@ interface WebGLRenderingContext { linkProgram(program: WebGLProgram): void; pixelStorei(pname: number, param: number): void; polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; sampleCoverage(value: number, invert: boolean): void; scissor(x: number, y: number, width: number, height: number): void; @@ -14856,7 +14856,7 @@ interface NodeSelector { } interface RandomSource { - getRandomValues(array: any): any; + getRandomValues(array: ArrayBufferView): ArrayBufferView; } interface SVGAnimatedPathData { diff --git a/bin/lib.es6.d.ts b/bin/lib.es6.d.ts index e2a76a04ae2..297cac973e3 100644 --- a/bin/lib.es6.d.ts +++ b/bin/lib.es6.d.ts @@ -15356,7 +15356,7 @@ interface SourceBuffer extends EventTarget { videoTracks: VideoTrackList; abort(): void; appendBuffer(data: ArrayBuffer): void; - appendBuffer(data: any): void; + appendBuffer(data: ArrayBufferView): void; appendStream(stream: MSStream, maxSize?: number): void; remove(start: number, end: number): void; } @@ -15464,31 +15464,31 @@ declare var StyleSheetPageList: { } interface SubtleCrypto { - decrypt(algorithm: string, key: CryptoKey, data: any): any; - decrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; - digest(algorithm: string, data: any): any; - digest(algorithm: Algorithm, data: any): any; - encrypt(algorithm: string, key: CryptoKey, data: any): any; - encrypt(algorithm: Algorithm, key: CryptoKey, data: any): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; exportKey(format: string, key: CryptoKey): any; generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: string, extractable: boolean, keyUsages: string[]): any; - importKey(format: string, keyData: any, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - sign(algorithm: string, key: CryptoKey, data: any): any; - sign(algorithm: Algorithm, key: CryptoKey, data: any): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; - unwrapKey(format: string, wrappedKey: any, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; - verify(algorithm: string, key: CryptoKey, signature: any, data: any): any; - verify(algorithm: Algorithm, key: CryptoKey, signature: any, data: any): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; } @@ -16000,9 +16000,9 @@ interface WebGLRenderingContext { blendFunc(sfactor: number, dfactor: number): void; blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; bufferData(target: number, size: any, usage: number): void; - bufferData(target: number, size: any, usage: number): void; - bufferSubData(target: number, offset: number, data: any): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; bufferSubData(target: number, offset: number, data: any): void; checkFramebufferStatus(target: number): number; clear(mask: number): void; @@ -16011,8 +16011,8 @@ interface WebGLRenderingContext { clearStencil(s: number): void; colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; compileShader(shader: WebGLShader): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: any): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: any): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; createBuffer(): WebGLBuffer; @@ -16080,7 +16080,7 @@ interface WebGLRenderingContext { linkProgram(program: WebGLProgram): void; pixelStorei(pname: number, param: number): void; polygonOffset(factor: number, units: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: any): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; sampleCoverage(value: number, invert: boolean): void; scissor(x: number, y: number, width: number, height: number): void; @@ -17504,7 +17504,7 @@ interface NodeSelector { } interface RandomSource { - getRandomValues(array: any): any; + getRandomValues(array: ArrayBufferView): ArrayBufferView; } interface SVGAnimatedPathData { diff --git a/bin/tsc.js b/bin/tsc.js index 3323c446649..49960ff3e50 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -1399,6 +1399,8 @@ var ts; Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -11553,7 +11555,7 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { return instantiateType(mapper1(t), mapper2); }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -20156,8 +20158,8 @@ var ts; ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; - var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; - var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -24441,7 +24443,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -24450,14 +24452,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -24663,6 +24665,53 @@ var ts; return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); } } + function computeCommonSourceDirectory(sourceFiles) { + var commonPathComponents; + var currentDirectory = host.getCurrentDirectory(); + ts.forEach(files, function (sourceFile) { + if (ts.isDeclarationFile(sourceFile)) { + return; + } + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + sourcePathComponents.pop(); + if (!commonPathComponents) { + commonPathComponents = sourcePathComponents; + return; + } + for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + commonPathComponents.length = i; + break; + } + } + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + return ts.getNormalizedPathFromPathComponents(commonPathComponents); + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + var allFilesBelongToPath = true; + if (sourceFiles) { + var currentDirectory = host.getCurrentDirectory(); + var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + if (!ts.isDeclarationFile(sourceFile)) { + var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + allFilesBelongToPath = false; + } + } + } + } + return allFilesBelongToPath; + } function verifyCompilerOptions() { if (options.separateCompilation) { if (options.sourceMap) { @@ -24710,34 +24759,13 @@ var ts; options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { commonSourceDirectory += ts.directorySeparator; } } @@ -24864,6 +24892,13 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "rootDir", + type: "string", + isFilePath: true, + description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + paramType: ts.Diagnostics.LOCATION + }, { name: "separateCompilation", type: "boolean" diff --git a/bin/tsserver.js b/bin/tsserver.js index b54ac96e5d0..782f4471799 100644 --- a/bin/tsserver.js +++ b/bin/tsserver.js @@ -1399,6 +1399,8 @@ var ts; Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -2796,6 +2798,13 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "rootDir", + type: "string", + isFilePath: true, + description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + paramType: ts.Diagnostics.LOCATION + }, { name: "separateCompilation", type: "boolean" @@ -11896,7 +11905,7 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { return instantiateType(mapper1(t), mapper2); }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512); @@ -20499,8 +20508,8 @@ var ts; ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; function emitFiles(resolver, host, targetSourceFile) { var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; - var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; - var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); var languageVersion = compilerOptions.target || 0; @@ -24784,7 +24793,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -24793,14 +24802,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -25006,6 +25015,53 @@ var ts; return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); } } + function computeCommonSourceDirectory(sourceFiles) { + var commonPathComponents; + var currentDirectory = host.getCurrentDirectory(); + ts.forEach(files, function (sourceFile) { + if (ts.isDeclarationFile(sourceFile)) { + return; + } + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + sourcePathComponents.pop(); + if (!commonPathComponents) { + commonPathComponents = sourcePathComponents; + return; + } + for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + commonPathComponents.length = i; + break; + } + } + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + return ts.getNormalizedPathFromPathComponents(commonPathComponents); + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + var allFilesBelongToPath = true; + if (sourceFiles) { + var currentDirectory = host.getCurrentDirectory(); + var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + if (!ts.isDeclarationFile(sourceFile)) { + var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + allFilesBelongToPath = false; + } + } + } + } + return allFilesBelongToPath; + } function verifyCompilerOptions() { if (options.separateCompilation) { if (options.sourceMap) { @@ -25053,34 +25109,13 @@ var ts; options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 2048) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); + } + else { + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { commonSourceDirectory += ts.directorySeparator; } } @@ -34835,6 +34870,9 @@ var ts; if (lineText.charAt(i) == " ") { indentPosition--; } + else if (lineText.charAt(i) == "\t") { + indentPosition -= editorOptions.IndentSize; + } else { break; } diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index 2ce77b9fb70..f86da199763 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -1095,6 +1095,7 @@ declare module "typescript" { preserveConstEnums?: boolean; project?: string; removeComments?: boolean; + rootDir?: string; sourceMap?: boolean; sourceRoot?: string; suppressImplicitAnyIndexErrors?: boolean; diff --git a/bin/typescript.js b/bin/typescript.js index 8b29d8d0252..e012dbafb5b 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -2133,6 +2133,8 @@ var ts; Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -14105,7 +14107,7 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { return instantiateType(mapper1(t), mapper2); }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512 /* TypeParameter */); @@ -24025,9 +24027,9 @@ var ts; // emit output for the __extends helper function var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; // emit output for the __decorate helper function - var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; // emit output for the __metadata helper function - var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; // emit output for the __param helper function var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); @@ -28855,7 +28857,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -28864,14 +28866,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -29095,6 +29097,57 @@ var ts; return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); } } + function computeCommonSourceDirectory(sourceFiles) { + var commonPathComponents; + var currentDirectory = host.getCurrentDirectory(); + ts.forEach(files, function (sourceFile) { + // Each file contributes into common source file path + if (ts.isDeclarationFile(sourceFile)) { + return; + } + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + sourcePathComponents.pop(); // The base file name is not part of the common directory path + if (!commonPathComponents) { + // first file + commonPathComponents = sourcePathComponents; + return; + } + for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + // New common path found that is 0 -> i-1 + commonPathComponents.length = i; + break; + } + } + // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + return ts.getNormalizedPathFromPathComponents(commonPathComponents); + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + var allFilesBelongToPath = true; + if (sourceFiles) { + var currentDirectory = host.getCurrentDirectory(); + var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + if (!ts.isDeclarationFile(sourceFile)) { + var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + allFilesBelongToPath = false; + } + } + } + } + return allFilesBelongToPath; + } function verifyCompilerOptions() { if (options.separateCompilation) { if (options.sourceMap) { @@ -29147,38 +29200,15 @@ var ts; options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - // Each file contributes into common source file path - if (!(sourceFile.flags & 2048 /* DeclarationFile */) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); // FileName is not part of directory - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; - } - } - // If the fileComponent path completely matched and less than already found update the length - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - // first file - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + // If a rootDir is specified and is valid use it as the commonSourceDirectory + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); + } + else { + // Compute the commonSourceDirectory from the input files + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { // Make sure directory path ends with directory separator so this string can directly // used to replace with "" to get the relative path of the source file and the relative path doesn't // start with / making it rooted path @@ -29309,6 +29339,13 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "rootDir", + type: "string", + isFilePath: true, + description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + paramType: ts.Diagnostics.LOCATION + }, { name: "separateCompilation", type: "boolean" diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index e6d06765c27..cd8ee05add4 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -1095,6 +1095,7 @@ declare module ts { preserveConstEnums?: boolean; project?: string; removeComments?: boolean; + rootDir?: string; sourceMap?: boolean; sourceRoot?: string; suppressImplicitAnyIndexErrors?: boolean; diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 8b29d8d0252..e012dbafb5b 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -2133,6 +2133,8 @@ var ts; Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, + Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, @@ -14105,7 +14107,7 @@ var ts; return type; } function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; + return function (t) { return instantiateType(mapper1(t), mapper2); }; } function instantiateTypeParameter(typeParameter, mapper) { var result = createType(512 /* TypeParameter */); @@ -24025,9 +24027,9 @@ var ts; // emit output for the __extends helper function var extendsHelper = "\nvar __extends = this.__extends || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; // emit output for the __decorate helper function - var decorateHelper = "\nvar __decorate = this.__decorate || (typeof Reflect === \"object\" && Reflect.decorate) || function (decorators, target, key, desc) {\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; + var decorateHelper = "\nvar __decorate = this.__decorate || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; // emit output for the __metadata helper function - var metadataHelper = "\nvar __metadata = this.__metadata || (typeof Reflect === \"object\" && Reflect.metadata) || function () { };"; + var metadataHelper = "\nvar __metadata = this.__metadata || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; // emit output for the __param helper function var paramHelper = "\nvar __param = this.__param || function(index, decorator) { return function (target, key) { decorator(target, key, index); } };"; var compilerOptions = host.getCompilerOptions(); @@ -28855,7 +28857,7 @@ var ts; getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, getCommonSourceDirectory: function () { return commonSourceDirectory; }, emit: emit, - getCurrentDirectory: host.getCurrentDirectory, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, @@ -28864,14 +28866,14 @@ var ts; return program; function getEmitHost(writeFileCallback) { return { - getCanonicalFileName: host.getCanonicalFileName, + getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: host.getCurrentDirectory, - getNewLine: host.getNewLine, + getCurrentDirectory: function () { return host.getCurrentDirectory(); }, + getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || host.writeFile + writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) }; } function getDiagnosticsProducingTypeChecker() { @@ -29095,6 +29097,57 @@ var ts; return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); } } + function computeCommonSourceDirectory(sourceFiles) { + var commonPathComponents; + var currentDirectory = host.getCurrentDirectory(); + ts.forEach(files, function (sourceFile) { + // Each file contributes into common source file path + if (ts.isDeclarationFile(sourceFile)) { + return; + } + var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory); + sourcePathComponents.pop(); // The base file name is not part of the common directory path + if (!commonPathComponents) { + // first file + commonPathComponents = sourcePathComponents; + return; + } + for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { + if (commonPathComponents[i] !== sourcePathComponents[i]) { + if (i === 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); + return; + } + // New common path found that is 0 -> i-1 + commonPathComponents.length = i; + break; + } + } + // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + return ts.getNormalizedPathFromPathComponents(commonPathComponents); + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + var allFilesBelongToPath = true; + if (sourceFiles) { + var currentDirectory = host.getCurrentDirectory(); + var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (var _i = 0; _i < sourceFiles.length; _i++) { + var sourceFile = sourceFiles[_i]; + if (!ts.isDeclarationFile(sourceFile)) { + var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + allFilesBelongToPath = false; + } + } + } + } + return allFilesBelongToPath; + } function verifyCompilerOptions() { if (options.separateCompilation) { if (options.sourceMap) { @@ -29147,38 +29200,15 @@ var ts; options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModuleSourceFile !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - // Each file contributes into common source file path - if (!(sourceFile.flags & 2048 /* DeclarationFile */) - && !ts.fileExtensionIs(sourceFile.fileName, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, host.getCurrentDirectory()); - sourcePathComponents.pop(); // FileName is not part of directory - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; - } - } - // If the fileComponent path completely matched and less than already found update the length - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - // first file - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { + if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { + // If a rootDir is specified and is valid use it as the commonSourceDirectory + commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); + } + else { + // Compute the commonSourceDirectory from the input files + commonSourceDirectory = computeCommonSourceDirectory(files); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { // Make sure directory path ends with directory separator so this string can directly // used to replace with "" to get the relative path of the source file and the relative path doesn't // start with / making it rooted path @@ -29309,6 +29339,13 @@ var ts; type: "boolean", description: ts.Diagnostics.Do_not_emit_comments_to_output }, + { + name: "rootDir", + type: "string", + isFilePath: true, + description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, + paramType: ts.Diagnostics.LOCATION + }, { name: "separateCompilation", type: "boolean" From a17d1cd38c2f475431deac851e7095770b12c79b Mon Sep 17 00:00:00 2001 From: Pedro Maltez Date: Wed, 22 Apr 2015 00:57:59 +0100 Subject: [PATCH 11/13] Add SVG version of logo as per #1375 --- doc/logo.svg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/logo.svg diff --git a/doc/logo.svg b/doc/logo.svg new file mode 100644 index 00000000000..fc7e0fadd66 --- /dev/null +++ b/doc/logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + From 92756e135b08a6d1481c238256d3859c968d0ce0 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 21 Apr 2015 17:01:34 -0700 Subject: [PATCH 12/13] Blocks with locals should be added to the container chain so we can detect name collisions in them. --- src/compiler/binder.ts | 15 +++++++---- src/compiler/scanner.ts | 2 +- .../nameCollisionWithBlockScopedVariable1.js | 25 +++++++++++++++++++ ...eCollisionWithBlockScopedVariable1.symbols | 17 +++++++++++++ ...ameCollisionWithBlockScopedVariable1.types | 19 ++++++++++++++ .../nameCollisionWithBlockScopedVariable1.ts | 10 ++++++++ 6 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js create mode 100644 tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols create mode 100644 tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types create mode 100644 tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9d6d9fab35b..170f3d3c830 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -239,11 +239,7 @@ module ts { if (symbolKind & SymbolFlags.IsContainer) { container = node; - if (lastContainer) { - lastContainer.nextContainer = container; - } - - lastContainer = container; + addToContainerChain(container); } if (isBlockScopeContainer) { @@ -262,6 +258,14 @@ module ts { blockScopeContainer = savedBlockScopeContainer; } + function addToContainerChain(node: Node) { + if (lastContainer) { + lastContainer.nextContainer = node; + } + + lastContainer = node; + } + function bindDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags, isBlockScopeContainer: boolean) { switch (container.kind) { case SyntaxKind.ModuleDeclaration: @@ -403,6 +407,7 @@ module ts { default: if (!blockScopeContainer.locals) { blockScopeContainer.locals = {}; + addToContainerChain(blockScopeContainer); } declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes); } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index c2b693d6772..df6c20a8107 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -352,7 +352,7 @@ module ts { export function isLineBreak(ch: number): boolean { // ES5 7.3: // The ECMAScript line terminator characters are listed in Table 3. - // Table 3 — Line Terminator Characters + // Table 3: Line Terminator Characters // Code Unit Value Name Formal Name // \u000A Line Feed // \u000D Carriage Return diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js new file mode 100644 index 00000000000..6a7041a6733 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.js @@ -0,0 +1,25 @@ +//// [nameCollisionWithBlockScopedVariable1.ts] +module M { + export class C { } +} +module M { + { + let M = 0; + new C(); + } +} + +//// [nameCollisionWithBlockScopedVariable1.js] +var M; +(function (M) { + class C { + } + M.C = C; +})(M || (M = {})); +var M; +(function (M_1) { + { + let M = 0; + new M_1.C(); + } +})(M || (M = {})); diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols new file mode 100644 index 00000000000..9c0d01bd8e9 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts === +module M { +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1)) + + export class C { } +>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10)) +} +module M { +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 0), Decl(nameCollisionWithBlockScopedVariable1.ts, 2, 1)) + { + let M = 0; +>M : Symbol(M, Decl(nameCollisionWithBlockScopedVariable1.ts, 5, 11)) + + new C(); +>C : Symbol(C, Decl(nameCollisionWithBlockScopedVariable1.ts, 0, 10)) + } +} diff --git a/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types new file mode 100644 index 00000000000..7a3c07af187 --- /dev/null +++ b/tests/baselines/reference/nameCollisionWithBlockScopedVariable1.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts === +module M { +>M : typeof M + + export class C { } +>C : C +} +module M { +>M : typeof M + { + let M = 0; +>M : number +>0 : number + + new C(); +>new C() : C +>C : typeof C + } +} diff --git a/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts new file mode 100644 index 00000000000..231476ee339 --- /dev/null +++ b/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts @@ -0,0 +1,10 @@ +// @target: es6 +module M { + export class C { } +} +module M { + { + let M = 0; + new C(); + } +} \ No newline at end of file From 81ebac5d77b90f616a687bd6a0b8466fd09f65ff Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 21 Apr 2015 17:05:03 -0700 Subject: [PATCH 13/13] Produce type and symbol baseslines when running tests. --- src/harness/compilerRunner.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 42a0cabe48c..3dbd67190e9 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -97,7 +97,7 @@ class CompilerBaselineRunner extends RunnerBase { program = _program; }, function (settings) { harnessCompiler.setCompilerSettings(tcSettings); - }); + }); }); beforeEach(() => { @@ -252,7 +252,7 @@ class CompilerBaselineRunner extends RunnerBase { } }); - it('Correct type baselines for ' + fileName, () => { + it('Correct type/symbol baselines for ' + fileName, () => { if (fileName.indexOf("APISample") >= 0) { return; } @@ -289,8 +289,26 @@ class CompilerBaselineRunner extends RunnerBase { // Produce baselines. The first gives the types for all expressions. // The second gives symbols for all identifiers. - checkBaseLines(/*isSymbolBaseLine:*/ false); - checkBaseLines(/*isSymbolBaseLine:*/ true); + var e1: Error, e2: Error; + try { + checkBaseLines(/*isSymbolBaseLine:*/ false); + } + catch (e) { + e1 = e; + } + + try { + checkBaseLines(/*isSymbolBaseLine:*/ true); + } + catch (e) { + e2 = e; + } + + if (e1 || e2) { + throw e1 || e2; + } + + return; function checkBaseLines(isSymbolBaseLine: boolean) { let fullBaseLine = generateBaseLine(fullResults, isSymbolBaseLine);